-
Notifications
You must be signed in to change notification settings - Fork 248
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
Rework CI & Tests Handling #1137
base: main
Are you sure you want to change the base?
Conversation
Opened as a draft, as this is not yet ready for merge. I would say its like 80% there, but that remaining 20% could prove to be a lot of effort, so I first want to know if there's interest in moving this forward, otherwise I am happy to shelve the work so far. I had a lot of fun writing the runner itself, and I think we need to rework the way we do tests anyway as we add other types of tests (for example reflection api tests as mentioned above, or unit tests for the compiler code). |
test/regression/results/mixed-allcpp1-hello/02-x64-linux-g++-c++20-compiler.output
Outdated
Show resolved
Hide resolved
test/regression/results/mixed-bugfix-for-ufcs-non-local/02-x64-linux-g++-c++20-compiler.output
Outdated
Show resolved
Hide resolved
test/regression/results/mixed-intro-example-three-loops/02-x64-linux-g++-c++20-compiler.output
Outdated
Show resolved
Hide resolved
.../regression/results/mixed-postexpression-with-capture/02-x64-linux-g++-c++20-compiler.output
Outdated
Show resolved
Hide resolved
Thanks! Hot take: This could be good, but it will also take me a lot to absorb. I'm used to the current workflow, but that doesn't mean I can't get used to a better one. Is the idea to streamline the CI test pipeline, or also the checked-in tests for each platform? (The answer is probably in the "changed files" but there are over 3,000 so I didn't even try to look.)
Yes, corresponds to that there's one
If you mean
Wait, you mean per Cpp1 compiler? I currently keep one set of outputs (
That seems reasonable, replacing an empty file with no file. The potential danger is not detecting when a test failed to run (e.g., the Cpp1 compiler crashed)... that's one reason I keep the file even if it's empty. Thanks for looking into this, though. I'm now leaving for the ISO C++ meeting so I'll be much slower to respond for the next week, but I appreciate all the input. |
There's no way I am making someone review that many files 😂 So here the idea would be to first enhance the pipeline, without changing any tests (unless we notice some previously broken tests).
Yes, I am aware some tests have the compiler output something, that should be caught with this new system as well. The main difference would be that their outputs will sit on the same folder.
I think we can easily detect if something like that happened (for example by checking the error code and making sure there was actually some output in stdout/stderr). But yes, the main idea is to reduce the filecount to something reasonable, while giving a better organization to the test suite. I actually have an item in my todo list to create a "control test" for each case that a test can result in.
Thanks for the heads-up, see you around! |
To Dos if we decide to move this forward (in no particular order):
Wishlist (not necessary for merge IMO but would be really cool to have):
|
Removed all the test changes for now. |
I think this would be really nice and it would also simplify updating the results. |
I have not looked at the MR yet. But one addition we currently do not have is parallel evaluation. Is this now possible would it be "easy" to add with the new framework? |
This comment was marked as resolved.
This comment was marked as resolved.
0e2a0a0
to
08cb411
Compare
df829f1
to
e42cce5
Compare
Just pushed the changes to run things in parallel, super simple implementation with |
This sound nice. I will have closer look next week. Maybe I can already use this to improve testing for the regexes. |
So, I wrote a small Python script to start count (and accounting) for all the tests to see where to go next. A ballpark of the redundant files is about 1415, that is, duplicated output files. I say an estimate because some compiler outputs between versions are the same, but we would still want to check in case their output changes. MSVC outputs the filename even if success and there are no warnings, we can probably teach the test suite to account for that and save plenty of file count there as well. I have pushed the script in case anybody wants to play around with it. |
@jarzec while testing this script I found some extraneous files, could you look into it?
|
Looks like accidentally committed. I can remove them in #1263. |
Hi! Just checking in as I clean up the PRs with the relicensing (see #1322), is still intended to be still a draft PR? If so perhaps I'll close it for now and you can reopen this or a new PR once it's ready to look at? As described in #1322, this didn't make release 0.8, so I will need a new one-time CLA that will cover all your future contributions. I've emailed you the new CLA, and one it's completed I can look at PRs. |
Hi, I signed the CLA, but at least for now I don't plan to work on this PR unless its a priority to get it merged. I am currently focused on my job and other projects. 😅 |
This PR reworks the Github Actions workflow files and its associated code, so that there's only 1 pipeline that does all that we might need:
Currently, the pass-through tests are not executed in the CI, and regressions test have duplicated logic to build cppfront (granted, its not that complex anyways).
The idea is that whatever cppfront lowers or outputs should be platform agnostic, likewise for the built executables, and so, for most tests there should be only a single output with which to test against. Additionally, plenty of tests do not output anything when executed, so rather than creating empty files, we should check that the executables under test didn't output anything as well.
Let's take as an example this recent commit, which added 1 test: 54edaba. It created the following files (related to testing):
Other than the test itself, it added 25 new files: Two per each target, plus the lowered output, plus the output of cppfront. 23 of those files are empty.
After the rework, the added files would look like this instead:
In general, the new format for regression tests would be:
Where
(ctx.target)$
would be the specified target (e.g.x64-linux-g++-c++20
), again, only if the compiler outputted something. This reorganization makes it much easier to find results of a test and decreases considerably the amount of files needed per test, it also makes adding new targets trivial as most tests should not output anything when compiling.The regression runner itself is written in Cpp2 as opposed to being a shell script. Ideally we treat testing just like we treat code, and re-use most logic of this file when implementing other types of test.
I started this as a side-quest, to pave up the way to test the reflection API (the functions intended to be used by end-users when they author their own metafunctions), and because it seemed to me that adding like 20~ files per new additional regression test is excessive.