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

Build Binaries when running integration tests in workspace #322

Open
wcampbell0x2a opened this issue Nov 12, 2023 · 2 comments
Open

Build Binaries when running integration tests in workspace #322

wcampbell0x2a opened this issue Nov 12, 2023 · 2 comments
Labels
C-question Category: A question

Comments

@wcampbell0x2a
Copy link
Sponsor

I have a ci job who generates coverage that also executes the binaries. These binaries need to be generated in the target/llvm-cov/ directory? There looks to be no way to build these, without just running cargo llvm-cov and ignoring the run result. These tests are run in a different package backhand-test that run the backhand-cli binaries, all in the same workspace.

For information, the execution in the tests happens here

@taiki-e
Copy link
Owner

taiki-e commented Nov 15, 2023

What is the actual error you received?
The location of the compiled binaries can be obtained via the CARGO_BIN_EXE_<bin_name> environment variable, but IIUC assert_cmd refers to that environment variable, so at least for assert_cmd, I don't think we need to worry about that.

@taiki-e taiki-e added the C-question Category: A question label Nov 15, 2023
@wcampbell0x2a
Copy link
Sponsor Author

Reproduce:

$ git clone https://github.com/wcampbell0x2a/backhand
$ cargo llvm-cov --workspace --codecov --output-path codecov.json --all-features --release --no-clean -- --skip slow
[SNIP]
running 1 test
test test_add ... FAILED

failures:

---- test_add stdout ----
File out.squashfs has matching hash inside hash list, skipping download
thread 'test_add' panicked at /home/wcampbell/.cargo/registry/src/index.crates.io-6f17d22bba15001f/assert_cmd-2.0.12/src/output.rs:65:25:
No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_add

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

error: test failed, to rerun pass `-p tests --test add`
error: process didn't exit successfully: `/home/wcampbell/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo test --tests --manifest-path /home/wcampbell/projects/wcampbell/backhand/Cargo.toml --target-dir /home/wcampbell/projects/wcampbell/backhand/target/llvm-cov-target --workspace --all-features --release -- --skip slow` (exit status: 101)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: A question
Projects
None yet
Development

No branches or pull requests

2 participants