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

Some tests fail if using a non-default target directory #8980

Closed
Nemo157 opened this issue Dec 16, 2020 · 2 comments · Fixed by #8982
Closed

Some tests fail if using a non-default target directory #8980

Nemo157 opened this issue Dec 16, 2020 · 2 comments · Fixed by #8982
Labels
A-testing-cargo-itself Area: cargo's tests C-bug Category: bug

Comments

@Nemo157
Copy link
Member

Nemo157 commented Dec 16, 2020

Problem
If you override the target directory and try running cargo's testsuite some of the tests fail to find their data.

Steps

> CARGO_TARGET_DIR=$(mktemp -d) cargo test -- standard_lib::simple_bin_std
[...]
     Running /tmp/tmp.7ILfdJhI9g/debug/deps/testsuite-f6e657c77e54be9a

running 1 test
test standard_lib::simple_bin_std ... FAILED

failures:

---- standard_lib::simple_bin_std stdout ----
running `/tmp/tmp.7ILfdJhI9g/debug/cargo build`
running `/tmp/tmp.7ILfdJhI9g/debug/cargo run -v -Zbuild-std --target x86_64-unknown-linux-gnu`
thread 'standard_lib::simple_bin_std' panicked at '
Expected: execs
    but: exited with exit code: 101
--- stdout

--- stderr
error: failed to read `/tmp/tests/testsuite/mock-std/library/std/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
', crates/cargo-test-support/src/lib.rs:729:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    standard_lib::simple_bin_std

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 2088 filtered out; finished in 0.75s

Possible Solution(s)
Lookup files relative to the source files path, not the compiled binary.

@Nemo157 Nemo157 added the C-bug Category: bug label Dec 16, 2020
@Nemo157
Copy link
Member Author

Nemo157 commented Dec 16, 2020

@rustbot modify labels: +A-testing-cargo-itself

@rustbot

This comment has been minimized.

@Eh2406 Eh2406 added the A-testing-cargo-itself Area: cargo's tests label Dec 16, 2020
@bors bors closed this as completed in 4f0adae Dec 16, 2020
bors added a commit that referenced this issue Dec 18, 2022
Enable triagebot's relabel functionality

### What does this PR try to resolve?

This fixes the following failure that rustbot currently posts whenever someone tries to use "<b>`@</b><b>rustbot</b>` label" in this repository.

> **Error**: The feature `relabel` is not enabled in this repository.
> To enable it add its section in the `triagebot.toml` in the root of the repository.

Unauthenticated relabel has been enabled in rust-lang/rust for nearly 4 years. People overwhelmingly use it in good faith.

<br>

### How should we test and review this PR?

Compare against https://github.com/rust-lang/rust/blob/1.66.0/triagebot.toml.

Also skim through the 7 pages of labels on https://github.com/rust-lang/cargo/labels, whether it makes sense the ones I decided to allow arbitrary GitHub users to apply.

<br>

### Additional information

Attempted uses of "<b>`@</b><b>rustbot</b>` label", that failed, but this PR would allow:

- #10343 (comment)
- #10243 (comment)
- #9982 (comment)
- #9128 (comment)
- #9067 (comment)
- #8441 (comment)
- #11432 (comment)
- #8841 (comment)
- #10820 (comment)
- #10572 (comment)
- #9114 (comment)
- #8980 (comment)
- #9064 (comment)
- #8726 (comment)
- #8089 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing-cargo-itself Area: cargo's tests C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants