[PATCH] D133542: [llvm][lit] Respect GTEST_TOTAL_SHARDS and GTEST_SHARD_INDEX env vars
Yuanfang Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 8 17:48:59 PDT 2022
ychen added a comment.
Looks good. I think this is useful to discover whether tests are affecting each other or to disable sharding if the platform has trouble correctly emitting & parsing the GTest JSON result file (like the Github issues you mentioned). On a side note, if you think the LIT sharding implementation is buggy, it is better to submit a bug report.
Could you please add a test? Thanks.
================
Comment at: llvm/utils/lit/lit/formats/googletest.py:115
'GTEST_SHUFFLE': '1' if use_shuffle else '0',
- 'GTEST_TOTAL_SHARDS': total_shards,
- 'GTEST_SHARD_INDEX': shard_idx
+ 'GTEST_TOTAL_SHARDS': os.getenv("GTEST_TOTAL_SHARDS", total_shards),
+ 'GTEST_SHARD_INDEX': os.getenv("GTEST_SHARD_INDEX", shard_idx)
----------------
use `os.environ.get()`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133542/new/
https://reviews.llvm.org/D133542
More information about the llvm-commits
mailing list