Skip to content

Commit a51ca6d

Browse files
authored
Add ignored test column to conformance test report (#151)
1 parent 7c0c274 commit a51ca6d

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

partiql-conformance-tests/src/bin/generate_comparison_report.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ struct CTSReport {
1111
commit_hash: String,
1212
passing: Vec<String>,
1313
failing: Vec<String>,
14+
ignored: Vec<String>
1415
}
1516

1617
/// Compares two conformance reports generated from [`generate_cts_report`], generating a comparison
@@ -52,6 +53,9 @@ fn main() {
5253
let orig_passing: HashSet<String> = HashSet::from_iter(orig_report.passing);
5354
let new_passing: HashSet<String> = HashSet::from_iter(new_report.passing);
5455

56+
let orig_ignored: HashSet<String> = HashSet::from_iter(orig_report.ignored);
57+
let new_ignored: HashSet<String> = HashSet::from_iter(new_report.ignored);
58+
5559
let passing_in_both = orig_passing.intersection(&new_passing);
5660
let failing_in_both = orig_failing.intersection(&new_failing);
5761
let passing_orig_failing_new: Vec<&String> = orig_passing.intersection(&new_failing).collect();
@@ -66,8 +70,11 @@ fn main() {
6670
let num_orig_failing = orig_failing.len() as i32;
6771
let num_new_failing = new_failing.len() as i32;
6872

69-
let total_orig = num_orig_passing + num_orig_failing as i32;
70-
let total_new = num_new_passing + num_new_failing as i32;
73+
let num_orig_ignored = orig_ignored.len() as i32;
74+
let num_new_ignored = new_ignored.len() as i32;
75+
76+
let total_orig = num_orig_passing + num_orig_failing + num_orig_ignored as i32;
77+
let total_new = num_new_passing + num_new_failing + num_new_ignored as i32;
7178

7279
let orig_passing = num_orig_passing as f32 / total_orig as f32 * 100.;
7380
let new_passing = num_new_passing as f32 / total_new as f32 * 100.;
@@ -81,6 +88,7 @@ fn main() {
8188
| % Passing | {:.2}% | {:.2}% | {:.2}% |
8289
| :white_check_mark: Passing | {} | {} | {} |
8390
| :x: Failing | {} | {} | {} |
91+
| :large_orange_diamond: Ignored | {} | {} | {} |
8492
| Total Tests | {} | {} | {} |\n",
8593
&orig_report.commit_hash,
8694
&new_report.commit_hash,
@@ -93,6 +101,9 @@ fn main() {
93101
num_orig_failing,
94102
num_new_failing,
95103
num_new_failing - num_orig_failing,
104+
num_orig_ignored,
105+
num_new_ignored,
106+
num_new_ignored - num_orig_ignored,
96107
total_orig,
97108
total_new,
98109
total_new - total_orig

partiql-conformance-tests/src/bin/generate_cts_report.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fn main() {
3030

3131
let mut all_passing_test_names: Vec<Value> = Vec::new();
3232
let mut all_failing_test_names: Vec<Value> = Vec::new();
33+
let mut all_ignored_test_names: Vec<Value> = Vec::new();
3334

3435
for line in reader.lines() {
3536
match line {
@@ -41,6 +42,8 @@ fn main() {
4142
all_passing_test_names.push(v["name"].to_owned());
4243
} else if event == "failed" {
4344
all_failing_test_names.push(v["name"].to_owned());
45+
} else if event == "ignored" {
46+
all_ignored_test_names.push(v["name"].to_owned());
4447
}
4548
}
4649
}
@@ -51,7 +54,8 @@ fn main() {
5154
let report_as_json = json!({
5255
"commit_hash": commit_hash,
5356
"passing": all_passing_test_names,
54-
"failing": all_failing_test_names
57+
"failing": all_failing_test_names,
58+
"ignored": all_ignored_test_names
5559
});
5660

5761
File::create(output_file_name)

0 commit comments

Comments
 (0)