[llvm] [llvm][llvm-lit] Add option to create unique result file names if results already exist (PR #112729)
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 18 03:50:17 PDT 2024
DavidSpickett wrote:
>I assume you expect the area which will contain the results files will be clean before running the tests in the first place? Otherwise you'll end up having stale results files in addition to new results files, and then sweeping them all up will result in spurious data being recorded.
Yes. I think it's fair enough to expect that CI pipelines will run a pretty simple `rm *.xml` or start from a clean dir.
I suppose someone might want to run lit over and over then compare variance between runs and this feature allows that. Though it's not my use case.
> Another thought I had is you could just name the results file after the specific lit suite it comes from (presumably derived from the directory path or similar somehow?). In this way, new results will overwrite old results without cleanup, but should also be uniquely named.
This is what I thought of doing via the shell scripting at first. Looking at lit itself, it can take multiple paths in a single invocation and the test results are the combination of all tests discovered.
So if you had lots of things in the same sub-tree we could factor that out and use that in the filename:
```
lit /home/david.spickett/a/ /home/david.spickett/b/
```
Produces:
```
results.home_david_spickett_a_b.xml
```
Which is I think a different feature than the one I'm proposing but would work equally well for the CI's use case. With the advantage that you can see from the filename which one goes with which project. Though I think only a tiny minority of people would ever take advantage of that.
If we wanted a path based naming feature in the future, I don't think this unique file names feature would clash with it. You'd just get `results.some_path_here.<randomletters>.xml`.
Most of my concern with it is just figuring out how to condense multiple paths into a filename that's useful to the reader.
https://github.com/llvm/llvm-project/pull/112729
More information about the llvm-commits
mailing list