Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[S] Change in dart/sdk[main]: [dart2wasm, infra] Add dart2wasm minify test configuration

0 views
Skip to first unread message

Ömer Ağacan (Gerrit)

unread,
Mar 14, 2025, 11:46:20 AMMar 14
to Martin Kustermann, rev...@dartlang.org
Attention needed from Martin Kustermann

Ömer Ağacan added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Ömer Ağacan . unresolved

@kuste...@google.com this adds a test configuration with `--minify`. We want to test with and without `--minify`, but I'm not sure how useful this test configuration is on its own as a lot of tests fail with it. Thoughts on how to best test `--minify`?

Open in Gerrit

Related details

Attention is currently required from:
  • Martin Kustermann
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Gerrit-Change-Number: 415583
Gerrit-PatchSet: 1
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Attention: Martin Kustermann <kuste...@google.com>
Gerrit-Comment-Date: Fri, 14 Mar 2025 15:46:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Martin Kustermann (Gerrit)

unread,
Mar 17, 2025, 4:08:18 AMMar 17
to Ömer Ağacan, rev...@dartlang.org
Attention needed from Ömer Ağacan

Martin Kustermann voted and added 1 comment

Votes added by Martin Kustermann

Code-Review+1

1 comment

Patchset-level comments
Ömer Ağacan . unresolved

@kuste...@google.com this adds a test configuration with `--minify`. We want to test with and without `--minify`, but I'm not sure how useful this test configuration is on its own as a lot of tests fail with it. Thoughts on how to best test `--minify`?

Martin Kustermann

As mentioned before, individual tests can opt into `--minify` via `// dart2wasmOptions=...` mechanism.

It would be even better to test all tests in that mode, but naturally some tests will actually depend on `<obj>.runtimeType.toString()` / etc

So the way this should be handled is that the test itself has to be made aware of minification mode and it can skip the test or test something else in minified mode.

The mechanism we have for this is

```
import 'package:expect/variations.dart' show readableTypeStrings, ...;

main() {
if (!readableTypeStrings) return;

// code that relies on `<obj>.runtimeType.toString()`
}
```

Some tests don't use this mechanism yet, so we'd need to update those tests (e.g. dart2wasm only tests, all tests that run under dart2js are probably already using this mechanism)

=> We have to update the `pkg/expect/lib/variations.dart` getters to work with dart2wasm. Currenlty they are e.g.

```
bool get readableTypeStrings
=> !const bool.fromEnvironment('dart.tool.dart2js.minify');
```

Then make the compiler define those environment variables.

But since this CL only adds the configuration and not the actual CI builder to run tests, we can land the CL as is.

A following CL can do the changes mentioned above and then we can add a CI builder (or change an existing one to run in minified mode)

Open in Gerrit

Related details

Attention is currently required from:
  • Ömer Ağacan
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Gerrit-Change-Number: 415583
Gerrit-PatchSet: 1
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Attention: Ömer Ağacan <ome...@google.com>
Gerrit-Comment-Date: Mon, 17 Mar 2025 08:08:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Ömer Ağacan <ome...@google.com>
satisfied_requirement
open
diffy

Ömer Ağacan (Gerrit)

unread,
Mar 17, 2025, 10:25:58 AMMar 17
to Martin Kustermann, rev...@dartlang.org
Attention needed from Martin Kustermann

Ömer Ağacan added 1 comment

Patchset-level comments
Ömer Ağacan . unresolved

@kuste...@google.com this adds a test configuration with `--minify`. We want to test with and without `--minify`, but I'm not sure how useful this test configuration is on its own as a lot of tests fail with it. Thoughts on how to best test `--minify`?

Martin Kustermann

As mentioned before, individual tests can opt into `--minify` via `// dart2wasmOptions=...` mechanism.

It would be even better to test all tests in that mode, but naturally some tests will actually depend on `<obj>.runtimeType.toString()` / etc

So the way this should be handled is that the test itself has to be made aware of minification mode and it can skip the test or test something else in minified mode.

The mechanism we have for this is

```
import 'package:expect/variations.dart' show readableTypeStrings, ...;

main() {
if (!readableTypeStrings) return;

// code that relies on `<obj>.runtimeType.toString()`
}
```

Some tests don't use this mechanism yet, so we'd need to update those tests (e.g. dart2wasm only tests, all tests that run under dart2js are probably already using this mechanism)

=> We have to update the `pkg/expect/lib/variations.dart` getters to work with dart2wasm. Currenlty they are e.g.

```
bool get readableTypeStrings
=> !const bool.fromEnvironment('dart.tool.dart2js.minify');
```

Then make the compiler define those environment variables.

But since this CL only adds the configuration and not the actual CI builder to run tests, we can land the CL as is.

A following CL can do the changes mentioned above and then we can add a CI builder (or change an existing one to run in minified mode)

Ömer Ağacan

