-
Notifications
You must be signed in to change notification settings - Fork 100
Support test ownership validation #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support test ownership validation #1301
Conversation
|
One thing I am worry about this approach is that is may be a pain to migrate TESTOWNERS format, also one can break the presubmit by changing the script without knowing. Otherwise it looks good |
That's true, but I don't think we have a short plan to finish ownership info for shards tests or any big format migration. On the other hand, we have seen people adding tests without adding ownership over time, which causes pain to the infra team. The main reason I put it under cocoon is we can extend the functionality to support other repos in the future. One way to avoid any unknown breakage is put it under For now, I added more unit tests for other types to cover all scenarios to try avoiding breakage change from cocoon side without knowing. We need to revisit the logic when we have ownership for shard tests, or when we expand the logic to other repos. |
CaseyHillers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to Chun-Heng's comment about testability. You should add an integration test that ensures this is testing the tip of tree to prevent breakages landing here
| Future<List<String>> remoteCheck(String repo, String ref) async { | ||
| final HttpClient client = HttpClient(); | ||
| final Uri ciYamlUrl = Uri.https('raw.githubusercontent.com', 'flutter/$repo/$ref/.ci.yaml'); | ||
| final HttpClientRequest ciYamlRequest = await client.getUrl(ciYamlUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the other bin scripts get ciYaml from a network request. Should we refactor this into a utility so they can all share that logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used existing utils function instead. Also updated bing/generate_jspb.dart.
+1 to Chun-Heng's comment about testability. You should add an integration test that ensures this is testing the tip of tree to prevent breakages landing here
https://flutter-review.googlesource.com/c/recipes/+/16300 is ready to accept trigger from cocoon. Will create a new builder once the recipe cl is in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know we have integration tests here. Just created one instead.
| import 'dart:convert'; | ||
| import 'dart:io'; | ||
|
|
||
| import 'package:cocoon_service/src/request_handlers/flaky_handler_utils.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move some the getTestowner code out to a more generic util file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to do that in a separate PR.
|
|
||
| import '../../protos.dart'; | ||
| import '../foundation/typedefs.dart'; | ||
| import '../request_handlers/flaky_handler_utils.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird dependency, I will probably move the methods here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I know, but don't wanna to make this PR too complex.
Created flutter/flutter#87287 to refactor.
| } | ||
| break; | ||
| } | ||
| case BuilderType.firebaselab: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this pr, Do we want to file mark flaky pr for firebaselab test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about that, but i guess we still want to have ownership for those tests.
chunhtai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
|
||
| for (final String line in lines) { | ||
| final List<String> words = line.trim().split(' '); | ||
| // e.g. words = ['/xxx/xxx/xxx_test.dart', '@stuartmorgan' '@flutter/tool'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This does not seem like a good example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as this is not necessary here.
This PR uses cocoon's existing functionality to obtain ownership data based on builder configs defined in .ci.yaml, and creates a support to validate test ownership.
This PR also adds support for
Firebaselab tests.A companion recipe change: https://flutter-review.googlesource.com/c/recipes/+/16300.
This is part of flutter/flutter#87144