This package allows to create a Skia gold client in the engine repo.
The client uses the goldctl
tool on LUCI builders to upload screenshots,
and verify if a new screenshot matches the baseline screenshot.
The web UI is available on https://flutter-engine-gold.skia.org/.
- In
.ci.yaml
, ensure that the task has a dependency ongoldctl
:
dependencies: [{"dependency": "goldctl"}]
- Add dependency in
pubspec.yaml
:
dependencies:
skia_gold_client:
path: <relative-path>/testing/skia_gold_client
- Use the client:
import 'package:skia_gold_client/skia_gold_client.dart';
Future<void> main() {
final Directory tmpDirectory = Directory.current.createTempSync('skia_gold_wd');
final SkiaGoldClient client = SkiaGoldClient(
tmpDirectory,
dimensions: <String, String> {'<attribute-name>': '<attribute-value>'},
);
try {
if (isSkiaGoldClientAvailable) {
await client.auth();
await client.addImg(
'<file-name>',
File('gold-file.png'),
screenshotSize: 1024,
);
}
} catch (error) {
// Failed to authenticate or compare pixels.
stderr.write(error.toString());
rethrow;
} finally {
tmpDirectory.deleteSync(recursive: true);
}
}