Comments (8)
I think some more context is needed to be able to help with what you are doing. Where you are writing to and how you are doing it are important factors.
In case you weren't aware, I tend to use https://github.com/assert-rs/assert_fs or https://github.com/assert-rs/trycmd for creating a scratchpad to write to.
from assert_cmd.
@epage Not using either of those for this specific test, which is this: https://github.com/milesj/monolith/pull/5/files#diff-9a1f0aa2064ff70580494869ae0fa8a4f7c3e9b26cf3eabdfee35a0d6b17baf7R6-R9
I want to test that this code, which the CLI runs, actually works in a real world use case: https://github.com/milesj/monolith/blob/master/crates/toolchain/src/tools/node.rs#L189-L215 Right now I either get a "Permission denied" or "No such file or directory" error.
from assert_cmd.
Under what conditions do you get each of those errors?
Is this local, CI, or both?
What platforms are you seeing the failure? Know of platforms that work?
btw this is most likely a very specific setup failure or a program bug. I'd recommend tracing in to see which call is failing and verifying the inputs to that call and make sure you are reproducing with those same inputs.
from assert_cmd.
@epage It fails locally and in CI, for both mac/linux.
I'll try and trace to debug more.
from assert_cmd.
@milesj I think I found the problem, but it does bring up a question. Does assert()
wait for the entire child process to complete? Because this test could take many seconds.
Is there a way to write these in an async/await fashion?
from assert_cmd.
Yes, this is for one-shot testing rather than interactive testing, so it waits for the program to finish.
from assert_cmd.
This is still happening, but I've narrowed it down to this line: https://github.com/milesj/moon/blob/master/crates/toolchain/src/helpers.rs#L78
It seems like the dirs aren't being created on line 71 and I have no idea why.
This is the entire test https://github.com/milesj/moon/pull/5/files#diff-a31902d06ac6afdddf64feb76dc589f59e39a33434c352de60ba84f8beca4427R16
from assert_cmd.
Not sure what changed, but this isn't an issue anymore. Closing.
from assert_cmd.
Related Issues (20)
- stdout/stderr for text processes is ugly HOT 4
- Unable to test TTY behavior HOT 5
- Document how to use assert_cmd with rust-cross HOT 5
- Improve the Debug implementation of Command HOT 1
- Assert#dump() HOT 2
- Some help with getting started HOT 4
- Running a binary in cargo workspace HOT 3
- .timeout() functionality does not work on payload processes with children HOT 3
- Dependency Dashboard
- Track performance metrics of child processes HOT 2
- how to trigger binary builds from 'cargo test' HOT 2
- Allow customising number of lines shown before <n lines omitted> HOT 6
- unknown feature `proc_macro_span_shrink` with Rust 1.74.0 HOT 3
- Documentation for subcommand HOT 1
- Reexport `predicates` in crate root HOT 1
- Add .try_assert() for a panic-free version of .assert() HOT 1
- Add input/output redirection support
- how to trigger debugging in vscode when use Command::cargo_bin("")? HOT 1
- Does not work in GitHub Actions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assert_cmd.