Skip to content

Conversation

@Piinks
Copy link
Contributor

@Piinks Piinks commented Nov 8, 2019

Description

This PR adds support for pre-submit tryjobs for Flutter Gold. This will allow for golden file tests to be run against baselines in pre-sbumit tests, generating visual diffs and enabling pre-submit triage of new or changed golden files.

Status:

Related Issues

Tests

Updated related tests.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@Piinks Piinks added a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels. work in progress; do not review labels Nov 8, 2019
@Piinks Piinks changed the title Pre-Submit Tryjobs for Flutter Gold [WIP] Pre-Submit Tryjobs for Flutter Gold Nov 8, 2019
@Piinks
Copy link
Contributor Author

Piinks commented Nov 11, 2019

@Piinks
Copy link
Contributor Author

Piinks commented Nov 19, 2019

I'll have to make a framework change to actually trigger a framework test and see that this works... looking for a typo or something similar...

@Piinks Piinks added a: fidelity Matching the OEM platforms better a: images Loading, displaying, rendering images a: quality A truly polished experience labels Nov 19, 2019
/// behavior.
/// we reduce the duration and the corresponding number of frames for
/// animations. This enum is used to allow certain [AnimationController]s to opt
/// out of this behavior.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is a trivial 80 character line limit correction in keeping with the style guide, and to also trigger the relevant framework tests confirming tryjob execution.

@Piinks
Copy link
Contributor Author

Piinks commented Nov 20, 2019

It looks like this is a bit flaky.
On the failing test shards, some tests have failed with this exception from

goldctl imgtest add ...

Exit code 1: Skia Gold tryjobAdd failure.
stdout:
stderr: Error running command: ''gold client not ready: Gold results fields invalid: Received nil
pointer for GoldResult. At jsonio.go:194 goldclient.go:452 goldclient.go:289 goldclient.go:279
cmd_imgtest.go:334 command.go:833 command.go:917 main.go:45 proc.go:203 asm_amd64.s:1357. At
goldclient.go:453 goldclient.go:289 goldclient.go:279 cmd_imgtest.go:334 command.go:833
command.go:917 main.go:45 proc.go:203 asm_amd64.s:1357''

When the exception was thrown, this was the stack:
#0      SkiaGoldClient.tryjobAdd (package:flutter_goldens_client/skia_client.dart:284:7)
<asynchronous suspension>
#1      FlutterPreSubmitFileComparator.compare (package:flutter_goldens/flutter_goldens.dart:313:23)
<asynchronous suspension>

The tryjob did show up on the dashboard here: https://flutter-gold.skia.org/changelists?page_size=50
Clicking on it results in a 404 error.

@kjlubick
Copy link
Contributor

kjlubick commented Nov 21, 2019

Around 22:07 UTC (last night), I see from the ingestion logs that files were uploaded to the right place and processed.
I see some entries in Firestore:

  • the ChangeList was made, and a Patchset 1 under it
  • 6 cirrus TryJobs
  • oodles of TryJobResults

From that conclusion, data is (mostly) getting into Gold successfully.

The 404 is due to the frontend not linking properly to GitHub. If you click Triage that takes you to a page that should show the TryJobResults, but isn't - I'm investigating that.

@kjlubick
Copy link
Contributor

Ah, the data in Firestore is slightly wrong - the TryJob and TryJobResults are incorrectly tagged as being "gerrit"

@Piinks Piinks changed the title Pre-Submit Tryjobs for Flutter Gold [WIP] Pre-Submit Tryjobs for Flutter Gold Nov 22, 2019
@Piinks Piinks changed the title [WIP] Pre-Submit Tryjobs for Flutter Gold Pre-Submit Tryjobs for Flutter Gold Nov 26, 2019
Comment on lines +217 to +218
final File keys = workDirectory.childFile('keys.json');
final File failures = workDirectory.childFile('failures.json');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is workDirectory in source control? Should we be putting this in some kind of temp directory that gets blown away after CI is done?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is workDirectory in source control?

I am not sure what you mean by this.

I thought it was automatically blown away on ci since we start with a clean instance for each build. I can split it out further for ci/non-ci code paths, but I thought this would keep it from becoming a more complicated code path for those cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this should be fine. I was worried we were modifying something that the Flutter source control cared about with this.

Comment on lines +133 to +136
/// The optional [suffix] argument is used by the
/// [FlutterSkiaGoldFileComparator] and the [FlutterPreSubmitFileComparator].
/// These [FlutterGoldenFileComparators] randomize their base directories to
/// maintain thread safety while using the `goldctl` tool.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When run locally, we want the files to be accessible to see diffs etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh. I'm a bit curious about whether we'd hit collisions at some point using math.random, but it's probably fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so too, but then realized we only run 2-3 processes concurrently on ci, and only ~130/~4500 tests are golden file tests, so I feel like a collision would be incredibly rare in how this is written.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Piinks
Copy link
Contributor Author

Piinks commented Dec 4, 2019

Thanks for the review @dnfield! I just need to update the wiki and this will be ready to go.

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • This pull request has changes requested. Please resolve those before re-applying the label.

@Piinks
Copy link
Contributor Author

Piinks commented Dec 4, 2019

This pull request is not suitable for automatic merging in its current state.

  • This pull request has changes requested. Please resolve those before re-applying the label.

@dnfield I haven't seen this before. What does it mean?

@dnfield
Copy link
Contributor

dnfield commented Dec 4, 2019

It's a bug :( It'ssupposed to be checking for reviews and refuse to merge if there are open change requests. This PR doesn't have any. Unfortunately the bot won't merge it currently.

@Piinks
Copy link
Contributor Author

Piinks commented Dec 4, 2019

It's a bug :( It'ssupposed to be checking for reviews and refuse to merge if there are open change requests. This PR doesn't have any. Unfortunately the bot won't merge it currently.

No worries! I was curious. :)

@skia-gold
Copy link

test message from gold

@Piinks
Copy link
Contributor Author

Piinks commented Dec 18, 2019

test message from gold

I read you gold leader. ⭐️ 😛

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
@Piinks Piinks deleted the goldTryjobs branch March 14, 2025 17:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: fidelity Matching the OEM platforms better a: images Loading, displaying, rendering images a: quality A truly polished experience a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Tryjobs for Flutter Gold Better Triage Notification System for Gold

6 participants