This is an archive of the discontinued LLVM Phabricator instance.

[lit] Remove the --no-indirectly-run-check option
ClosedPublic

Authored by ldionne on Jun 28 2023, 6:18 AM.

Details

Summary

This option had originally been added in D83069 to allow disabling the
check that something is going to get run at all when a specific test name
is used on the command-line. Since we now use getTestsForPath() (from D151664)
to get the tests to run for a specific path, we don't need a specific check
for this anymore -- Lit will produce the same complaint it would produce if
you provided a directory with no tests.

If one needs to run a specific test on the command-line and the Lit
configuration would normally not include that test, the configuration
should be set up as a "standalone" configuration or it should be fixed
to allow for that test to be found (i.e. probably fix the allowed test
suffixes).

Diff Detail

Event Timeline

ldionne created this revision.Jun 28 2023, 6:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 6:18 AM
Herald added a subscriber: delcypher. · View Herald Transcript
ldionne requested review of this revision.Jun 28 2023, 6:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 6:18 AM
ldionne updated this revision to Diff 535991.Jun 29 2023, 2:02 PM

Rebase to poke CI

ldionne updated this revision to Diff 536755.Jul 3 2023, 6:45 AM

Rebase onto main.

Ping, I'd like to do this before the LLVM 17 release.

yln accepted this revision.Jul 12 2023, 7:08 PM

I wasn't aware of the --no-indirectly-run-check flag or the problem it was trying to solve, but it sounds like it was a clutch in the first place. Glad to see that your change D151664 unified this case (running single test by name) so we can obsolete it!

This revision is now accepted and ready to land.Jul 12 2023, 7:08 PM
jdenny added inline comments.
llvm/docs/CommandGuide/lit.rst
462

Needs to be updated.

llvm/utils/lit/lit/discovery.py
170–171

If I understand correctly, if a directory is in standalone mode because tests are always run individually, it is not possible to use a test format that overrides getTestsForPaths in order to generate multiple tests from each of those individual tests. Is that correct? I'm not saying that's problematic. I just want to be sure I understand.

ldionne marked an inline comment as done.Jul 17 2023, 6:53 AM
ldionne added inline comments.
llvm/utils/lit/lit/discovery.py
170–171

Yes, that is correct. TBH I am also skeptical about the usefulness of "standalone" tests in the first place, it seems like they were introduced as a clutch for people not wanting to have appropriate suffixes and lit excludes in the first place.

ldionne updated this revision to Diff 541006.Jul 17 2023, 6:53 AM

Update doc.

jdenny accepted this revision.Jul 17 2023, 2:17 PM

Other than the comment I just requested, LGTM. Thanks for the cleanup.

llvm/utils/lit/lit/discovery.py
170–171

Yes, that is correct.

I feel like the inability to use standalone mode with getTestsForPaths in that manner ought to be documented somewhere. What about at a getTestsForPaths definition in llvm/utils/lit/lit/formats/base.py?

TBH I am also skeptical about the usefulness of "standalone" tests in the first place, it seems like they were introduced as a clutch for people not wanting to have appropriate suffixes and lit excludes in the first place.

My understanding is that it's for use cases where lit is not doing test discovery, so it seems pointless to require configuring test suffixes and exclusions for lit. However, it's not a use case I directly have experience with, so I might be misunderstanding.

ldionne updated this revision to Diff 541244.Jul 17 2023, 2:58 PM
ldionne marked 2 inline comments as done.

Add comment to address review feedback.

Thanks for the reviews!

This revision was landed with ongoing or failed builds.Jul 17 2023, 2:59 PM
This revision was automatically updated to reflect the committed changes.