Add support for coverage files relative to shifter config #103
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.
Resubmitting this as a new pull request since github does not allow you to re-open requests.
This was #101 before. I've commented there and there is some additional detail not in this pull request.
This functionality is not covered by the build-dir option as suggested in the close comment. build-dir only makes the build relative. It doesn't change the coverage build options which are currently hardcoded as:
'build/' + filename + '/' + filename + '.js'This means that it is not relative in a recursive build where the modules may be spread over many directories. For example, our module layout is:
We have src and build directories in all of these locations, but if we were to write tests and attempt to get coverage on them without this fix, the coverage instrumentation from istanbul would specify the source file relative to each yui directory, and not to the project root. For example, we have moodle-core-tooltip which I've been writing tests for:
lib/yui/src/tooltip; which builds into`````` lib/yui/build/moodle-core-tooltip/moodle-core-tooltip.js
However, the coverage __coverage__ variable write the path is:build/moodle-core-tooltip/moodle-core-tooltip.js```Thus, when we pass it to grover across the entire project, the path is not found because it is incomplete.
The existing build-dir option cannot be used with a recursive build because it was changed to use path.resolve() recently and thus your builds end up in obscure locations not relevant to the src module depending on how you build (e.g. --walk vs from module vs --recursive).