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

Support runner config #1690

Open
QuarticCat opened this issue Feb 10, 2025 · 2 comments
Open

Support runner config #1690

QuarticCat opened this issue Feb 10, 2025 · 2 comments
Assignees

Comments

@QuarticCat
Copy link

Cargo has a configuration target.<triple>.runner that allows you to specify a runner program to take over the execution of compiled binaries. It seems like Tarpaulin doesn't support it. Here's an example:

Create runner.sh with content:

#!/bin/bash -e
echo 123
"$@"

Then execute:

$ cargo test
...
$ export CARGO_TARGET_AARCH64_APPLE_DARWIN_RUNNER=./runner.sh
$ cargo test
...
123
...
$ cargo tarpaulin
...

In my specific case, I use a runner to send binaries to a remote machine and execute them there.

@xd009642
Copy link
Owner

So this is a bit more complex, but if you're running coverage on a remote machine how will tarpaulin get the coverage for it? 👀

The only way I can see that one working is if you add a step to the runner afterwards to download all of the profraw files off the machine into the tarpaulin profraw folder. But it'll still be a bit fragile (i.e. things like ptrace won't work, other things may struggle depending on what the runner does)

I can do the naive implementation easily enough (just run the runner and hope the user has sorted out those finer details), but I'll probably have to think a bit about documentation/DX before shipping it 🤔

@QuarticCat
Copy link
Author

Ah... That's quite a problem. I guess I'd better ignore those tests that only work remotely.

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

No branches or pull requests

2 participants