Skip to content

Commit d145c19

Browse files
committed
First test: Run bark-aspd
1 parent 197aa99 commit d145c19

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ members = [
66
"aspd",
77
"bark",
88

9-
"sled-utils",
9+
"sled-utils", "ark-testing",
1010
]
1111

1212
resolver = "2"

ark-testing/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "ark-testing"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
tokio.workspace = true

ark-testing/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#[cfg(test)]
2+
mod tests {
3+
#[test]
4+
fn add_two() {
5+
assert_eq!(1+1, 2);
6+
}
7+
}

ark-testing/tests/aspd.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
extern crate tokio;
2+
3+
use tokio::process::Command;
4+
5+
#[tokio::test]
6+
async fn run_aspd() {
7+
let output = Command::new("cargo")
8+
.arg("run")
9+
.arg("--package")
10+
.arg("bark-aspd")
11+
.arg("--")
12+
.arg("--version")
13+
.kill_on_drop(true)
14+
.output()
15+
.await
16+
.expect("Failed to spawn process and capture output");
17+
18+
let stdout = String::from_utf8(output.stdout).expect("Output is valid utf-8");
19+
assert!(stdout.starts_with("bark-aspd"))
20+
}

0 commit comments

Comments
 (0)