Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions crates/squabble-cli/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ mod polarity_plumbing_tests {
#[test]
fn a_job_id_is_read_from_a_real_details_url() {
// Shape taken from a live `gh pr view --json statusCheckRollup`.
let url = "https://github.com/hyperpolymath/standards/actions/runs/33817314194/job/100852208701";
let url =
"https://github.com/hyperpolymath/standards/actions/runs/33817314194/job/100852208701";
assert_eq!(job_id_from_details_url(url), Some(100852208701));
}

Expand All @@ -354,7 +355,8 @@ mod polarity_plumbing_tests {
// of course. Cutting the id on `/` alone leaves the suffix attached,
// `parse::<u64>` fails, and the green is skipped without a word — the
// exact silent undercount this module exists to prevent.
let base = "https://github.com/hyperpolymath/standards/actions/runs/33817314194/job/100852208701";
let base =
"https://github.com/hyperpolymath/standards/actions/runs/33817314194/job/100852208701";
for suffix in ["?check_suite_focus=true", "#step:4:1", "?a=1#step:2:9"] {
let url = format!("{base}{suffix}");
assert_eq!(
Expand All @@ -374,19 +376,14 @@ mod polarity_plumbing_tests {
None
);
assert_eq!(
job_id_from_details_url(
"https://github.com/o/r/actions/runs/1"
),
job_id_from_details_url("https://github.com/o/r/actions/runs/1"),
None
);
}

#[test]
fn an_external_job_url_is_not_treated_as_a_github_actions_job() {
assert_eq!(
job_id_from_details_url("https://ci.example/job/42"),
None
);
assert_eq!(job_id_from_details_url("https://ci.example/job/42"), None);
}

#[test]
Expand Down
1 change: 1 addition & 0 deletions crates/squabble-cli/src/fight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use squabble_core::moves::Move;
use squabble_core::outcome::Escalation;
use squabble_core::polarity::Evidence;
use squabble_core::outcome::Outcome;
use squabble_core::polarity::{Applicability, Evidence, RepoDeclaration};
use squabble_fight::context::RepoContext;
use std::path::PathBuf;
use std::process::ExitCode;
Expand Down
26 changes: 16 additions & 10 deletions crates/squabble-core/src/polarity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ pub fn classify(

let cause = if signature.matches(steps) {
Some(VacuityCause::StubbedAfterSkippedScan)
} else if steps.iter().all(|s| s.conclusion == StepConclusion::Skipped) {
} else if steps
.iter()
.all(|s| s.conclusion == StepConclusion::Skipped)
{
Some(VacuityCause::AllStepsSkipped)
} else {
None
Expand Down Expand Up @@ -669,7 +672,10 @@ mod tests {
// A skip is half the signature, so anything we do not model must never
// be mistaken for one.
assert_eq!(StepConclusion::parse(None), StepConclusion::Other);
assert_eq!(StepConclusion::parse(Some("neutral")), StepConclusion::Other);
assert_eq!(
StepConclusion::parse(Some("neutral")),
StepConclusion::Other
);
assert_eq!(
StepConclusion::parse(Some("skipped")),
StepConclusion::Skipped
Expand Down Expand Up @@ -830,7 +836,9 @@ mod tests {
Recommendation::MakeItGreatInPractice
);
assert!(
unmeasured.describe().contains("target-tech-present=unmeasured"),
unmeasured
.describe()
.contains("target-tech-present=unmeasured"),
"got `{}`",
unmeasured.describe()
);
Expand Down Expand Up @@ -878,13 +886,11 @@ mod tests {
#[test]
fn genuine_and_not_applicable_project_to_nothing() {
assert!(PolarityVerdict::Genuine.to_move("c").is_none());
assert!(
PolarityVerdict::NotApplicable {
declaration: "d".into()
}
.to_move("c")
.is_none()
);
assert!(PolarityVerdict::NotApplicable {
declaration: "d".into()
}
.to_move("c")
.is_none());
}

// ---- the Rust witness of the SPARK theorem ------------------------------
Expand Down
Loading