Skip to content

Commit 01badac

Browse files
isPANNclaude
andcommitted
Remove stale zero-length CLI tests after validator relaxation (#472)
PR #472 (commit f13bbb3) relaxed SequencingToMinimizeWeightedCompletionTime's validator to accept zero-length tasks for the Lawler OLA reduction. Two CLI tests still asserted the removed "task lengths must be positive" rejection, so CI broke on the workspace test job. The new accept-zero-length semantics are positively covered by unit tests in src/unit_tests/models/misc/sequencing_to_minimize_weighted_completion_time.rs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent ce57220 commit 01badac

1 file changed

Lines changed: 0 additions & 59 deletions

File tree

problemreductions-cli/tests/cli_tests.rs

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3735,24 +3735,6 @@ fn test_create_help_describes_precedence_pairs_generically() {
37353735
assert!(stdout.contains("Precedence pairs for MinimumTardinessSequencing, SchedulingWithIndividualDeadlines, or SequencingToMinimizeWeightedCompletionTime"));
37363736
}
37373737

3738-
#[test]
3739-
fn test_create_sequencing_to_minimize_weighted_completion_time_rejects_zero_length() {
3740-
let output = pred()
3741-
.args([
3742-
"create",
3743-
"SequencingToMinimizeWeightedCompletionTime",
3744-
"--lengths",
3745-
"0,1,3",
3746-
"--weights",
3747-
"3,5,1",
3748-
])
3749-
.output()
3750-
.unwrap();
3751-
assert!(!output.status.success());
3752-
let stderr = String::from_utf8_lossy(&output.stderr);
3753-
assert!(stderr.contains("task lengths must be positive"), "{stderr}");
3754-
}
3755-
37563738
#[test]
37573739
fn test_create_with_edge_weights() {
37583740
let output_file = std::env::temp_dir().join("pred_test_create_ew.json");
@@ -5889,47 +5871,6 @@ fn test_inspect_stdin() {
58895871
);
58905872
}
58915873

5892-
#[test]
5893-
fn test_inspect_rejects_zero_length_sequencing_problem_from_stdin() {
5894-
let create_out = pred()
5895-
.args([
5896-
"create",
5897-
"--example",
5898-
"SequencingToMinimizeWeightedCompletionTime",
5899-
])
5900-
.output()
5901-
.unwrap();
5902-
assert!(
5903-
create_out.status.success(),
5904-
"stderr: {}",
5905-
String::from_utf8_lossy(&create_out.stderr)
5906-
);
5907-
5908-
let mut json: serde_json::Value = serde_json::from_slice(&create_out.stdout).unwrap();
5909-
json["data"]["lengths"][0] = serde_json::json!(0);
5910-
let invalid_json = serde_json::to_vec(&json).unwrap();
5911-
5912-
use std::io::Write;
5913-
let mut child = pred()
5914-
.args(["inspect", "-"])
5915-
.stdin(std::process::Stdio::piped())
5916-
.stdout(std::process::Stdio::piped())
5917-
.stderr(std::process::Stdio::piped())
5918-
.spawn()
5919-
.unwrap();
5920-
child
5921-
.stdin
5922-
.take()
5923-
.unwrap()
5924-
.write_all(&invalid_json)
5925-
.unwrap();
5926-
let result = child.wait_with_output().unwrap();
5927-
5928-
assert!(!result.status.success());
5929-
let stderr = String::from_utf8(result.stderr).unwrap();
5930-
assert!(stderr.contains("task lengths must be positive"), "{stderr}");
5931-
}
5932-
59335874
#[test]
59345875
fn test_inspect_json_output() {
59355876
let problem_file = std::env::temp_dir().join("pred_test_inspect_json_in.json");

0 commit comments

Comments
 (0)