Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: TestMain in main package will always cause the build to fail if go test is executed with coverfail argument #213

Open
techfg opened this issue Sep 16, 2024 · 0 comments

Comments

@techfg
Copy link

techfg commented Sep 16, 2024

main_test contains a TestMain that evaluates the code coverage percentage when coverfail argument is passed. There are a few issues with this:

  1. There are no tests in main_test package so when coverfail is passed, the threshold will never be met and therefore the test process will always fail
  2. There is nothing in the repo that ever triggers go test with coverfail (possibly this is only for internal use?)

It is unclear what the intent of TestMain is here - is the goal to evaluate code coverage for the entire set of tests across entire codebase or just an individual package? As it stands, TestMain will only evaluate code coverage for the main package - using the approach taken to evaluate each individual package would require a TestMain in every package where code coverage should be evaluated. Alternatively, there are ways to evaluate overall code coverage if that is the goal.

Given the lack of tests throughout the CLI currently, there doesn't seem to be much of an emphasis on code coverage but the questions are what is the intended purpose of TestMain currently and what is the overall goal of evaluating code coverage throughout the code base?

Related #166

techfg added a commit to techfg/skuid-cli that referenced this issue Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant