From a69f6aec9092887a737e7e915f55855ff998898d Mon Sep 17 00:00:00 2001 From: Will Murphy Date: Tue, 22 Apr 2025 10:23:52 -0400 Subject: [PATCH] docs: document test commands (#3816) So that contributors can quickly figure out how to run tests. Signed-off-by: Will Murphy --- DEVELOPING.md | 10 ++++++++++ Taskfile.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/DEVELOPING.md b/DEVELOPING.md index fd14963df..91cdc3f80 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -227,6 +227,16 @@ rough outline how that works: ## Testing +### Testing commands + +* `make help` shows a list of available commands +* `make unit`, `make integration`, `make cli`, and `make acceptance` run those test suites (see below) +* `make test` runs all those tests (and is therefore pretty slow) +* `make fixtures` clears and re-fetches all test fixtures. +* `go test ./syft/pkg/` for example can test particular packages, assuming fixtures are already made +* `make clean-cache` cleans all test cache. Note that subsequent test runs will be slower after this + + ### Levels of testing - `unit`: The default level of test which is distributed throughout the repo are unit tests. Any `_test.go` file that diff --git a/Taskfile.yaml b/Taskfile.yaml index f56742712..e532ef851 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -224,7 +224,7 @@ tasks: - "go run -race cmd/syft/main.go alpine:latest" validate-cyclonedx-schema: - desc: Run integration tests + desc: Validate that Syft produces valid CycloneDX documents cmds: - "cd schema/cyclonedx && make"