Test benchmark cases in separate job (vercel/turbo#311)

Move benchmark test into separate job and run them for windows and macOS too
This commit is contained in:
Tobias Koppers 2022-09-06 08:48:01 +02:00 committed by GitHub
parent e55a098efd
commit d78084a0b4

View file

@ -100,6 +100,7 @@ impl PreparedApp {
async fn dispose(self) {
if let Some(mut server) = self.server {
server.0.kill().unwrap();
server.0.wait().unwrap();
}
for page in self.pages {
page.close().await.unwrap();
@ -107,6 +108,16 @@ impl PreparedApp {
}
}
fn command(bin: &str) -> Command {
if cfg!(windows) {
let mut command = Command::new("cmd.exe");
command.args(["/C", bin]);
command
} else {
Command::new(bin)
}
}
fn build_test(module_count: usize) -> PathBuf {
let test_dir = TestAppBuilder {
module_count,
@ -117,7 +128,7 @@ fn build_test(module_count: usize) -> PathBuf {
.build()
.unwrap();
let npm = Command::new("npm")
let npm = command("npm")
.args(["install", "--prefer-offline", "--loglevel=error"])
.current_dir(&test_dir)
.output()