Skip to content
Draft
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
16 changes: 14 additions & 2 deletions src/compile/ir/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,22 @@ mod tests {
let step = StepId::new("synthPr").unwrap();
let v = EnvValue::coalesce(vec![
EnvValue::ado_macro("System.PullRequest.PullRequestId").unwrap(),
EnvValue::step_output(OutputRef::new(step, "AW_SYNTHETIC_PR_ID")),
EnvValue::step_output(OutputRef::new(step.clone(), "AW_SYNTHETIC_PR_ID")),
]);
match v {
EnvValue::Coalesce(parts) => assert_eq!(parts.len(), 2),
EnvValue::Coalesce(parts) => {
assert_eq!(parts.len(), 2);
assert_eq!(
parts[0],
EnvValue::AdoMacro("System.PullRequest.PullRequestId"),
"first child must be the AdoMacro"
);
assert_eq!(
parts[1],
EnvValue::StepOutput(OutputRef::new(step, "AW_SYNTHETIC_PR_ID")),
"second child must be the StepOutput"
);
}
_ => panic!("expected Coalesce"),
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/compile/ir/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ mod tests {
} else {
panic!();
}
} else {
panic!("expected Jobs body");
}
}

Expand Down Expand Up @@ -959,6 +961,8 @@ mod tests {
let err = build_graph(&p).unwrap_err();
let msg = format!("{err:#}");
assert!(msg.contains("duplicate StepId 'marker'"), "got: {msg}");
assert!(msg.contains("previously declared in"), "got: {msg}");
assert!(msg.contains("pipeline-wide unique"), "got: {msg}");
}

#[test]
Expand Down Expand Up @@ -1013,6 +1017,8 @@ mod tests {
let agent = jobs.iter().find(|j| j.id.as_str() == "Agent").unwrap();
assert_eq!(agent.depends_on.len(), 1);
assert_eq!(agent.depends_on[0].as_str(), "Setup");
} else {
panic!("expected Jobs body");
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/compile/ir/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ mod tests {
#[test]
fn outputdecl_secret_marks_secret() {
let d = OutputDecl::secret("MCP_GATEWAY_API_KEY");
assert_eq!(d.name, "MCP_GATEWAY_API_KEY");
assert!(d.is_secret);
assert!(!d.auto_is_output);
}

#[test]
Expand Down