mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
docs: document test commands (#3816)
So that contributors can quickly figure out how to run tests. Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
This commit is contained in:
parent
df11561929
commit
a69f6aec90
@ -227,6 +227,16 @@ rough outline how that works:
|
|||||||
|
|
||||||
## Testing
|
## 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
|
### Levels of testing
|
||||||
|
|
||||||
- `unit`: The default level of test which is distributed throughout the repo are unit tests. Any `_test.go` file that
|
- `unit`: The default level of test which is distributed throughout the repo are unit tests. Any `_test.go` file that
|
||||||
|
|||||||
@ -224,7 +224,7 @@ tasks:
|
|||||||
- "go run -race cmd/syft/main.go alpine:latest"
|
- "go run -race cmd/syft/main.go alpine:latest"
|
||||||
|
|
||||||
validate-cyclonedx-schema:
|
validate-cyclonedx-schema:
|
||||||
desc: Run integration tests
|
desc: Validate that Syft produces valid CycloneDX documents
|
||||||
cmds:
|
cmds:
|
||||||
- "cd schema/cyclonedx && make"
|
- "cd schema/cyclonedx && make"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user