-
Notifications
You must be signed in to change notification settings - Fork 95
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
Simplify the run.rs
scripts of our dataflow examples using xshell
#495
base: main
Are you sure you want to change the base?
Conversation
…hell` The `xshell` crate provides a more convenient way to build and run a `Command`, which is more similar to traditional bash scripts. Using this crate, we can simplify our `run.rs` script while still being platform-independent and not requiring any external dependencies. We can also still run the examples using `cargo run --example`.
run.rs
script of the rust-dataflow
example using xshell
run.rs
scripts of our dataflow examples using xshell
We don't modify the PATH for the current executable anymore, so we cannot use the `get_python_path`/`get_pip_path` functions anymore.
This command is useful for testing examples with multiple daemons.
…ommand and `xshell` crate
Do we want to proceed with this approach? Personally, I think this is a considerable improvement because it changes the previous From: let cargo = std::env::var("CARGO").unwrap();
let mut cmd = tokio::process::Command::new(&cargo);
cmd.arg("run");
cmd.arg("--package").arg("dora-cli");
cmd.arg("--").arg("build").arg(dataflow);
if !cmd.status().await?.success() {
bail!("failed to build dataflow");
}; To: let dora = prepare_dora(&sh)?;
cmd!(sh, "{dora} build dataflow.yml").run()?; Possible alternatives:
|
Looks good to me ! |
@haixuanTao I get a |
We decided to wait a bit with this PR until #551 is ready. We hope that we can create a proper integration test framework then instead of using the example as integration tests. Perhaps we can find a even better solution for running the examples then (after the testing part is moved to the test framework). |
The
xshell
crate provides a more convenient way to build and run aCommand
, which is more similar to traditional bash scripts. Using this crate, we can simplify ourrun.rs
scripts while still being platform-independent and not requiring any external dependencies. We can also still run the examples usingcargo run --example
.Alternative to #454 .