WIP: Run standalone demos as part of Cargo Test #356
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#356
Loading…
Reference in New Issue
No description provided.
Delete Branch "enhance/cargo-test-standalone-demos"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Not something that is particularly necessary, but this allows all tests within NAC3 (excluding
nac3artiq
tests) to be executed viacargo test
, simplifying the testing workflow.What's going to happen to check_demos.sh?
Also I would solve this the other way i.e. run cargo test from a shell script that runs all tests. Cargo is inflexible and annoying (we use it only because there is currently no other existing solution to solve and download crates.io dependencies, not because it is any good), and Rust isn't a great scripting language. Bash/Make is superior to both in many respects for build/test systems.
I am planning to keep it for now, it doesn't really introduce any bloat to the project.
I just find it to be more idiomatic to write test cases (including integration tests) using a (or the) testing framework provided by the language, as (1) it provides a one-stop shop to auto-discover and run test cases, which is especially useful in a multi-module project like this, (2) it generally provides more ways to manage temp resources (e.g. automatically removing temp files), and (3) it can run all tests before providing a summary, something that
check_demos.sh
currently does not do and will likely require some refactoring to add the ability.2e44e34b52
to0d9db5525c
As discussed during yesterday's meeting, moving everything to
cargo test
+cargo run
and removing the shell scripts would have clear practical advantages:0d9db5525c
to2244f347c3
@ -32,3 +32,3 @@
echo "Checking nac3standalone demos..."
echo "Running Cargo tests..."
pushd nac3standalone/demo
patchShebangs .
Just remove pushd/popd and do
patchShebangs nac3standalone/demo
?But I thought the plan was to remove shell scripts anyway. Then there are no shebangs to patch?
Yeah it's not ready yet, that push was just a rebase.
Marked WIP now for clarity.
Run standalone demos as part of Cargo Testto WIP: Run standalone demos as part of Cargo Test@ -0,0 +80,4 @@
fn run_demo(file: &Path, nac3_args: &[&str]) -> io::Result<Output> {
let _lk = RUN_EXEC_MTX.lock();
Command::new("./run_demo.sh")
Otherwise the benefits I mentioned aren't there.
2244f347c3
to710cfd7bb9
710cfd7bb9
toaffa19e88d
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.