Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Fix failing test in test/main.go #54

Closed
anweiss opened this issue Jan 18, 2019 · 6 comments
Closed

Fix failing test in test/main.go #54

anweiss opened this issue Jan 18, 2019 · 6 comments
Assignees
Labels
bug Something isn't working test Unit, functional and end-to-end testing

Comments

@anweiss
Copy link
Contributor

anweiss commented Jan 18, 2019

Test fails for test/main.go:

test/main.go:13:14: undefined: oscalkit.ApplicableControls

@farhan-khan30 can you address this?

Supports #10.

@anweiss anweiss added bug Something isn't working test Unit, functional and end-to-end testing labels Jan 18, 2019
@anweiss
Copy link
Contributor Author

anweiss commented Jan 20, 2019

@minhaj10p could you help with this one? We need to exclude this test since it's dependent on the generated code in templates/catalog.go

@asadullah-yousuf-10p
Copy link
Contributor

@anweiss looks like this issue is related to #35
We do need to exclude this folder and use bash scripts to run this test instead. @farhan-khan30 what do you think?

@farhankamalkhan-10p
Copy link
Contributor

@anweiss #35 and this current issue are both occurring because the class being tested currently does not exist.
As mentioned in the readme of this test, i.e. "NOTE: This is a test so output.go (generated using oscalkit cli) should already exist when running this test.", cli/main.go generate has to be run before the test can be executed as I can not test something that does not exist. Since the test imports the generated code, the test will not compile without output.go existing.
The solution to this could be to

  1. Exclude the test from CircleCI
  2. Create a bash test target that runs the actual test by running cli/main.go generate, running the actual test, and removing output.go.

@anweiss
Copy link
Contributor Author

anweiss commented Jan 21, 2019

@farhan-khan30 let's see if we can go with option 2 that you've proposed, so that we can still run the test against the generated code, rather than excluding it altogether.

@farhankamalkhan-10p
Copy link
Contributor

@anweiss as suggested in option 2 created PR #72. I have created a bash script that will run cli/main.go generate code before running the test. I have also made some changes to the Makefile so that make test will run the test with the NIST profiles before running all the other tests. This test does not handle the profile in profile import scenario for now.

@anweiss
Copy link
Contributor Author

anweiss commented Feb 4, 2019

Closing for now. Can revisit other issues separately.

@anweiss anweiss closed this as completed Feb 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working test Unit, functional and end-to-end testing
Projects
None yet
Development

No branches or pull requests

4 participants