Skip to content

Commit

Permalink
bats: color formatter in CI (crowdsecurity#2838)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Feb 12, 2024
1 parent a6a4d46 commit 4561eb7
Show file tree
Hide file tree
Showing 5 changed files with 359 additions and 14 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/bats-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
GIST_BADGES_ID:
required: true

env:
PREFIX_TEST_NAMES_WITH_FILE: true

jobs:
build:
strategy:
Expand Down Expand Up @@ -50,7 +47,7 @@ jobs:
- name: "Run hub tests"
run: |
./test/bin/generate-hub-tests
./test/run-tests test/dyn-bats/${{ matrix.test-file }}
./test/run-tests ./test/dyn-bats/${{ matrix.test-file }} --formatter $(pwd)/test/lib/color-formatter
- name: "Collect hub coverage"
run: ./test/bin/collect-hub-coverage >> $GITHUB_ENV
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/bats-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
required: true
type: string

env:
PREFIX_TEST_NAMES_WITH_FILE: true

jobs:
build:
name: "Functional tests"
Expand Down Expand Up @@ -58,7 +55,7 @@ jobs:
MYSQL_USER: root

- name: "Run tests"
run: make bats-test
run: ./test/run-tests ./test/bats --formatter $(pwd)/test/lib/color-formatter
env:
DB_BACKEND: mysql
MYSQL_HOST: 127.0.0.1
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/bats-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: (sub) Bats / Postgres
on:
workflow_call:

env:
PREFIX_TEST_NAMES_WITH_FILE: true

jobs:
build:
name: "Functional tests"
Expand Down Expand Up @@ -67,7 +64,7 @@ jobs:
PGUSER: postgres

- name: "Run tests (DB_BACKEND: pgx)"
run: make bats-test
run: ./test/run-tests ./test/bats --formatter $(pwd)/test/lib/color-formatter
env:
DB_BACKEND: pgx
PGHOST: 127.0.0.1
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/bats-sqlite-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
workflow_call:

env:
PREFIX_TEST_NAMES_WITH_FILE: true
TEST_COVERAGE: true

jobs:
Expand Down Expand Up @@ -42,7 +41,7 @@ jobs:
make clean bats-build bats-fixture BUILD_STATIC=1
- name: "Run tests"
run: make bats-test
run: ./test/run-tests ./test/bats --formatter $(pwd)/test/lib/color-formatter

- name: "Collect coverage data"
run: |
Expand Down
Loading

0 comments on commit 4561eb7

Please sign in to comment.