mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
generate java fixtures ahead of tests
This commit is contained in:
parent
c9dea59232
commit
05c78de9d3
9
Makefile
9
Makefile
@ -112,9 +112,9 @@ check-licenses:
|
|||||||
$(TEMPDIR)/bouncer check
|
$(TEMPDIR)/bouncer check
|
||||||
|
|
||||||
.PHONY: unit
|
.PHONY: unit
|
||||||
unit: ## Run unit tests (with coverage)
|
unit: fixtures ## Run unit tests (with coverage)
|
||||||
$(call title,Running unit tests)
|
$(call title,Running unit tests)
|
||||||
go test -v -coverprofile $(COVER_REPORT) ./...
|
go test -coverprofile $(COVER_REPORT) ./...
|
||||||
@go tool cover -func $(COVER_REPORT) | grep total | awk '{print substr($$3, 1, length($$3)-1)}' > $(COVER_TOTAL)
|
@go tool cover -func $(COVER_REPORT) | grep total | awk '{print substr($$3, 1, length($$3)-1)}' > $(COVER_TOTAL)
|
||||||
@echo "Coverage: $$(cat $(COVER_TOTAL))"
|
@echo "Coverage: $$(cat $(COVER_TOTAL))"
|
||||||
@if [ $$(echo "$$(cat $(COVER_TOTAL)) >= $(COVERAGE_THRESHOLD)" | bc -l) -ne 1 ]; then echo "$(RED)$(BOLD)Failed coverage quality gate (> $(COVERAGE_THRESHOLD)%)$(RESET)" && false; fi
|
@if [ $$(echo "$$(cat $(COVER_TOTAL)) >= $(COVERAGE_THRESHOLD)" | bc -l) -ne 1 ]; then echo "$(RED)$(BOLD)Failed coverage quality gate (> $(COVERAGE_THRESHOLD)%)$(RESET)" && false; fi
|
||||||
@ -132,6 +132,11 @@ java-packages-fingerprint:
|
|||||||
@cd syft/cataloger/java/test-fixtures/java-builds && \
|
@cd syft/cataloger/java/test-fixtures/java-builds && \
|
||||||
make packages.fingerprint
|
make packages.fingerprint
|
||||||
|
|
||||||
|
.PHONY: fixtures
|
||||||
|
fixtures:
|
||||||
|
$(call title,Generating test fixtures)
|
||||||
|
cd syft/cataloger/java/test-fixtures/java-builds && make
|
||||||
|
|
||||||
.PHONY: clear-test-cache
|
.PHONY: clear-test-cache
|
||||||
clear-test-cache: ## Delete all test cache (built docker image tars)
|
clear-test-cache: ## Delete all test cache (built docker image tars)
|
||||||
find . -type f -wholename "**/test-fixtures/tar-cache/*.tar" -delete
|
find . -type f -wholename "**/test-fixtures/tar-cache/*.tar" -delete
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user