Instead of `variations` we could also use status files to skip tests when minimized. `TestConfiguration` already has a field for it: https://github.com/dart-lang/sdk/blob/6c81b537c08b540b11d3b82c7ee202b774e5d6c9/pkg/test_runner/lib/src/configuration.dart#L121 we could expose it as a variable in status files.

It's confusing that some of the compile-time features are in test configuration and can be checked in status files, while others are checked in compile-time via the `variations` library. If I want to add another test configuration check like minification how do I decide which one to add the check for it?

Open in Gerrit

Related details

Attention is currently required from:
  • Martin Kustermann
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Gerrit-Change-Number: 415583
Gerrit-PatchSet: 1
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Attention: Martin Kustermann <kuste...@google.com>
Gerrit-Comment-Date: Mon, 17 Mar 2025 14:25:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
Comment-In-Reply-To: Ömer Ağacan <ome...@google.com>
satisfied_requirement
open
diffy

Martin Kustermann (Gerrit)

unread,
Mar 18, 2025, 4:20:18 AMMar 18
to Ömer Ağacan, rev...@dartlang.org
Attention needed from Ömer Ağacan

Martin Kustermann added 1 comment

Patchset-level comments
Ömer Ağacan . unresolved

@kuste...@google.com this adds a test configuration with `--minify`. We want to test with and without `--minify`, but I'm not sure how useful this test configuration is on its own as a lot of tests fail with it. Thoughts on how to best test `--minify`?

Martin Kustermann

As mentioned before, individual tests can opt into `--minify` via `// dart2wasmOptions=...` mechanism.

It would be even better to test all tests in that mode, but naturally some tests will actually depend on `<obj>.runtimeType.toString()` / etc

So the way this should be handled is that the test itself has to be made aware of minification mode and it can skip the test or test something else in minified mode.

The mechanism we have for this is

```
import 'package:expect/variations.dart' show readableTypeStrings, ...;

main() {
if (!readableTypeStrings) return;

// code that relies on `<obj>.runtimeType.toString()`
}
```

Some tests don't use this mechanism yet, so we'd need to update those tests (e.g. dart2wasm only tests, all tests that run under dart2js are probably already using this mechanism)

=> We have to update the `pkg/expect/lib/variations.dart` getters to work with dart2wasm. Currenlty they are e.g.

```
bool get readableTypeStrings
=> !const bool.fromEnvironment('dart.tool.dart2js.minify');
```

Then make the compiler define those environment variables.

But since this CL only adds the configuration and not the actual CI builder to run tests, we can land the CL as is.

A following CL can do the changes mentioned above and then we can add a CI builder (or change an existing one to run in minified mode)

Ömer Ağacan

Instead of `variations` we could also use status files to skip tests when minimized. `TestConfiguration` already has a field for it: https://github.com/dart-lang/sdk/blob/6c81b537c08b540b11d3b82c7ee202b774e5d6c9/pkg/test_runner/lib/src/configuration.dart#L121 we could expose it as a variable in status files.

It's confusing that some of the compile-time features are in test configuration and can be checked in status files, while others are checked in compile-time via the `variations` library. If I want to add another test configuration check like minification how do I decide which one to add the check for it?

Martin Kustermann

Yes, theoretically one could use status files for it and yes there's already a `$minified` boolean (which may mean different things depending on backend). For some tests where the entire test depends on symbols maybe that makes sense to use status files.

Though often a test tests many things and only part of it is relying on symbols, in which case the `variations` approach works better as one can selectively disable one of the things a test is testing instead of the the entire test.

Generally I'd say we prefer `variations` over the status files.

Open in Gerrit

Related details

Attention is currently required from:
  • Ömer Ağacan
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Gerrit-Change-Number: 415583
Gerrit-PatchSet: 1
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Attention: Ömer Ağacan <ome...@google.com>
Gerrit-Comment-Date: Tue, 18 Mar 2025 08:20:13 +0000
satisfied_requirement
open
diffy

Ömer Ağacan (Gerrit)

unread,
Mar 19, 2025, 4:53:40 AMMar 19
to Martin Kustermann, rev...@dartlang.org

Ömer Ağacan voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Gerrit-Change-Number: 415583
Gerrit-PatchSet: 1
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
Gerrit-Comment-Date: Wed, 19 Mar 2025 08:53:35 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
Mar 19, 2025, 5:43:22 AMMar 19
to Ömer Ağacan, Martin Kustermann, rev...@dartlang.org

Commit Queue submitted the change

Change information

Commit message:
[dart2wasm, infra] Add dart2wasm minify test configuration
Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Reviewed-by: Martin Kustermann <kuste...@google.com>
Commit-Queue: Ömer Ağacan <ome...@google.com>
Files:
  • M tools/bots/test_matrix.json
Change size: S
Delta: 1 file changed, 11 insertions(+), 0 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Martin Kustermann
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4639bcad207b7832c6eb2f77a1751ebb03a84bbf
Gerrit-Change-Number: 415583
Gerrit-PatchSet: 2
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages