This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Include runtimes test suites in check-all
ClosedPublic

Authored by phosek on Mar 9 2022, 12:56 AM.

Details

Reviewers
ldionne
beanz
smeenai
tstellar
Group Reviewers
Restricted Project
Restricted Project
Commits
rGf39a971d8210: [CMake] Include runtimes test suites in check-all
Summary

Prior to this change, we would make check-all depend on check-runtimes
which is a target that runs tests in the runtimes build. This means that
the runtimes tests are going to run prior to other test suites in
check-all, and if one of them fails, we won't run the other test suites
at all.

To address this issue, we instead collect the list of test suites and
their dependencies from the runtimes subbuild, and include them in
check-all, so a failure of runtimes test suite doesn't prevent other
test suites from being executed.

This addresses https://github.com/llvm/llvm-project/issues/54154.

Diff Detail

Event Timeline

phosek created this revision.Mar 9 2022, 12:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2022, 12:56 AM
Herald added a subscriber: mgorny. · View Herald Transcript
phosek requested review of this revision.Mar 9 2022, 12:56 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptMar 9 2022, 12:56 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
phosek edited the summary of this revision. (Show Details)Mar 9 2022, 12:56 AM
ldionne accepted this revision.Mar 9 2022, 7:39 AM

Interesting -- so you basically write the test dependencies, parameters and test suites i.e. everything that check-runtimes contains into a file:

add_lit_target(check-runtimes
    "Running all regression tests"
    ${RUNTIMES_LIT_TESTSUITES}
    PARAMS ${RUNTIMES_LIT_PARAMS}
    DEPENDS ${RUNTIMES_LIT_DEPENDS}
    ARGS ${RUNTIMES_LIT_EXTRA_ARGS}
)

and then you add that directly to check-all from the main build.

This makes a lot of sense in principle, I'm running some tests right now but this LGTM. I assume you've tested it too?

This revision is now accepted and ready to land.Mar 9 2022, 7:39 AM

When I apply your patch locally, run a bootstrapping build and then invoke check-all, for some reason I still see the check-runtimes target being run before all the other targets. I assume this is not intended?

When I apply your patch locally, run a bootstrapping build and then invoke check-all, for some reason I still see the check-runtimes target being run before all the other targets. I assume this is not intended?

I see it as well, let me debug this.

Interesting -- so you basically write the test dependencies, parameters and test suites i.e. everything that check-runtimes contains into a file:

add_lit_target(check-runtimes
    "Running all regression tests"
    ${RUNTIMES_LIT_TESTSUITES}
    PARAMS ${RUNTIMES_LIT_PARAMS}
    DEPENDS ${RUNTIMES_LIT_DEPENDS}
    ARGS ${RUNTIMES_LIT_EXTRA_ARGS}
)

and then you add that directly to check-all from the main build.

We use the same approach to also collect components from the compiler-rt build, see https://github.com/llvm/llvm-project/blob/c3a7627cacc6cbe2301a253daeb3e6953e5e0d1d/runtimes/Components.cmake.in.

phosek updated this revision to Diff 414169.Mar 9 2022, 11:27 AM

@ldionne can you try the updated version?

@ldionne can you try the updated version?

Just finished bootstrapping, and the tests are starting immediately with 85534 tests to run. That seems right!

This revision was landed with ongoing or failed builds.Mar 10 2022, 10:18 AM
This revision was automatically updated to reflect the committed changes.

When building with -DLLVM_ENABLE_RUNTIMES=openmp, this patch causes openmp runtime tests to no longer be included by check-all.

I've added a few subscribers who might want to be aware of this change.

@ronlieb this probably means our CI needs to do different things

IMHO, check-all should include openmp runtime tests, and this should be fixed. I'm not sure how openmp developers feel.

IMHO, check-all should include openmp runtime tests, and this should be fixed. I'm not sure how openmp developers feel.

Yes. @phosek, any idea why the OpenMP runtime tests are not picked up with this?

bcain added a subscriber: bcain.Mar 12 2022, 8:26 PM

I tested this a bit more and it seems like changes to Tests.cmake aren't picked up by Ninja for some reason. It's not specific only to OpenMP, it seems to be affecting all other runtimes as well. If I manually rerun CMake, the tests are picked up but this should happen automatically.

I tested this a bit more and it seems like changes to Tests.cmake aren't picked up by Ninja for some reason. It's not specific only to OpenMP, it seems to be affecting all other runtimes as well. If I manually rerun CMake, the tests are picked up but this should happen automatically.

I see the problem when building from scratch. I'm not sure if you are suggesting it happens only for incremental builds.

I have tried only openmp and ninja, not other runtimes or make.

Can you test D121647 to see if it resolves the issue for you?

Can you test D121647 to see if it resolves the issue for you?

Applying it at 6ac3d8ef9c43 causes check-all to include openmp tests (both libomp and libomptarget) again for me. I did not otherwise review the patch.

Thanks for that fix, and thanks for this patch to merge the test suite runs.

kamaub added a subscriber: kamaub.Mar 16 2022, 5:34 AM

This change broke the clang-ppc64le-rhel #15899 bot. It actually pass this and every other bot green
but the next build after sanitizer test cases on clang-ppc64le-rhel #15900 for continuous builds fails,
that is, some clean builds pass but mostly continuous builds fail.

I originally though this was an issue with the container and moved the bot to staging server as these failures
did not happen on any other bots as far as I could tell but after this patch was pointed out to me I did some
extensive testing on the container and found this change caused the failures we saw.

I applied D121647 at 6ac3d8ef9c as well and found that these sanitizer test cases only pass when a clean build of
6ac3d8ef9c + D121647 was before so I think once D121647 lands the next clean build should bring out bots back to green,
I hope it lands soon so we can be sure it works and move the bot from staging, I will try to review it now, thank you for the fix.

I need LGTM on D121647, would one of you be willing to accept it?

I need LGTM on D121647, would one of you be willing to accept it?

It looks like @ldionne handled it before I got to it. Thanks again for these improvements.

lei added a subscriber: lei.Jul 18 2022, 1:17 PM

@phosek It seems the runtime tests are no longer running for us after this patch in PPC bot https://lab.llvm.org/buildbot/#/builders/57. I can see they are still ran when it's part of LLVM_ENABLE_PROJECTS, but this bot specifies compiler-rt as LLVM_ENABLE_RT=compiler-rt.

I was not able to find any AddressSanitizer tests in the check-all log with LLVM_LIT_ARGS:STRING=-v.
Running ninja check-compiler-rt I see:

$ grep AddressSanitizer check-compiler-rt.log| grep -v -c 'LLVM ::'
1534

Unable to find the same list in ninja check-all log:

$ grep AddressSanitizer check-all.log| grep -v -c 'LLVM ::'
0

Also, running with and without this patch showed the same number of regression tests with the exception that before this patch it also showed that there were over 2K compiler-rt tests ran.
Any idea why this is happening?

@phosek Pinging this patch, our builders which run check-all and expect compiler-rt, enabled as a runtime with -DLLVM_ENABLE_RUNTIMES=compiler-rt, to be covered in testing are not doing this and are still being affected by this changeset.
clang-ppc64le-rhel and clang-ppc64-aix are not currently testing compiler-rt because of this change.
clang-ppc64le-linux-test-suite enables compiler-rt as a project with -DLLVM_ENABLE_PROJECTS=compiler-rt and test it under check-all as expected.
Before this, both bots would test compiler-rt under check-all. Could you please take a look at this?