Repository navigation
fix(cli): say what was searched and which flag failed when no test results are found - #1252
Merged
Merged
Conversation
|
😎 Merged successfully - details. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1252 +/- ##
==========================================
+ Coverage 85.42% 85.62% +0.20%
==========================================
Files 86 86
Lines 19235 19241 +6
==========================================
+ Hits 16431 16475 +44
+ Misses 2804 2766 -38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
TylerJang27
approved these changes
Oct 26, 2026
| if searched.is_empty() { | ||
| String::new() | ||
| } else { | ||
| format!(" in: {searched}") |
Collaborator
There was a problem hiding this comment.
Nit: " in: <{searched}>"
Suggested change
| format!(" in: {searched}") | |
| format!(" in: <{searched}>") |
Collaborator
There was a problem hiding this comment.
I don't love brackets, but I'd prefer this or remove the period and put "Failing because..." on the next line
Member
Author
There was a problem hiding this comment.
Went with the brackets: No test results found to upload in: <./*>. Failing because …
|
|
||
| if matches!(flag, Flag::OffWithEquals | Flag::OffAliasWithEquals) { | ||
| assert = assert.code(70).stderr(predicate::str::contains( | ||
| "No test results found to upload in: ./*. Failing because \ |
Collaborator
There was a problem hiding this comment.
Suggested change
| "No test results found to upload in: ./*. Failing because \ | |
| "No test results found to upload in: <./*>. Failing because \ |
dfrankland
force-pushed
the
dylan/trunk-19074-empty-results-flag
branch
from
October 27, 2026 20:42
cc1aaf5 to
a07f569
Compare
…sults are found With --allow-empty-test-results=false (or its alias --allow-missing-junit-files=false), an upload that finds no test results exits 70 with just "No test output files found to upload." It now names where it looked and the flag that made it fail: No test results found to upload in: ./*. Failing because --allow-empty-test-results (or its alias --allow-missing-junit-files) is false; set it to true to continue without test results. Both spellings are named because clap can't tell which was passed, and the GitHub Action passes the alias. Part of TRUNK-19074. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dfrankland
force-pushed
the
dylan/trunk-19074-empty-results-flag
branch
from
October 29, 2026 17:40
a07f569 to
5fd119b
Compare
Member
Author
|
/trunk merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
--allow-empty-test-results=false, an upload that finds no test results exits 70 with just "No test output files found to upload." That message doesn't say where the CLI looked or why it failed instead of carrying on. The GitHub Action passes the flag's alias,--allow-missing-junit-files, from itsallow-missing-junit-filesinput, so the name the user typed is not the name in the CLI's help. Part of TRUNK-19074 (ask 2).What changes. The message names where the CLI looked and the flag that caused the failure:
junit_path_wrappers. That's the--junit-pathsglobs, plus the files a Bazel BEP, xcresult or swift-test xUnit input resolves to. If the list is empty, for example a BEP whose results were all cached, the "in:" part is left out.TRUNK_ALLOW_EMPTY_TEST_RESULTS, is left out to keep the line readable.InterruptingError(exit 70), and the error rendering is unchanged.Testing.
upload_bundle_no_files_allow_missing_junit_filesnow also checks exit code 70 and the new message for--allow-empty-test-results=falseand--allow-missing-junit-files=false.cargo nextest run -p trunk-analytics-cli --test upload: 58 of 61 pass. The 3 swift-test xUnit tests (upload_bundle_using_swift_test_xunit,swift_test_xunit_paths_are_globs,a_swift_test_xunit_file_reached_twice_is_uploaded_once) fail on my machine with "got no file from its declaration". They fail the same way on main without this change, so I'm relying on CI for them.rustfmt --checkon the changed files: clean.cargo clippy -p trunk-analytics-cli --all-targets: no warnings on the changed lines.🤖 Generated with Claude Code