Skip to content
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

[5.0] fix eosvmoc_limits_tests on non-x86 and non-Linux (where OC is not supported) #2392

Closed
wants to merge 1 commit into from

Conversation

spoonincode
Copy link
Member

Recall that the way ctest tests are populated for unit_test are by finding all the .cpp files in the unittests directory,

file(GLOB UNIT_TESTS "*.cpp") # find all unit test suites

sending those through a grep to find the TEST_SUITE() for each,
execute_process(COMMAND sh -c "grep -E 'BOOST_AUTO_TEST_SUITE\\s*[(]' '${TEST_SUITE}' | grep -vE '//.*BOOST_AUTO_TEST_SUITE\\s*[(]' | cut -d ')' -f 1 | cut -d '(' -f 2" OUTPUT_VARIABLE SUITE_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) # get the test suite name from the *.cpp file

and then adding a test on what it find, for each WASM runtime enabled,
foreach(RUNTIME ${EOSIO_WASM_RUNTIMES})
add_test(NAME ${TRIMMED_SUITE_NAME}_unit_test_${RUNTIME} COMMAND unit_test --run_test=${SUITE_NAME} --report_level=detailed --color_output -- --${RUNTIME})

Notice how previously the entire eosvmoc_limits_tests.cpp is #ifdefed away when OC is not enabled. The glob+grep above has no knowledge of this, so when OC is not enabled the cmake file generates a ctest entry that runs unit_test --run_test=eosvmoc_limits_tests but that will always fail because there is no test suite named eosvmoc_limits_tests.

Adjust the eosvmoc_limits test suite and tests to be defined no matter OC enabled or not, and just #ifdef out the small OC-specific part.

This change still looks strange: why are we running these OC limits tests at all with OC is not enabled for the build? Well, that's actually what is occurring even when OC is enabled normally on our x86 Linux builds. For example this previous run you can see that we run the eosvmoc_limits test even for non-OC runtimes:
https://github.com/AntelopeIO/leap/actions/runs/8634314462/job/23670206127#step:5:76
It's just that when OC isn't enabled limit_violated_test() always passes. So arguably this change is more consistent with what already occurs when OC builds are enabled vs, say, stubbing out a no-op test suite and test when OC build is not enabled. Any more complex changes to how tests are populated are probably not reasonably in scope for a release branch.

@spoonincode
Copy link
Member Author

Will not go in to 5.0

@spoonincode spoonincode closed this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants