[render-test] Cleanup on the render tests results

Simplify the code path and make it print both rendering error and
metrics on fail.
This commit is contained in:
Thiago Marcos P. Santos
2019-12-16 00:49:04 +02:00
parent e298435206
commit ad1a7c595d
5 changed files with 129 additions and 120 deletions

View File

@@ -178,11 +178,15 @@ int runRenderTests(int argc, char** argv, std::function<void()> testStatus) {
}
}
auto results = runner.run(metadata);
if (metadata.document.ObjectEmpty()) {
metadata.metricsErrored++;
metadata.renderErrored++;
} else {
runner.run(metadata);
}
bool errored = !metadata.errorMessage.empty() || !(results.probeFailed || results.renderFailed);
bool imageOK = (!metadata.outputsImage || !metadata.diff.empty()) && metadata.difference <= metadata.allowed;
bool passed = !errored && imageOK;
bool errored = metadata.metricsErrored || metadata.renderErrored;
bool passed = !errored && !metadata.metricsFailed && !metadata.renderFailed;
if (shouldIgnore) {
if (passed) {
@@ -201,7 +205,7 @@ int runRenderTests(int argc, char** argv, std::function<void()> testStatus) {
// to succeed on metrics failed so the rebaseline bot can run next in the
// pipeline and collect the new baselines. The rebaseline bot will ultimately
// report the error and block the patch from being merged.
if (results.renderFailed == false || !imageOK) {
if (metadata.renderErrored || metadata.renderFailed) {
returnCode = 1;
}