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
Refactoring for better testability #31
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This cleans up the main process, and makes options parsing easier to test.
Also added tests for pkg parsing, opts parsing tests to follow
For instrumentation we use babel-plugin-istanbul, which instruments code for subsequent collection and reporting. For these latter two tasks, we use nyc. We also use codecov.io integration for checking status on GitHub.
Current coverage is 78.63% (diff: 91.17%)
|
👍 |
If not, the instrumentation will occur on already compiled code. This means that when we run code under test, it's JIT compiled as opposed to AOT compiled – this may cause problems if the config where to fall out of sync between JIT and AOT versions.
If we clean up, things like coverage reports will be removed and we won't get nifty graphs. Lack of nifty graphs makes me sad in the face.
This reverts the change to make unit tests load JIT compiled code and instead loads AOT compiled code instead. This makes sense, as we want to test the output, not precompiled source, and make sure we never get out of sync in terms of configuration. As well, this makes code coverage a distinct step from normal testing, so as not to incur performance penalties in an iterative development process.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With #30 we gained some initial scaffolding for tests, and with that we'll start increasing the test coverage of this project. To that end, this PR aims to refactor ez-build to make it more testable, and ideally easier to implement new functionality as well. Additionally, integration with code coverage tooling is another explicit goal of this work.
Motivation and Context
While #30 gave us a good start, it didn't include code coverage, and also highlighted that some parts (the main routine, for instance) was muddied by mixing too many concerns.
How Was This Tested?
Additional tests are included, to increase coverage, and instrumented building is enabled for the test script as well, to ensure we can get accurate code coverage reports on every build.
Types of changes
Checklist: