Skip to content

Commit

Permalink
chore: remove gotestsum to reduce the number of transitive dependenci…
Browse files Browse the repository at this point in the history
…es (#1303)

* chore: remove gotestsum to reduce the number of transitive dependencies

* chore: do not store jUnit test reports on the GH action

* fix: wrong copy paste

* Revert "chore: do not store jUnit test reports on the GH action"

This reverts commit 82d8be8.

* chore: install gotestsum at CI time, only

* chore: mod tidy compose
  • Loading branch information
mdelapenya authored Jun 23, 2023
1 parent c0e1c32 commit f5a4a54
Show file tree
Hide file tree
Showing 105 changed files with 120 additions and 1,566 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/bigtable-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/bigtable
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/bigtable
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-reaper-off.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: gotestsum
- name: go test
# only run tests on linux, there are a number of things that won't allow the tests to run on anything else
# many (maybe, all?) images used can only be build on Linux, they don't have Windows in their manifest, and
# we can't put Windows Server in "Linux Mode" in Github actions
# another, host mode is only available on Linux, and we have tests around that, do we skip them?
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-rootless-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ jobs:
GOOS: linux
run: go build

- name: gotestsum
- name: go test
# only run tests on linux, there are a number of things that won't allow the tests to run on anything else
# many (maybe, all?) images used can only be build on Linux, they don't have Windows in their manifest, and
# we can't put Windows Server in "Linux Mode" in Github actions
# another, host mode is only available on Linux, and we have tests around that, do we skip them?
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ jobs:
GOOS: linux
run: go build

- name: gotestsum
- name: go test
# only run tests on linux, there are a number of things that won't allow the tests to run on anything else
# many (maybe, all?) images used can only be build on Linux, they don't have Windows in their manifest, and
# we can't put Windows Server in "Linux Mode" in Github actions
# another, host mode is only available on Linux, and we have tests around that, do we skip them?
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run module generator tests
if: ${{ matrix.platform == 'ubuntu-latest' }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/cockroachdb-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/cockroachdb
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/cockroachdb
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/consul-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/consul
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/consul
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/datastore-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/datastore
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/datastore
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/firestore-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/firestore
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/firestore
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/module-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ jobs:
working-directory: ./modules/compose
run: go mod tidy

- name: gotestsum
- name: go test
working-directory: ./modules/compose
run: |
go run gotest.tools/gotestsum \
--format short-verbose \
--rerun-fails=5 \
--packages="./..." \
--junitfile TEST-compose.xml
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-couchbase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/couchbase
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/couchbase
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-k3s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/k3s
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/k3s
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-localstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/localstack
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/localstack
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/mysql
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/mysql
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-neo4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/neo4j
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/neo4j
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/postgres
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/postgres
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-pulsar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/pulsar
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/pulsar
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/redis
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/redis
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-redpanda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/redpanda
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/redpanda
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/module-vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./modules/vault
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./modules/vault
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mongodb-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/mongodb
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/mongodb
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/nats-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/nats
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/nats
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/nginx-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/nginx
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/nginx
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pubsub-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/pubsub
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/pubsub
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/spanner-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/spanner
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/spanner
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/toxiproxy-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
working-directory: ./examples/toxiproxy
run: make tools-tidy

- name: gotestsum
- name: go test
working-directory: ./examples/toxiproxy
run: make test-unit
run: |
go install gotest.tools/gotestsum@latest
make test-unit
- name: Run checker
run: |
Expand Down
2 changes: 1 addition & 1 deletion commons-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies-scan:
.PHONY: test-%
test-%:
@echo "Running $* tests..."
go run gotest.tools/gotestsum \
gotestsum \
--format short-verbose \
--rerun-fails=5 \
--packages="./..." \
Expand Down
1 change: 0 additions & 1 deletion docs/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ We have provided a command line tool to generate the scaffolding for the code of
- a Go file for the creation of the container, using a dedicated struct in which the image flag is set as Docker image.
- a Go test file for running a simple test for your container, consuming the above struct.
- a Makefile to run the tests in a consistent manner
- a tools.go file including the build tools (i.e. `gotestsum`) used to build/run the example.
- a markdown file in the docs/modules directory including the snippets for both the creation of the container and a simple test. By default, this generated file will contain all the documentation for the module, including:
- the version of _Testcontainers for Go_ in which the module was added.
- a short introduction to the module.
Expand Down
Loading

0 comments on commit f5a4a54

Please sign in to comment.