Skip to content

Commit

Permalink
Use snapshot build for pipeline CLI testing
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
  • Loading branch information
luhring committed Mar 9, 2021
1 parent 49b04f1 commit e93bf99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/static-unit-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ jobs:

- name: Run integration tests
run: make integration

- name: Run CLI tests
run: make cli-linux
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e93bf99

Please sign in to comment.