Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
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
4 changes: 4 additions & 0 deletions lib/web_ui/dev/steps/run_tests_step.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ class RunTestsStep implements PipelineStep {
_checkExitCode('Golden tests');
}

if (skiaClient != null && skiaClient.isInitialized) {
skiaClient.imgtestFinalize();
}

if (!allShardsPassed) {
throw ToolExit(_createFailedShardsMessage());
}
Expand Down
25 changes: 25 additions & 0 deletions web_sdk/web_test_utils/lib/skia_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class SkiaGoldClient {

/// Indicates whether the `goldctl` tool has been initialized for the current
/// test context.
bool get isInitialized => _isInitialized;
bool _isInitialized = false;

/// Indicates whether the client has already been authorized to communicate
Expand Down Expand Up @@ -203,6 +204,30 @@ class SkiaGoldClient {
return true;
}

/// Executes the `imgtest finalize` command in the `goldctl` tool.
///
/// Since we removed `--passfail` from our post-submit commands, images aren't
/// being uploaded anymore. In order to make sure they are uploaded, we need
/// to manually call `imgtest finalize` after all tests are complete.
Future<bool> imgtestFinalize() async {
await _imgtestInit();

final List<String> imgtestCommand = <String>[
_goldctl,
'imgtest', 'finalize',
'--work-dir', _tempPath,
];

final ProcessResult result = await _runCommand(imgtestCommand);

if (result.exitCode != 0) {
print('goldctl imgtest finalize stdout: ${result.stdout}');
print('goldctl imgtest finalize stderr: ${result.stderr}');
}

return true;
}

/// Executes the `imgtest init` command in the `goldctl` tool for tryjobs.
///
/// The `imgtest` command collects and uploads test results to the Skia Gold
Expand Down