Skip to content

Commit 22b7ec9

Browse files
authored
Fix/bsi license test (#664)
* fix bsi license test * avoid caching result
1 parent e491e60 commit 22b7ec9

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ lint: ## Run golangci-lint (requires golangci-lint installed)
9696
.PHONY: test
9797
test: generate ## Run all tests
9898
@echo "Running tests..."
99-
@go test -cover -race ./...
99+
@go test -count=1 -cover -race ./...
100100

101101
##@ Building
102102

@@ -176,11 +176,11 @@ ci: deps generate vet ## Run CI pipeline locally with test summary
176176
@echo "Running CI pipeline..."
177177
@set +e; \
178178
echo "Unit tests:"; \
179-
go test -cover -race -failfast -p 1 $$(go list ./... | grep -v integration_test) 2>&1 | grep -E "^(ok|FAIL|coverage:)" | sed 's/github.com\/interlynk-io\/sbomqs\/v2\///' ; \
179+
go test -count=1 -cover -race -failfast -p 1 $$(go list ./... | grep -v integration_test) 2>&1 | grep -E "^(ok|FAIL|coverage:)" | sed 's/github.com\/interlynk-io\/sbomqs\/v2\///' ; \
180180
UNIT_EXIT_CODE=$$?; \
181181
echo ""; \
182182
echo "Integration tests:"; \
183-
go test -run "Test_ScoreForStaticSBOMFiles_Summary|Test_NTIAProfile|Test_NTIA2025Profile|Test_InterlynkProfile" ./pkg/scorer/v2/... 2>&1 | grep -E "(PASS|FAIL|ok|NTIA.*Profile:|Interlynk.*Profile:)" ; \
183+
go test -count=1 -run "Test_ScoreForStaticSBOMFiles_Summary|Test_NTIAProfile|Test_NTIA2025Profile|Test_InterlynkProfile" ./pkg/scorer/v2/... 2>&1 | grep -E "(PASS|FAIL|ok|NTIA.*Profile:|Interlynk.*Profile:)" ; \
184184
INTEGRATION_EXIT_CODE=$$?; \
185185
echo ""; \
186186
echo "=========================================="; \

pkg/compliance/bsiV11_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,8 @@ func TestBSIComponentLicense(t *testing.T) {
14691469
assert.InDelta(t, 10.0, got.Score, 1e-9)
14701470
assert.Equal(t, COMP_LICENSE, got.CheckKey)
14711471
assert.Equal(t, common.UniqueElementID(c), got.ID)
1472-
assert.Equal(t, "Apache-2.0 (compliant)", got.CheckValue)
1472+
// License expression "Apache-2.0 OR MIT", either license is valid
1473+
assert.Contains(t, []string{"Apache-2.0 (compliant)", "MIT (compliant)"}, got.CheckValue)
14731474
}
14741475
})
14751476

0 commit comments

Comments
 (0)