Skip to content
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

Add compiletest and bootstrap "--skip" option forwarded to libtest #96493

Merged
merged 1 commit into from
May 13, 2022

Conversation

chbaker0
Copy link
Contributor

@chbaker0 chbaker0 commented Apr 27, 2022

With this PR, "x.py test --skip SKIP ..." will run the specified test suite, but forward "--skip SKIP" to the test tool. libtest already supports this option. The PR also adds it to compiletest which itself just forwards it to libtest.

Adds the functionality requested in #96342. This is useful to work around tests broken upstream.

#96362 (comment) is the specific test issue my project is trying to work around.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 27, 2022
@Mark-Simulacrum
Copy link
Member

It looks like curently filtering tests in the positive direction (rather than excluding some tests) is done by libtest, not within compiletest, and I believe the support there is more primitive, being based on just substrings. I think we should (a) not diverge from the filtering in terms of supported syntax and (b) should push this functionality down into libtest, like we do for regular filtering. I don't see any reason it should be special to compiletest, and I think the functionality makes sense more generally -- excluding a subset or allowing just a subset are both roughly equivalent to me.

If you'd like to make those changes here, that would be fine, or feel free to open a new PR -- we will want to start with the exclude option being unstable in libtest, but that shouldn't impede use from compiletest.

@Mark-Simulacrum Mark-Simulacrum 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-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2022
@chbaker0
Copy link
Contributor Author

chbaker0 commented May 3, 2022

@Mark-Simulacrum Thanks for the tip, makes sense. Just to check before I open a PR: is that an OK change without an RFC? At least for adding the unstable option.

@Mark-Simulacrum
Copy link
Member

An unstable addition can happen with just a T-libs-api member signing off on a PR, no RFC necessary.

@chbaker0 chbaker0 force-pushed the issue-96342-fix branch 2 times, most recently from 3c6aad4 to 6a54090 Compare May 9, 2022 16:35
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 9, 2022
@chbaker0
Copy link
Contributor Author

chbaker0 commented May 9, 2022

@rustbot label -S-waiting-on-author +S-waiting-on-review

@Mark-Simulacrum I didn't do enough digging; "--skip" in libtest does what I want. The PR now just adds the arguments to bootstrap and compiletest and forwards them down to libtest.

@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 May 9, 2022
@chbaker0 chbaker0 changed the title Add compiletest option to exclude tests matching regex Add compiletest and bootstrap "--skip" option forwarded to libtest May 9, 2022
@rust-log-analyzer

This comment has been minimized.

libtest already supports a "--skip SUBSTRING" arg which excludes any
test names matching SUBSTRING.

This adds a "--skip" argument to compiletest and bootstrap which is
forwarded to libtest.
@Mark-Simulacrum
Copy link
Member

I'm not sure we should be exposing a separate helper flag for this in bootstrap, but it also seems OK. Certainly likely to make it more discoverable, which is probably good.

@bors r+

@bors
Copy link
Contributor

bors commented May 12, 2022

📌 Commit b2316c1 has been approved by Mark-Simulacrum

@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 May 12, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 12, 2022
…mulacrum

Add compiletest and bootstrap "--skip" option forwarded to libtest

With this PR,  "x.py test --skip SKIP ..." will run the specified test suite, but forward "--skip SKIP" to the test tool. libtest already supports this option. The PR also adds it to compiletest which itself just forwards it to libtest.

Adds the functionality requested in rust-lang#96342. This is useful to work around tests broken upstream.

rust-lang#96362 (comment) is the specific test issue my project is trying to work around.
@bors
Copy link
Contributor

bors commented May 13, 2022

⌛ Testing commit b2316c1 with merge 925e774...

@bors
Copy link
Contributor

bors commented May 13, 2022

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 925e774 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 13, 2022
@bors bors merged commit 925e774 into rust-lang:master May 13, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 13, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (925e774): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

aarongable pushed a commit to chromium/chromium that referenced this pull request May 16, 2022
Rolls a new Rust toolchain with the following changes in addition to
updating the revision:

With rust-lang/rust#96493, disables test
src/test/ui/numeric/numeric-cast.rs (which fails on our CI due to bug
rust-lang/rust#94322) and re-enables the rest
of the src/test/ui suite.

Includes Rust std sources and vendored dependencies in the package at
third_party/rust-toolchain/lib/rustlib/src/rust/

Fixed: 1320459
Change-Id: I6b25be163214c4408123f3abb7e0135e94ec642e

Cq-Include-Trybots: luci.chromium.try:linux-rust-x64-rel,linux-rust-x64-dbg
Change-Id: I6b25be163214c4408123f3abb7e0135e94ec642e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3635438
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Reviewed-by: Adrian Taylor <adetaylor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1003924}
@jyn514
Copy link
Member

jyn514 commented Jul 31, 2022

This seems like a misfeature. There are two existing ways to do this:

  1. Pass --test-args --skip=..., which works both before and after this change.
  2. --exclude, which doesn't work, but only because I didn't know about this flag.

I think if we're going to support this specially, it should be with --exclude for consistency with the existing interface. I don't see why we'd need a separate --skip flag.

(@Mark-Simulacrum can you please tag me on PRs that propose to fix an issue I opened in the future? I didn't even know this existed until I looked through a list of bootstrap PRs for unrelated reasons, the issue wasn't actually closed by this PR because didn't have "fixes" in the description.)

@Mark-Simulacrum
Copy link
Member

Sure, if I notice. I was ambivalent at best about this at the time of addition, and FWIW I don't feel strongly we need to keep it.

Exclude and skip are pretty different, I think (skip works on test name, not path, which overlaps only for compiletest), but --test-args already working for this is definitely true.

@jyn514
Copy link
Member

jyn514 commented Jul 31, 2022

yeah, I think it makes sense to have --exclude do this for compiletest, and require you to use --test-args otherwise.

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 7, 2022
…imulacrum

Move `x test --skip` to be part of `--exclude`

`--skip` is inconsistent with the rest of the interface and redundant with `--exclude`.
Fix --exclude to work properly for files and directories rather than having a separate flag.

Fixes rust-lang#96342. cc rust-lang#96493 (comment)

r? `@Mark-Simulacrum`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
Move `x test --skip` to be part of `--exclude`

`--skip` is inconsistent with the rest of the interface and redundant with `--exclude`.
Fix --exclude to work properly for files and directories rather than having a separate flag.

Fixes rust-lang/rust#96342. cc rust-lang/rust#96493 (comment)

r? `@Mark-Simulacrum`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
Move `x test --skip` to be part of `--exclude`

`--skip` is inconsistent with the rest of the interface and redundant with `--exclude`.
Fix --exclude to work properly for files and directories rather than having a separate flag.

Fixes rust-lang/rust#96342. cc rust-lang/rust#96493 (comment)

r? `@Mark-Simulacrum`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants