Skip to content
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

Enabled flutter_tools tests that were previously disabled on Windows. #13487

Closed
wants to merge 3 commits into from

Conversation

bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Dec 11, 2017

No description provided.

@goderbauer
Copy link
Member

There is also

// TODO(pq): enable when sky_shell is available
, which should probably be enabled.

@goderbauer
Copy link
Member

There is also #13486, which I am happy to drop if you want to include it into this one.

@tvolkert
Copy link
Contributor

dev/bots/test.dart should also remove the windows skip check.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

So close! :) appveyor is reporting one more test as failing. Can you take a look at that one?


import 'dart:io';

String sanitizePaths(String path) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a doc comment here?

Cache.flutterRoot = '../..';
return _testFile('trivial', missingDependencyTests, missingDependencyTests);
});
// TODO(bkonyi): These tests all throw exceptions with unicode characters used for formatting,
Copy link
Member

Choose a reason for hiding this comment

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

Can you mark them individually as skipped via [1]? That way, they'll get reported as skipped by the test runner. Also might be good to file an issue about this and attaching it to the TODO.

[1]

bool skip, // should default to `false`, but https://github.com/dart-lang/test/issues/545 doesn't allow this

Copy link
Contributor

Choose a reason for hiding this comment

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

to add to @goderbauer's comments: in general, please prefer using skip: ... rather than an if statement, because skipped tests count towards our technical debt, whereas if statements do not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, didn't realize that was a parameter. Will do.

@@ -284,25 +286,31 @@ void main() {
painter.getOffsetForCaret(const TextPosition(offset: 1, affinity: TextAffinity.upstream), Rect.zero),
const Offset(10.0, 0.0),
);

Offset offset = (Platform.isWindows) ? new Offset(7.0, 12.0) : new Offset(10.0, 10.0);
Copy link
Member

Choose a reason for hiding this comment

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

final for offset and const for Offset?

Copy link
Contributor

Choose a reason for hiding this comment

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

what is going on here? This seems extremely wrong. The Ahem font is exactly 1em square for every glyph. If this is not coming out as 10,10, then there's a real bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@goderbauer, using const for Offset doesn't seem to work since Platform.isWindows isn't const.

@Hixie, I'm not 100% sure as I'm not familiar with this code. However, I was running into issues with Windows rendering fonts differently than other platforms which broke tests that were looking for specific pixel values, so I assumed that was the case here.

Copy link
Member

Choose a reason for hiding this comment

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

This is what I meant, this doesn't work?

final Offset offset = (Platform.isWindows) ? const Offset(7.0, 12.0) : const Offset(10.0, 10.0);

Copy link
Contributor

Choose a reason for hiding this comment

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

The analyzer won't let you do anything but what @goderbauer suggests. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, I'll have to check again... I might have been trying something like this:

const Offset offset = (Platform.isWindows) ? const Offset(...) : const Offset(...);

);

TextBox textBox = (Platform.isWindows) ?
Copy link
Member

Choose a reason for hiding this comment

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

final for textBox - and does TextBox have a const constructor that could be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using const for TextBox doesn't seem to work since Platform.isWindows isn't const.

expect(rotationTween.lerp(0.0), equals(a));
expect(rotationTween.lerp(1.0), equals(c));
expect(rotationTween.lerp(0.0).absoluteError(a), moreOrLessEquals(0.0));
expect(rotationTween.lerp(1.0).absoluteError(c), moreOrLessEquals(0.0));
Copy link
Contributor

Choose a reason for hiding this comment

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

why does this differ on windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was some issues with floating point errors on Windows (differences on the magnitude of 1e-16 for individual entries in the matrix) which was causing the equals check to fail. I'm actually surprised the original worked consistently before, since testing floats for equality is just asking for trouble.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's really weird that Mac and Linux would be consistent here but Windows would not. I think this points to a bug somewhere. I don't think we should check this in without better understanding what's going on.

Maybe a compiler somewhere is ordering the multiplications differently or something?

@@ -5,11 +5,13 @@
import 'package:flutter/foundation.dart';
import 'package:test/test.dart';

import 'platform_utils.dart';

void main() {
// TODO(8128): These tests and the filtering mechanism should be revisited to account for causal async stack traces.
Copy link
Contributor

Choose a reason for hiding this comment

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

please while you're here fix this TODO to be the right syntax ("TODO(username): description, https://bug/url")

);

TextBox textBox = (Platform.isWindows) ?
new TextBox.fromLTRBD(0.0, 12.0, 7.0, 22.0, TextDirection.rtl) :
new TextBox.fromLTRBD(0.0, 10.0, 10.0, 20.0, TextDirection.rtl);
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

