Skip to content

Tests fail with a shared CARGO_TARGET_DIR #29

@jyn514

Description

@jyn514
$ CARGO_TARGET_DIR=/home/joshua/.local/lib/cargo/target cargo test hello_world
test buildtest::inside_docker::test_hello_world ... FAILED
test buildtest::test_hello_world ... ok

---- buildtest::inside_docker::test_hello_world stdout ----
thread 'buildtest::inside_docker::test_hello_world' panicked at 'called `Result::unwrap()` on an `Err` value: StripPrefixError(())

the working directory is not a parent of the test binary', tests/buildtest/inside_docker.rs:15:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
$ CARGO_TARGET_DIR=target cargo test hello_world
test buildtest::test_hello_world ... ok
test buildtest::inside_docker::test_hello_world ... ok

Additionally, rustwide seems to be clearing the cache on every test run with a shared CARGO_TARGET_DIR which is very annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions