Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@nturgut
Copy link
Contributor

@nturgut nturgut commented May 6, 2020

(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

@nturgut nturgut added the Work in progress (WIP) Not ready (yet) for review! label May 6, 2020
@auto-assign auto-assign bot requested a review from cbracken May 6, 2020 22:16
@nturgut nturgut removed the request for review from cbracken May 6, 2020 22:16
@nturgut nturgut force-pushed the int_tests_on_luci branch from c8cc3cb to 8ce31c2 Compare May 7, 2020 04:31
@nturgut nturgut changed the title [draft] try to run integration tests on luci [do-not-merge] try to run integration tests on luci May 12, 2020
@nturgut nturgut removed the Work in progress (WIP) Not ready (yet) for review! label May 12, 2020
@nturgut nturgut requested review from mdebbar and yjbanov May 12, 2020 01:38
@nturgut nturgut changed the title [do-not-merge] try to run integration tests on luci [do-not-merge] run integration tests on luci May 12, 2020
@nturgut nturgut changed the title [do-not-merge] run integration tests on luci [do-not-merge] Run integration tests on luci, use cipd package for Chrome May 12, 2020
@nturgut nturgut changed the title [do-not-merge] Run integration tests on luci, use cipd package for Chrome Run integration tests on luci, use cipd package for Chrome May 12, 2020
void _runDriver(String workingDirectory) async {
startProcess('./chromedriver/chromedriver', ['--port=4444'],
workingDirectory: io.Directory.current.path);
workingDirectory: workingDirectory);
Copy link
Contributor

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.

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 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.

Copy link
Contributor

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.

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 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.

Copy link
Contributor Author

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>>{
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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);
}

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 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.

Copy link
Contributor

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.

Copy link
Contributor

@mdebbar mdebbar left a 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.

@nturgut
Copy link
Contributor Author

nturgut commented May 14, 2020

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.

@nturgut nturgut force-pushed the int_tests_on_luci branch from 40c5d73 to 2d93212 Compare May 15, 2020 03:14
@nturgut nturgut force-pushed the int_tests_on_luci branch from 2d93212 to 9404277 Compare May 15, 2020 17:51
@nturgut nturgut merged commit cb71dcd into flutter:master May 15, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 16, 2020
wandyers pushed a commit to wandyers/engine that referenced this pull request May 23, 2020
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] run integration tests on Cirrus and LUCI using felt.

4 participants