Skip to content

Report line number of test when should_panic test failed #138603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

xizheyin
Copy link
Contributor

@xizheyin xizheyin commented Mar 17, 2025

Closes #137405


try-job: x86_64-gnu-llvm-19-3
try-job: test-various

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2025

Failed to set assignee to joshka: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 17, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@xizheyin

This comment was marked as outdated.

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2025

Could not assign reviewer from: jieyouxu.
User(s) jieyouxu are either the PR author, already assigned, or on vacation. Please use r? to specify someone else to assign.

@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

This looks like a libtest change, so r? libs (or testing-devex?)

@jieyouxu

This comment was marked as resolved.

@rustbot rustbot assigned joboet and unassigned Mark-Simulacrum Mar 17, 2025
@xizheyin xizheyin marked this pull request as draft March 17, 2025 14:03
@xizheyin xizheyin marked this pull request as ready for review March 17, 2025 14:23
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@joshka joshka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test names are nits, but make the reason for each test self describing.

I think it probably makes sense to also fix the substring tests if they're also broken (I haven't manually checked those messages to see if there's span info coming from elsewhere in the stack, but these seem like they should be tested with the same tests as are introduced here).

@xizheyin xizheyin force-pushed the issue-137405 branch 2 times, most recently from 21b9d4f to c7b4523 Compare March 18, 2025 01:17
Copy link
Contributor

@joshka joshka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM - small nits

(Note: I'm not a member of the rust project, so this likely still requires approval from someone who is)

@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

(Note: I'm not a member of the rust project, so this likely still requires approval from someone who is)

Though reviews are still very much appreciated 😁

@weihanglo
Copy link
Member

@bors try

Before the change fails snapshots in Cargo's test testsuite

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 8, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 10, 2025
compiletest: Trim whitespace from environment variable names

When a test contains a directive like `//@ exec-env: FOO=bar`, compiletest currently includes that leading space in the name of the environment variable, so it is defined as ` FOO` instead of `FOO`.

This is an annoying footgun that is pretty much never intended, especially since most other directives *do* trim whitespace. So let's get rid of it by trimming the environment variable name.

Values remain untrimmed, since there could conceivably be a use-case for values with leading space, but perhaps we'll end up trimming values too in the future.

Recently observed in rust-lang#138603 (comment).

Fixes rust-lang#132990.
Supersedes rust-lang#133148.

---

try-job: test-various
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 10, 2025
compiletest: Trim whitespace from environment variable names

When a test contains a directive like `//@ exec-env: FOO=bar`, compiletest currently includes that leading space in the name of the environment variable, so it is defined as ` FOO` instead of `FOO`.

This is an annoying footgun that is pretty much never intended, especially since most other directives *do* trim whitespace. So let's get rid of it by trimming the environment variable name.

Values remain untrimmed, since there could conceivably be a use-case for values with leading space, but perhaps we'll end up trimming values too in the future.

Recently observed in rust-lang#138603 (comment).

Fixes rust-lang#132990.
Supersedes rust-lang#133148.

---

try-job: test-various
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 10, 2025
compiletest: Trim whitespace from environment variable names

When a test contains a directive like `//@ exec-env: FOO=bar`, compiletest currently includes that leading space in the name of the environment variable, so it is defined as ` FOO` instead of `FOO`.

This is an annoying footgun that is pretty much never intended, especially since most other directives *do* trim whitespace. So let's get rid of it by trimming the environment variable name.

Values remain untrimmed, since there could conceivably be a use-case for values with leading space, but perhaps we'll end up trimming values too in the future.

Recently observed in rust-lang#138603 (comment).

Fixes rust-lang#132990.
Supersedes rust-lang#133148.

---

try-job: test-various
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2025
Rollup merge of rust-lang#139507 - Zalathar:trim-env-name, r=jieyouxu

compiletest: Trim whitespace from environment variable names

When a test contains a directive like `//@ exec-env: FOO=bar`, compiletest currently includes that leading space in the name of the environment variable, so it is defined as ` FOO` instead of `FOO`.

This is an annoying footgun that is pretty much never intended, especially since most other directives *do* trim whitespace. So let's get rid of it by trimming the environment variable name.

Values remain untrimmed, since there could conceivably be a use-case for values with leading space, but perhaps we'll end up trimming values too in the future.

Recently observed in rust-lang#138603 (comment).

Fixes rust-lang#132990.
Supersedes rust-lang#133148.

---

try-job: test-various
@chenyukang
Copy link
Member

@bors r=chenyukang

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

📌 Commit ee3b557 has been approved by chenyukang

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 13, 2025
Report line number of test when should_panic test failed

Closes rust-lang#137405

---

try-job: x86_64-gnu-llvm-19-3
try-job: test-various
@bors
Copy link
Collaborator

bors commented Apr 13, 2025

☔ The latest upstream changes (presumably #139746) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 13, 2025
@chenyukang
Copy link
Member

@bors r=chenyukang

@bors
Copy link
Collaborator

bors commented Apr 14, 2025

📌 Commit dc3a586 has been approved by chenyukang

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 14, 2025
@bors
Copy link
Collaborator

bors commented Apr 14, 2025

⌛ Testing commit dc3a586 with merge 07d3fd1...

@bors
Copy link
Collaborator

bors commented Apr 14, 2025

☀️ Test successful - checks-actions
Approved by: chenyukang
Pushing 07d3fd1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 14, 2025
@bors bors merged commit 07d3fd1 into rust-lang:master Apr 14, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 14, 2025
Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing c580c49 (parent) -> 07d3fd1 (this PR)

Test differences

Show 2 test diffs

Stage 1

  • [ui] tests/ui/test-attrs/test-should-panic-failed-show-span.rs: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/test-attrs/test-should-panic-failed-show-span.rs: [missing] -> pass (J1)

Job group index

Job duration changes

  1. x86_64-apple-2: 6506.7s -> 4224.2s (-35.1%)
  2. x86_64-apple-1: 8751.6s -> 6490.8s (-25.8%)
  3. dist-apple-various: 6608.8s -> 8156.5s (23.4%)
  4. dist-x86_64-apple: 7945.5s -> 9705.4s (22.1%)
  5. dist-aarch64-apple: 4890.0s -> 5408.4s (10.6%)
  6. x86_64-gnu-debug: 6140.2s -> 6614.0s (7.7%)
  7. dist-i686-mingw: 7878.0s -> 8443.1s (7.2%)
  8. dist-x86_64-freebsd: 4909.8s -> 5205.4s (6.0%)
  9. dist-x86_64-mingw: 7544.5s -> 7949.1s (5.4%)
  10. dist-powerpc64-linux: 5406.1s -> 5674.4s (5.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (07d3fd1): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -0.5%, secondary -2.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-0.7%, -0.4%] 5
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) -0.5% [-0.7%, -0.4%] 5

Cycles

Results (primary -0.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.9% [-2.3%, 0.5%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 784.038s -> 784.108s (0.01%)
Artifact size: 365.12 MiB -> 365.13 MiB (0.00%)

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 19, 2025
Report line number of test when should_panic test failed

Closes rust-lang#137405

---

try-job: x86_64-gnu-llvm-19-3
try-job: test-various
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests marked as should_panic should report the line number of the test