expect(boxes.any((ui.TextBox box) =>
Platform.isWindows ?
box.right == 100 && box.top == 13 :
box.right == 100 && box.top == 10), isTrue);
Copy link
Contributor

Choose a reason for hiding this comment

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

this also seems wrong

@Hixie
Copy link
Contributor

Hixie commented Dec 15, 2017

@Hixie, I'm not 100% sure as I'm not familiar with this code. However, I was running into issues with Windows rendering fonts differently than other platforms which broke tests that were looking for specific pixel values, so I assumed that was the case here.

The font we use for all the tests is a special font that has extremely specific and well-defined metrics and so any variation you see is probably a bug. The tests that test font metrics should not be any different on different platforms.

@Hixie
Copy link
Contributor

Hixie commented Dec 15, 2017

(My guess given the values I see is that maybe you're not properly loading the Ahem font on Windows? It looks from the metrics as if you're getting Arial instead.)

@bkonyi
Copy link
Contributor Author

bkonyi commented Dec 15, 2017

@Hixie, that's good to know. Is there any way to verify the right font is being loaded? Also, would it be worth filing an issue and disabling these tests on Windows in the meantime? That way at least most of the tests will be running on Windows while we investigate your concerns above instead of having no tests running on Windows at all.

@Hixie
Copy link
Contributor

Hixie commented Dec 15, 2017

@Hixie, that's good to know. Is there any way to verify the right font is being loaded?

If you can render anything, you'll be easily able to tell because the Ahem font makes all ASCII characters look like filled squares.

If you can't render anything, it'll be easy to tell by measuring metrics. All ASCII glyphs in Ahem have a height and width equal to the font size.

Also, would it be worth filing an issue and disabling these tests on Windows in the meantime? That way at least most of the tests will be running on Windows while we investigate your concerns above instead of having no tests running on Windows at all.

Sure.

@@ -189,7 +191,8 @@ void main() {
expect(paragraph.size.height, 20.0);

layoutAt(3);
expect(paragraph.size.height, 30.0);
height = (Platform.isWindows) ? 34.0 : 30.0;
expect(paragraph.size.height, height);
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you missed these when switching to skipping tests instead

@Hixie
Copy link
Contributor

Hixie commented Dec 21, 2017

LGTM

path = path.replaceAll(new RegExp('\\\\'), '/');
}
return path;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add newline at end of file

import 'dart:io';

