docker-archive / oscalkit

NIST OSCAL SDK and CLI
https://docker.github.io/oscalkit/
Other
36 stars 23 forks source link

CircleCI test failing due to test utility #35

Closed asadullah-yousuf-10p closed 5 years ago

asadullah-yousuf-10p commented 5 years ago

Description

Getting this error in CircleCI: https://circleci.com/gh/docker/oscalkit/78

test/main.go:8:2: no Go files in /go/src/github.com/opencontrol/oscalkit
make: *** [test] Error 1
Makefile:32: recipe for target 'test' failed
Exited with code 2 

Reason

This is due to the fact that we have a test utility test/main.go which requires some files to be generated before it could even compile successfully.

Solution

One way to solve this issue is to rename test folder to test_util and then exclude it in test target by replacing line 32 in MakeFile from:

@go test -race -coverprofile=coverage.txt -covermode=atomic -v $(shell go list ./... | grep -v /vendor/)

to

@go test -race -coverprofile=coverage.txt -covermode=atomic -v $(shell go list ./... | grep -v '/vendor/\|/test_util')
anweiss commented 5 years ago

Hey @asadullah-yousuf-10p I've actually already fixed this since this build was executed. I simply placed an empty doc.go file in the root of the repo. The tests should be executed properly now for any new commits/PRs that are submitted.

asadullah-yousuf-10p commented 5 years ago

@anweiss cool. Let me know if you want to close this one.