diff --git a/Makefile b/Makefile index 8b6ee0b..9e34367 100644 --- a/Makefile +++ b/Makefile @@ -38,15 +38,10 @@ run-local: ## Run receiver directly via go run @GO_ENV=$(GO_ENV) go run $(CMD) listen .PHONY: test -test: ## Run unit tests (Ginkgo) +test: ## Run unit tests (Ginkgo, verbose) @command -v ginkgo >/dev/null || (echo "Please install ginkgo (go install github.com/onsi/ginkgo/v2/ginkgo@latest)"; exit 1) - @echo "Running Ginkgo unit test suites..." - @ginkgo -r ./cmd ./internal - -.PHONY: test-int -test-int: ## Run integration tests (requires Docker) - @echo "Running integration tests..." - @GO_ENV=$(GO_ENV) go test -tags=integration ./test/integration/... + @echo "Running Ginkgo unit test suites (verbose)..." + @ginkgo -r -v ./... .PHONY: test-int test-int: ## Run integration tests (requires Docker) diff --git a/README.md b/README.md index 54bb08b..9acf299 100644 --- a/README.md +++ b/README.md @@ -318,7 +318,7 @@ Dependencies are managed using Google Wire. To add a new dependency: The project keeps tests close to the code that they exercise: -- **Domain/adapter/app unit tests** live under `internal/**` and cover parsing, validation, orchestration, and adapters. Run them all with `task test` (or `make test`), which now uses the Ginkgo CLI to run unit test suites (`ginkgo -r ./cmd ./internal`). +- **Domain/adapter/app unit tests** live under `internal/**` and cover parsing, validation, orchestration, and adapters. Run them all with `task test` (or `make test`), which now uses the Ginkgo CLI to run unit test suites in verbose mode (`ginkgo -r -v ./...`). - **Integration tests** under `test/integration` spin up disposable TimescaleDB and NATS JetStream instances (via `testcontainers-go`) and execute a full ingestion flow. Use `task test-int` after ensuring Docker is running. - **Coverage goals** are tracked via `task coverage`, which produces both a coverage profile and an HTML report under `coverage/coverage.html`. @@ -330,7 +330,7 @@ The project keeps tests close to the code that they exercise: | Generate coverage html | `make coverage` | `task coverage` | | Lint (golangci-lint) | `make lint` | `task lint` | -> Integration tests need Docker available on the host. Ginkgo-based unit tests or lint targets require the respective binaries (`go install github.com/onsi/ginkgo/v2/ginkgo@latest`, [golangci-lint install guide](https://golangci-lint.run/)). Use `task install-test` to bootstrap Ginkgo tooling before running `task test`, `task test-all`, or their `make` equivalents. +> Integration tests need Docker available on the host. Ginkgo-based unit tests or lint targets require the respective binaries (`go install github.com/onsi/ginkgo/v2/ginkgo@latest`, [golangci-lint install guide](https://golangci-lint.run/)). Use `task install-test` to bootstrap Ginkgo tooling before running `task test`, `task test-all`, or their `make` equivalents. `make test` / `task test` run Ginkgo in verbose mode (`-v`), showing each spec for easier debugging. ## Message Flow diff --git a/Taskfile.yml b/Taskfile.yml index e8c4e94..b52560b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -55,15 +55,15 @@ tasks: GO_ENV=${GO_ENV:-dev} go run {{.cmd}} listen test: - desc: Run Ginkgo unit test suites + desc: Run Ginkgo unit test suites (verbose) cmds: - | if ! command -v ginkgo >/dev/null; then echo "Install ginkgo (go install github.com/onsi/ginkgo/v2/ginkgo@latest)" exit 1 fi - - echo "Running Ginkgo unit test suites..." - - ginkgo -r ./cmd ./internal + - echo "Running Ginkgo unit test suites (verbose)..." + - ginkgo -r -v ./... test-int: desc: Run integration tests (requires Docker)