/// Replaces Windows-style path separators with Unix-style separators.
String sanitizePaths(String path) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This name left me wondering what it was doing (and thinking that it was weird to map windows-style to unix-style when you're on Windows). Maybe call this something like toPosixPath?

@Hixie
Copy link
Contributor

Hixie commented Jan 3, 2018

@bkonyi Is this PR still on your radar?

@bkonyi
Copy link
Contributor Author

bkonyi commented Jan 4, 2018

@Hixie yes it is, but I've had to put it off until next week since I'm traveling (working on a remote Windows machine is painful :( ...). I'm investigating why we're hitting the timeout on Appveyor to see if there's any performance gains to be made.

@kostaa
Copy link

kostaa commented Jan 14, 2018

If I understand correctly this PR will enable running Flutter tests on Windows.
It would be great help for those of us who develop on Windows.
Is there an ETA for this?

@bkonyi
Copy link
Contributor Author

bkonyi commented Jan 16, 2018

@kostaa this PR is to enable running our Flutter tests on our build infrastructure, but you should be able to run flutter test on Windows to test your own applications since that was enabled sometime last month.

@Hixie
Copy link
Contributor

Hixie commented Jan 17, 2018

We are now running tests on Windows (as a result of a series of other mostly unrelated PRs that happened to make things work on Windows). This PR may be obsolete.

franciscojma86 pushed a commit that referenced this pull request Feb 13, 2020
* f49a8b6 Roll src/third_party/skia c03e6982f96f..465864cad5d2 (14 commits) (flutter/engine#16524)

* c477c06 Enable verbose logging for shell unittests on Fuchsia (flutter/engine#16526)

* a662579 Clear frame references at the end of every CanvasKit frame (flutter/engine#16525)

* 3f31ea3 Roll src/third_party/skia 465864cad5d2..21f382c19d76 (6 commits) (flutter/engine#16528)

* 38fb6b1 Roll fuchsia/sdk/core/linux-amd64 from 8L7NY... to Bmq1m... (flutter/engine#16529)

* 9c0168a Roll fuchsia/sdk/core/mac-amd64 from PMcw3... to 7JkB7... (flutter/engine#16530)

* e8a888d Roll src/third_party/skia 21f382c19d76..f83d0346c06a (2 commits) (flutter/engine#16532)

* 1e8b331 Roll src/third_party/dart 5244d99a5d4e..5fc031ebc1d7 (42 commits) (flutter/engine#16533)

* c4e3ae6 Roll src/third_party/skia f83d0346c06a..88c3793a4eaa (1 commits) (flutter/engine#16534)

* 6cdb14e Roll src/third_party/skia 88c3793a4eaa..abefc9c170c9 (1 commits) (flutter/engine#16535)

* 975acd8 Roll src/third_party/skia abefc9c170c9..4fe89b4d871d (2 commits) (flutter/engine#16536)

* b7424d0 Roll src/third_party/dart 5fc031ebc1d7..30151a654151 (2 commits) (flutter/engine#16537)

* 25e8127 Roll src/third_party/skia 4fe89b4d871d..dc2782c380f6 (1 commits) (flutter/engine#16538)

* 74fa10c Roll src/third_party/dart 30151a654151..76b18c455e2c (1 commits) (flutter/engine#16539)

* 91b8e40 Roll src/third_party/skia dc2782c380f6..cdf2491afa04 (1 commits) (flutter/engine#16540)

* 5acf9b1 Roll src/third_party/skia cdf2491afa04..50a490a1a4fb (2 commits) (flutter/engine#16541)

* 9897777 Roll src/third_party/skia 50a490a1a4fb..c3b67eb988c8 (4 commits) (flutter/engine#16542)

* 78a8909 Use os_log instead of syslog on Apple platforms (flutter/engine#13487)

* ea56ad2 libtxt: use a fixture in the benchmarks (flutter/engine#16531)

* a61dbf2 Revert "Use os_log instead of syslog on Apple platforms (#13487)" (flutter/engine#16546)

* 539f64f [fuchsia] Disable retained layers (flutter/engine#16548)

* c3b5072 Expose DPI helper functions for Runner apps to use (flutter/engine#16313)

* 5041ff1 support endless trace buffer (flutter/engine#16520)

* 6aacf5e Re-land: Use os_log instead of syslog on Apple platforms (flutter/engine#16549)

* a5736b8 Roll src/third_party/skia c3b67eb988c8..b1525c721ea6 (4 commits) (flutter/engine#16543)

* 49a370f Roll src/third_party/dart 76b18c455e2c..e4c39721c473 (6 commits) (flutter/engine#16544)

* 270421c Fix ensureInitializationCompleteAsync callback when already initialized. (#39675) (flutter/engine#16503)

* ca02b91 Prevent long flash when switching to Flutter app. (#47903) (flutter/engine#16527)

* 44e80fd skiping tests in Safari. LUCI recipe for Mac is ready. this is the only step left for stopping us running unit tests in Safari (flutter/engine#16550)

* 5fb0116 iOS platform view gesture blocking policy. (flutter/engine#15940)

* e0ebaea Revert "Re-land: Use os_log instead of syslog on Apple platforms (#16549)" (flutter/engine#16558)
dnfield pushed a commit that referenced this pull request Feb 14, 2020
* f49a8b6 Roll src/third_party/skia c03e6982f96f..465864cad5d2 (14 commits) (flutter/engine#16524)

* c477c06 Enable verbose logging for shell unittests on Fuchsia (flutter/engine#16526)

* a662579 Clear frame references at the end of every CanvasKit frame (flutter/engine#16525)

* 3f31ea3 Roll src/third_party/skia 465864cad5d2..21f382c19d76 (6 commits) (flutter/engine#16528)

* 38fb6b1 Roll fuchsia/sdk/core/linux-amd64 from 8L7NY... to Bmq1m... (flutter/engine#16529)

* 9c0168a Roll fuchsia/sdk/core/mac-amd64 from PMcw3... to 7JkB7... (flutter/engine#16530)

* e8a888d Roll src/third_party/skia 21f382c19d76..f83d0346c06a (2 commits) (flutter/engine#16532)

* 1e8b331 Roll src/third_party/dart 5244d99a5d4e..5fc031ebc1d7 (42 commits) (flutter/engine#16533)

* c4e3ae6 Roll src/third_party/skia f83d0346c06a..88c3793a4eaa (1 commits) (flutter/engine#16534)

* 6cdb14e Roll src/third_party/skia 88c3793a4eaa..abefc9c170c9 (1 commits) (flutter/engine#16535)

* 975acd8 Roll src/third_party/skia abefc9c170c9..4fe89b4d871d (2 commits) (flutter/engine#16536)

* b7424d0 Roll src/third_party/dart 5fc031ebc1d7..30151a654151 (2 commits) (flutter/engine#16537)

* 25e8127 Roll src/third_party/skia 4fe89b4d871d..dc2782c380f6 (1 commits) (flutter/engine#16538)

* 74fa10c Roll src/third_party/dart 30151a654151..76b18c455e2c (1 commits) (flutter/engine#16539)

* 91b8e40 Roll src/third_party/skia dc2782c380f6..cdf2491afa04 (1 commits) (flutter/engine#16540)

* 5acf9b1 Roll src/third_party/skia cdf2491afa04..50a490a1a4fb (2 commits) (flutter/engine#16541)

* 9897777 Roll src/third_party/skia 50a490a1a4fb..c3b67eb988c8 (4 commits) (flutter/engine#16542)

* 78a8909 Use os_log instead of syslog on Apple platforms (flutter/engine#13487)

* ea56ad2 libtxt: use a fixture in the benchmarks (flutter/engine#16531)

* a61dbf2 Revert "Use os_log instead of syslog on Apple platforms (#13487)" (flutter/engine#16546)

* 539f64f [fuchsia] Disable retained layers (flutter/engine#16548)

* c3b5072 Expose DPI helper functions for Runner apps to use (flutter/engine#16313)

* 5041ff1 support endless trace buffer (flutter/engine#16520)

* 6aacf5e Re-land: Use os_log instead of syslog on Apple platforms (flutter/engine#16549)

* a5736b8 Roll src/third_party/skia c3b67eb988c8..b1525c721ea6 (4 commits) (flutter/engine#16543)

* 49a370f Roll src/third_party/dart 76b18c455e2c..e4c39721c473 (6 commits) (flutter/engine#16544)

* 270421c Fix ensureInitializationCompleteAsync callback when already initialized. (#39675) (flutter/engine#16503)

* ca02b91 Prevent long flash when switching to Flutter app. (#47903) (flutter/engine#16527)

* 44e80fd skiping tests in Safari. LUCI recipe for Mac is ready. this is the only step left for stopping us running unit tests in Safari (flutter/engine#16550)

* 5fb0116 iOS platform view gesture blocking policy. (flutter/engine#15940)

* e0ebaea Revert "Re-land: Use os_log instead of syslog on Apple platforms (#16549)" (flutter/engine#16558)

* 8a6b949 [Fuchsia] Dump syslog output after tests have run (flutter/engine#16561)

* bca879c Roll src/third_party/dart e4c39721c473..0299903f3e78 (31 commits) (flutter/engine#16553)

* cd11d7a Roll fuchsia/sdk/core/mac-amd64 from 7JkB7... to t4kck... (flutter/engine#16555)

* 99a265b [web] Fix edge cases in Paragraph.getPositionForOffset to match Flutter (flutter/engine#16557)

* 8f8af1f Update felt documentation (flutter/engine#16559)

* 13dce50 Roll src/third_party/skia b1525c721ea6..67da665c27ff (32 commits) (flutter/engine#16562)

* 7c67573 Fix multiline Javadoc code blocks (flutter/engine#16565)

* aece5ad Move log_listener call into the reboot trap (flutter/engine#16564)

* 42f18d9 Roll src/third_party/skia 67da665c27ff..886e8500a9f2 (3 commits) (flutter/engine#16566)

* c4c6ef6 Samsung keyboard duplication workaround: updateSelection (flutter/engine#16547)

* 15062ca Revert "Re-arm timer as necessary in MessageLoopFuchsia" (flutter/engine#16568)

* 8802a1d Roll src/third_party/skia 886e8500a9f2..9102c86a81ad (1 commits) (flutter/engine#16570)

* dbdcae4 Roll src/third_party/skia 9102c86a81ad..6029cbd560b7 (2 commits) (flutter/engine#16575)

* f39bc73 Exposes FlutterSurfaceView, and FlutterTextureView to FlutterActivity and FlutterFragment. (#41984, #47557) (flutter/engine#16552)

* db030ec Roll src/third_party/skia 6029cbd560b7..1a733b5b760a (1 commits) (flutter/engine#16577)

* 050d29d Roll src/third_party/skia 1a733b5b760a..1d1333fcedf8 (3 commits) (flutter/engine#16578)

* 97fd898 Roll fuchsia/sdk/core/mac-amd64 from t4kck... to oHa-O... (flutter/engine#16581)

* 2e67866 Roll src/third_party/skia 1d1333fcedf8..3bf3b92dfab0 (1 commits) (flutter/engine#16584)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants