send message!

This commit is contained in:
nora 2022-02-23 20:08:03 +01:00
parent b50634841d
commit 99ce586dec
8 changed files with 169 additions and 66 deletions

View file

@ -1,9 +1,25 @@
use crate::project_root;
use anyhow::{bail, Context, Result};
use std::process::Command;
use std::path::Path;
use std::process::{Command, Stdio};
pub fn main() -> Result<()> {
let test_js_root = project_root().join("test-js");
let project_root = project_root();
let test_js_root = project_root.join("test-js");
let mut amqp_server = Command::new("cargo")
.arg("run")
.spawn()
.context("`cargo run` amqp")?;
let test_result = run_js(&test_js_root);
amqp_server.kill()?;
test_result
}
fn run_js(test_js_root: &Path) -> Result<()> {
let status = Command::new("yarn")
.current_dir(&test_js_root)
.status()
@ -16,9 +32,9 @@ pub fn main() -> Result<()> {
.current_dir(&test_js_root)
.status()
.context("yarn test tests")?;
if !status.success() {
bail!("yarn tests failed");
}
Ok(())
}