llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.93k stars 11.53k forks source link

gtest sharding breaks lit's xfail inputs #102264

Open kendalharland opened 1 month ago

kendalharland commented 1 month ago

Lit marks tests as XFAIL by generating a list of discovered_tests and marking each of them as XFAIL if their relative filenames or fullnames appear in its opts.xfail which is populated from either the --xfail-tests flag or LIT_XFAIL env var before the tests actually run. When gtest sharding is enabled, every test's name in discovered_tests initially contains a numeric suffix like FooTest\1\2 before the tests runs, so the test names don't match the names the User passes to the arguments above. The googletest module will replace these numbers with the actual test suite and case names by reading them from gtest json files only after the tests are finished running. This means that it's impossible to mark a test as XFAIL using the above mechanisms when gtest sharding is enabled. One can only use the Python test decorators, or the shell test XFAIL: headers, or any of the other source-code based mechanisms.

kendalharland commented 1 month ago

Related to https://github.com/llvm/llvm-project/issues/56492