Skip to content

Commit

Permalink
Add set preset
Browse files Browse the repository at this point in the history
Sets only reported results (useful for partial runs)

Signed-off-by: sagudev <[email protected]>
  • Loading branch information
sagudev committed Jul 31, 2024
1 parent f362eb8 commit aecc2e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions moz-webgpu-cts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ enum UpdateExpectedPreset {
#[value(alias("same-build"))]
Merge,
ResetAll,
/// Sets only reported results
Set,
}

impl From<UpdateExpectedPreset> for process_reports::ReportProcessingPreset {
Expand All @@ -246,6 +248,7 @@ impl From<UpdateExpectedPreset> for process_reports::ReportProcessingPreset {
UpdateExpectedPreset::ResetContradictory => Self::ResetContradictoryOutcomes,
UpdateExpectedPreset::Merge => Self::MergeOutcomes,
UpdateExpectedPreset::ResetAll => Self::ResetAllOutcomes,
UpdateExpectedPreset::Set => Self::SetNewOutcomes,
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions moz-webgpu-cts/src/process_reports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub(crate) enum ReportProcessingPreset {
ResetContradictoryOutcomes,
MergeOutcomes,
ResetAllOutcomes,
SetNewOutcomes,
}

#[derive(Debug, Default)]
Expand Down Expand Up @@ -136,6 +137,10 @@ fn reconcile<Out>(
Some(rep) => meta | rep,
None => meta,
},
ReportProcessingPreset::SetNewOutcomes => |meta, rep| match rep {
Some(rep) => rep,
None => meta,
},
};

ExpandedPropertyValue::from_query(|platform, build_profile| {
Expand Down Expand Up @@ -452,6 +457,7 @@ pub(crate) fn process_reports(
log::warn!("removing metadata after {msg}");
return None;
}
ReportProcessingPreset::SetNewOutcomes => {}
}
}

Expand Down Expand Up @@ -525,6 +531,7 @@ pub(crate) fn process_reports(
log::warn!("removing metadata after {msg}");
return None;
}
ReportProcessingPreset::SetNewOutcomes => {}
}
}

Expand Down

0 comments on commit aecc2e1

Please sign in to comment.