-
Notifications
You must be signed in to change notification settings - Fork 6k
Run integration tests on luci, use cipd package for Chrome #18180
Conversation
| void _runDriver(String workingDirectory) async { | ||
| startProcess('./chromedriver/chromedriver', ['--port=4444'], | ||
| workingDirectory: io.Directory.current.path); | ||
| workingDirectory: workingDirectory); |
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 think the method has a race condition. startProcess should return Future<io.Process> and here we should await for the process to be started. Otherwise, there's a chance that _runDriver returns without the process.
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 the implementation of the method. I thought it would await for the process and will add it to the cleanup list.
We are using this method since March: https://github.com/flutter/engine/pull/17190/files#diff-9e0e5a53a06c2f6ab3e0904639468ab6R110
final io.Process process = await io.Process.start(
executable,
arguments,
workingDirectory: workingDirectory,
// Running the process in a system shell for Windows. Otherwise
// the process is not able to get Dart from path.
runInShell: io.Platform.isWindows,
mode: io.ProcessStartMode.inheritStdio,
);
processesToCleanUp.add(process);
Please let me know if I'm missing something.
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'm not talking about clean-up. I'm talking about start-up race condition. The _startDriver method returns before the process is started because it swallows the Future returned by startProcess.
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 sent a conversation offline. Let's discuss if there is leak in the process. I can send another fix since the methods in utils.dart are used by other places. I can fix them all in one PR.
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.
As discussed the change was running without the Future (await'in on void) due to our analyze options: https://github.com/flutter/engine/blob/master/lib/web_ui/analysis_options.yaml#L30
| /// `chrome-linux`, `safari-macos` and `chrome-macos`. | ||
| /// | ||
| /// Note that integration tests are only running on chrome for now. | ||
| const Map<String, List<String>> blackListsMap = <String, List<String>>{ |
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.
Why not have the test file itself specify this, e.g. in a specially formatted comment? It's trivial to parse it out of the test's source code. This file is too removed from the test code to be an intuitive location for this list.
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.
Previously we discussed this. The consensus was to use the blacklists this way and not relying on the contents of the test files.
@mdebbar I think you mentioned that you also don't like the content/name checking on tests. Can you provide more feedback?
I don't have strong opinion. I lean slightly towards this approach, unless we have a lint checker that will detect validity of the comment. I don't like projects inventing their own programing languages/metatags.
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.
Well, a map that follows a particular structure and that contains strings that must follow certain format is already a language, even if it is embedded inside Dart. The issue is that in mere couple of hours after reviewing this PR I already forgot which file this list was defined in :)
I imagine most team members won't even know that this list exists. Typically, I look at other test code to learn how things are done, but that won't help me here because the blacklist is quite detached from the test code.
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.
My issue was with whitelist vs blacklist. I prefer blacklist because I want all new tests to be running everywhere by default.
I agree with Yegor that this is not an intuitive place for the blacklist because when I'm looking into a test, it's not obvious to me where the blacklist lives. That said, I also don't like having a pre-processing step that parses comments for specially formatted configuration.
I prefer solutions like the skip: argument in package:test. Can we have our own test function that takes an extra argument?
import '../our_test.dart';
test('my test', () {
// Test goes here ...
}, skipOn: ['chrome-linux', 'safari-macos', 'chrome-macos']);It can be defined like:
import 'package:test/test.dart' as package_test;
typedef TestBody = ...;
void test(String name, TestBody body, {List<String> skipOn}) {
final bool skip = skipOn.contains(_currentPlatformBrowser);
return package_test.test(name, body, skip: skip);
}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 was also talking to @yjbanov about luci.dart meanwhile. It looks like this would be the solution after luci.dart: yjbanov/luci.dart#3
Each integration test, will be added as a target. If we want them to run only on a MacOS bot with Safari we will setup the agent and browser.
To sum up the discussion this is summary I collected from our comments:
Test skip: (pros) easy to read. easy to use by the test developer. already existing syntax (cons) more time to add to the test harness.
comments: (cons) pre-processing step that may lead to other errors. (pros) Easy to add to the text harness. visible to the developer.
current suggestion: (cons)very easy to forget (pros) easy to add to the text harness.
I'll continue with this approach. I'll try implement either @yjbanov's or @mdebbar's suggestion if luci.dart is delayed/cancelled, otherwise it will solve this issue.
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 not yet count on luci.dart happening. I still need to sell parts of the team on it. For now, I would encourage us to do the most idiomatic solution within the current system. Having said that, my comment is not blocking. I feel like this will be a source paper cuts in the future, but nothing fatal.
mdebbar
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.
Looks good to me modulo Yegor's comments.
All the scattered isLuci checks are making me nervous, but I understand. It is what it is. I can't wait for us to be completely on LUCI.
I agree. We will remove isCirrus checks soon at least. IsLUCI will be with us due to local/LUCI differences. |
40c5d73 to
2d93212
Compare
…nt-test runs on LUCI
2d93212 to
9404277
Compare
…8180) * try to run integration tests on luci * adds extra logs to check if chrome is on lUCI * use the cipd chrome package for integration tests in LUCI * add driver version for chrome 83.(cipd package has 83 now) * no headless mode didn't worked on the bots. try the other option * On LUCI also use chrome driver as a cipd package * change the directory name to fit the cpid package * adding blacklist functionality * remove logs added for troubleshooting. remove the check that blocks int-test runs on LUCI * add more comments to blacklists * also use CIPD package chrome for unit tests * addressing reviewer comments * run integration tests first, upon reviewer request * fix bug. keep running integration tests after unit tests * update the logs for LUCI * fix todo comments
(1) Run Integration tests on LUCI
(2) Using Chrome from CIPD package both for Integration and Unit tests.
(3) Adds blacklist for failing tests and tests should not be run on Linux.
Related recipe change(MERGED): https://flutter-review.googlesource.com/c/recipes/+/2700
Fixes: flutter/flutter#52983
Contributes to: flutter/flutter#53179
This PR combined with the recipe change:https://ci.chromium.org/raw/build/logs.chromium.org/flutter/led/nurhan_google.com/258f50b81fc7d4e704effa8dadc1c8ae94637b402726cbbf03a83d205e397376/+/annotations?server=chromium-swarm.appspot.com