Closed brson closed 10 months ago
The regex allows subdirectories since commit 5fe4195b64, which adds tests that are contained in subdirectiories.
The easiest solution at the moment is probably just to create a more complicated regex that rejects paths containing something like -build/
.
Why don't we have a clean-up before running so each run will be like the first run?
Why don't we have a clean-up before running so each run will be like the first run?
The primary difficulty is that the datatest_stable::harness
macro is responsible for both discovering tests and generating the main function, so there is no opportunity to run custom code prior to the test harness.
I'm finding that it is actually hard to write a regex that says "allow all strings except one's that contain '-build/'". This isn't something the Rust regex engine can do in an obvious way.
We can possibly have the tests that link to the stdlib clean up after themselves to delete the .move
interface files, though that feels pretty ugly to me.
ok I have a regex that works. I'll post it shortly.
Maybe regex is good for now, but if the starting positions for different runs are not the same it will always remain a legit source of suspicion.
Maybe regex is good for now, but if the starting positions for different runs are not the same it will always remain a legit source of suspicion.
Good point. It looks like each individual test does clean up their build directories prior to doing their individual builds, so the tests shouldn't be building into dirty build directories; but there is no single step to clean up all build directories at once.
For CI checks this shouldn't matter, because they always run in a new clone of the repository.
For CI checks this shouldn't matter, because they always run in a new clone of the repository.
For CI indeed, but before CI we do a local test run and it may come out misleadingly correct.
After running rbpf-tests once, a second run will fail with errors like:
This is because of an interaction between the test_harness macro and tests that compile the stdlib: compiling the standard library generates "interface files" that have a
.move
extension, and they are generated under subdirectories of therbpf-tests
directory.The test_harness regex looks like:
This regex allows tests to be located in subdirs, so it pickes up the generated files and fails them.