Skip to content

Commit

Permalink
Test benchmark cases in separate job (vercel/turborepo#311)
Browse files Browse the repository at this point in the history
Move benchmark test into separate job and run them for windows and macOS too
  • Loading branch information
sokra committed Sep 6, 2022
1 parent 2b6f15b commit 92d37fc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/next-dev/benches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,24 @@ 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();
}
}
}

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,
Expand All @@ -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()
Expand Down

0 comments on commit 92d37fc

Please sign in to comment.