mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
chore: enforce race detector (#2122)
Previously, there were some data races in syft. Right now, none are detected, so check for data races on the overall command, and on unit tests. (Checking for races on integration tests triples the time needed for those tests, from ~1 minute to ~3 minutes on my workstation, so that was not done at this time.) Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
parent
3a45653cfa
commit
9de4129638
3
Makefile
3
Makefile
@ -147,13 +147,14 @@ check-json-schema-drift:
|
|||||||
.PHONY: unit
|
.PHONY: unit
|
||||||
unit: $(TEMP_DIR) fixtures ## Run unit tests (with coverage)
|
unit: $(TEMP_DIR) fixtures ## Run unit tests (with coverage)
|
||||||
$(call title,Running unit tests)
|
$(call title,Running unit tests)
|
||||||
go test -coverprofile $(TEMP_DIR)/unit-coverage-details.txt $(shell go list ./... | grep -v anchore/syft/test)
|
go test -race -coverprofile $(TEMP_DIR)/unit-coverage-details.txt $(shell go list ./... | grep -v anchore/syft/test)
|
||||||
@.github/scripts/coverage.py $(COVERAGE_THRESHOLD) $(TEMP_DIR)/unit-coverage-details.txt
|
@.github/scripts/coverage.py $(COVERAGE_THRESHOLD) $(TEMP_DIR)/unit-coverage-details.txt
|
||||||
|
|
||||||
.PHONY: integration
|
.PHONY: integration
|
||||||
integration: ## Run integration tests
|
integration: ## Run integration tests
|
||||||
$(call title,Running integration tests)
|
$(call title,Running integration tests)
|
||||||
go test -v ./test/integration
|
go test -v ./test/integration
|
||||||
|
go run -race cmd/syft/main.go alpine:latest
|
||||||
|
|
||||||
.PHONY: validate-cyclonedx-schema
|
.PHONY: validate-cyclonedx-schema
|
||||||
validate-cyclonedx-schema:
|
validate-cyclonedx-schema:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user