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 only modified subcommand for compiletest #107657

Merged
merged 2 commits into from
Feb 11, 2023

Conversation

chenyukang
Copy link
Member

@chenyukang chenyukang commented Feb 4, 2023

@rustbot rustbot added 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) labels Feb 4, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

@jyn514
Copy link
Member

jyn514 commented Feb 4, 2023

I don't have time for reviews right now, sorry.

r? bootstrap

@rustbot rustbot assigned albertlarsan68 and unassigned jyn514 Feb 4, 2023
@jyn514
Copy link
Member

jyn514 commented Feb 4, 2023

cc @albertlarsan68

Copy link
Member

@albertlarsan68 albertlarsan68 left a comment

Choose a reason for hiding this comment

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

Seems good, just a nit.

src/tools/compiletest/src/main.rs Outdated Show resolved Hide resolved
src/tools/compiletest/src/main.rs Outdated Show resolved Hide resolved
@albertlarsan68 albertlarsan68 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 Feb 10, 2023
@chenyukang
Copy link
Member Author

@rustbot ready

comments feedback and some code refactor.

@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 Feb 10, 2023
src/bootstrap/format.rs Outdated Show resolved Hide resolved
@@ -597,7 +631,7 @@ fn collect_tests_from_dir(
let file = file?;
let file_path = file.path();
let file_name = file.file_name();
if is_test(&file_name) {
if is_test(&file_name) && (!config.only_modified || only_modified.contains(&file_path)) {
Copy link
Member

Choose a reason for hiding this comment

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

This means that if the modified_test functions errors (which is signalled by returning an empty Vec), then no tests are run, or am I wrong?
The old way of using Option was good.

Copy link
Member Author

@chenyukang chenyukang Feb 10, 2023

Choose a reason for hiding this comment

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

yes, the old way has a bug for the relative_dir, so I combine with the code path.
Old way also won't run any test if it specified with only-modified and git run with error.

Copy link
Member

Choose a reason for hiding this comment

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

Then now what is the difference between "No tests modified/added" and "An error occured"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just added error message for error occured.

@chenyukang chenyukang force-pushed the yukang/add-only-modified branch 2 times, most recently from 47ea6be to 2d01454 Compare February 10, 2023 17:20
@albertlarsan68
Copy link
Member

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Feb 10, 2023

📌 Commit c52435a has been approved by albertlarsan68

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 Feb 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 11, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#107657 (Add only modified subcommand for compiletest)
 - rust-lang#107864 (rustdoc: clean up `write!` calls with less stuttering)
 - rust-lang#107873 (Emit JSON output for the building of bootstrap itself)
 - rust-lang#107895 (remove redundant clones)
 - rust-lang#107897 (Reexported macros docs)
 - rust-lang#107909 (rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`)
 - rust-lang#107912 (rustdoc: Don't resolve link to field on different variant)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 585b458 into rust-lang:master Feb 11, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants