Use snapshot build for pipeline CLI testing

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
Dan Luhring 2021-03-09 08:53:24 -05:00
parent 49b04f13eb
commit e93bf99d9d
No known key found for this signature in database
GPG key ID: 9CEE23D079426CEF
2 changed files with 11 additions and 3 deletions

View file

@ -92,3 +92,6 @@ jobs:
- name: Run integration tests
run: make integration
- name: Run CLI tests
run: make cli-linux

View file

@ -57,7 +57,7 @@ all: clean static-analysis test ## Run all checks (linting, license check, unit,
@printf '$(SUCCESS)All checks pass!$(RESET)\n'
.PHONY: test
test: unit validate-cyclonedx-schema integration acceptance-linux ## Run all tests (unit, integration, and linux acceptance tests )
test: unit validate-cyclonedx-schema integration acceptance-linux cli-linux ## Run all tests (unit, integration, linux acceptance, and linux CLI tests)
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(BOLD)$(CYAN)%-25s$(RESET)%s\n", $$1, $$2}'
@ -133,8 +133,13 @@ integration: ## Run integration tests
integration-fingerprint:
find test/integration/test-fixtures/image-* -type f -exec md5sum {} + | awk '{print $1}' | sort | md5sum | tee test/integration/test-fixtures/cache.fingerprint
.PHONY: cli
cli: ## Run CLI tests
.PHONY: cli-linux
cli-linux: $(SNAPSHOTDIR) ## Run CLI tests for Linux executable
GRYPE_BINARY_LOCATION='snapshot/grype_linux_amd64/grype' \
go test -count=1 -v ./test/cli
.PHONY: cli-macos
cli-macos: $(SNAPSHOTDIR) ## Run CLI tests for macOS executable
GRYPE_BINARY_LOCATION='snapshot/grype-macos_darwin_amd64/grype' \
go test -count=1 -v ./test/cli