[WIP] odoo-tester: use diff-cover to measure changed code coverage #1
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.
Changes I made to docker files:
install the diff-cover package
The sub-folders from udes-open are copied to the docker image. However this excludes the .git folder, which is used by diff-cover to determine code changes - solution: copy the parent folder.
diff-cover needs coverage data to be collected when the test is run relative to the "root" folder (that contains the .git folder):
All the coverage & diff-cover commands needs to be run from the "root" directory - solution: change to the "root" folder before running
The coverage commands create files in the "root" directory which require write permissions - solution: update permissions on the root folder to allow coverage data to be written
This is connected to another PR (in udes-open: github.com/unipartdigital/udes-open/pull/229) with the change:
Below is an example of the results of calling "diff-cover coverage.xml":
Each file with changes in the diff is listed along with:
Also there is a summary of changed lines and the number of lines that are executed across all the files in the diff.