Skip to content

Commit

Permalink
Add smoke test on all of Herostratus's own branches
Browse files Browse the repository at this point in the history
This only tests that it doesn't exit with an error.
  • Loading branch information
Notgnoshi committed Oct 28, 2024
1 parent bd4f89f commit b7f85b6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/check.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
mod common;

use std::path::Path;

use common::CommandExt;
use herostratus::git::clone::find_local_repository;
use predicates::prelude::*;
use predicates::str;

Expand Down Expand Up @@ -39,3 +42,21 @@ fn search_current_repo_for_fixup_commits() {
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(assertion.eval(&stdout));
}

#[test]
fn smoke_test_on_all_own_branches() {
let path = Path::new(".");
let repo = find_local_repository(path).unwrap();

let branches = repo.branches(None).unwrap();
for branch in branches {
let (branch, _local_or_remote) = branch.unwrap();
let name = branch.name().unwrap().unwrap();

let (mut cmd, _temp) = common::herostratus(None);
cmd.arg("check").arg(".").arg(name);

let output = cmd.captured_output().unwrap();
assert!(output.status.success());
}
}

0 comments on commit b7f85b6

Please sign in to comment.