-
Notifications
You must be signed in to change notification settings - Fork 70
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
CI: Get coverage of filecheck tests #256
Conversation
Notice that this currently does not include the coverage of tests that depend on the MLIR Pyhton bindings as the coverage is uploaded for the Python-based testing only. We might want to consider automatically updating the coverage once the MLIR-based testing has finished. |
Codecov ReportBase: 81.32% // Head: 77.80% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
==========================================
- Coverage 81.32% 77.80% -3.53%
==========================================
Files 31 38 +7
Lines 5510 6023 +513
Branches 938 1045 +107
==========================================
+ Hits 4481 4686 +205
- Misses 786 1082 +296
- Partials 243 255 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
8a3e776
to
847de6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I like the direction this is getting!
Okay, I think I have a design that somehwat makes sense now. Considering that lit seems to be weird around the
This also means that the coverage files get created next to the filecheck files. Therefore, the The aforementioned flags are passed to xdsl-opt in two steps:
|
323ff4a
to
6e4a56b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really nice now!
I added some comments, to see if we can make this a bit less error-prone for when we will update it, but that's really cool!
.github/workflows/ci-core.yml
Outdated
lit -v tests/filecheck/ -DCOVERAGE -DCOVERAGE_CONFIG=$(pwd)/.coveragerc | ||
- name: Combine coverage data | ||
run: | | ||
coverage combine --append tests/filecheck/ tests/filecheck/mlir-conversion/ tests/filecheck/mlir-conversion/with-bindings/ tests/filecheck/irdl-printer/ tests/filecheck/parser-printer/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this here where you can't use **
?
If this is the case, can we write a small script that automates this instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to coverage combine --append $(find tests/filecheck -type d)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Should we merge this now, or do you still want to add something else to it?
I want to make sure that the code coverage is properly uploaded since I'm not 100% sure how this exactly works. |
Yes, as somewhat expected/feared the .xml file was not found to upload. I will look into this on my way home, hoping I can fix it in time. O/w, we might have to wait until monday to merge this. If I succeed, I will just merge :) |
This is extremely weird. If I hard code the path to the file, it works. However, if I try to use the environment variable (so how a sane person would do it), the file is not found. Currently, I am trying to not pass a path and hope it works magically. If not, I will probably look into this again on Monday and merge it then... |
Well, it found everything, only the one it should have is missing... |
Thanks a lot for all this work. Personally, I don't really know how these things work, but I can take a look if you want! |
5ce0c12
to
eaee40a
Compare
I think I am getting closer. Now, the file is discovered, but it seems that some of the tests are not taken into account. That's why the coverage drops by so much... |
Noting for my future self: There are two issues atm: Both lit and pytest act like they didn't have the Python Bindings installed. Additionally, the ${GITHUB_WORKSPACE} env variable seems weird, and pytest hsa the wrong root directory. |
3d285a2
to
15d6878
Compare
Okay, I think this is about to get finished. I had one run earlier that behaved the way I wanted it too. Notice that we now lose some coverage as I have specified the source directories, so non-executed files are counted as 0% coverage. Furthermore, coverage is now generated on the MLIR CI. Side thought: We might want to think about what to do with all the |
This PR leverages the Coverage package to generate the code coverage of our file checks test suite. Currently, there are a couple of choices that are controversial, which I would like to hear your perspectives. I will add comments to the corresponding locations in the file.