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

Merge runfiles from transitive dependencies of rust_test crate attr #1487

Merged
merged 8 commits into from
Oct 7, 2022

Conversation

neilisaac
Copy link
Contributor

@neilisaac neilisaac commented Jul 27, 2022

Hopefully resolves #266

I'm open to input from maintainers on how to do this.

@@ -1046,6 +1046,9 @@ def rustc_compile_action(
files = getattr(ctx.files, "data", []) + coverage_runfiles,
collect_data = True,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to attempt to remove it in this change? Or an isolated change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not really sure I understand the implications of using "collect_data" here, so I left it alone.

@scentini scentini self-requested a review August 1, 2022 08:34
Copy link
Collaborator

@scentini scentini left a comment

Choose a reason for hiding this comment

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

Thanks! Could we also get some tests?

@neilisaac
Copy link
Contributor Author

@scentini this is the common case that was broken for me: 17a00a3

#[test]
fn test_greeting_from_txt_file() {
let welcome = Greeter::from_txt_file().unwrap();
assert_eq!("Welcome Rust", welcome.greeting("Rust"));
Copy link
Contributor Author

@neilisaac neilisaac Aug 14, 2022

Choose a reason for hiding this comment

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

backporting this commit (with the test only) to main, I see:

thread 'greeter::test::test_greeting_from_txt_file' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', test/rust/src/greeter.rs:93:48

@scentini
Copy link
Collaborator

Hey @neilisaac, this PR looks good to me, however looks like CI is complaining about .rs file formatting, could you please fix it?

@neilisaac
Copy link
Contributor Author

@scentini checks passed!

@scentini scentini merged commit c5b38fe into bazelbuild:main Oct 7, 2022
@scentini
Copy link
Collaborator

scentini commented Oct 7, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rust_test does not propagate data files from the crate
3 participants