Commit Graph

23 Commits

Author SHA1 Message Date
Konstantin Shcheglov f8b363a335 CQ. Format test_runner/
Change-Id: I24016d9a827e0506b2d5a6b6eed3356afaf90dbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500602
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-04 18:23:32 -07:00
Liam Appelbe be63e3f2b0 Reapply "[test_runner] Improve timeout deflaking"
The fix is in https://dart-review.googlesource.com/c/sdk/+/441460/1..2

The issue was that the TestConfiguration.selectors field was set
incorrectly, because _expandSelectors was still reading
configuration['test-list-contents'] without accounting for the format
changes. It just needs the test name list, so the fix is to pass in
the already parsed testList variable.

Example build: https://ci.chromium.org/ui/p/dart/builders/try/vm-aot-linux-release-x64-try/7213/overview
compare_results output: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8708774547991696017/+/u/deflaking/list_tests_to_deflake__vm_tests_/raw_io.output_text
Deflaking run flags: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8708774547991696017/+/u/deflaking/vm_tests/l_execution_details
Deflaking run output: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8708774547991696017/+/u/deflaking/vm_tests/stdout

This reverts commit cc5f351c34.

TEST=CI
Bug: https://github.com/dart-lang/sdk/issues/55044
Change-Id: Ie9ff1ba71f44ade7b4cd1c9b2f75b9efc1dee24a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441460
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-07-28 14:53:18 -07:00
Liam Appelbe cc5f351c34 Revert "[test_runner] Improve timeout deflaking"
This reverts commit f95a84da5c.

Reason for revert: Testing if CL caused increased meta-flakiness of non-timeout failures.

Bug: https://github.com/dart-lang/sdk/issues/55044
Original change's description:
> [test_runner] Improve timeout deflaking
>
> The usual deflaking logic is to simply rerun the test 5 times, but if the failure was a timeout this can be very expensive. Instead, only rerun timeout failures twice, and use the last successful run time to set a tighter timeout.
>
> Repeat counts and timeouts are now per-test. The name, repeat count, and timeout make a `DeflakeInfo`. This object is constructed in compare_results.dart, and passed to test.py's `--tests` flag. The recipe was already passing the output of compare_results directly to that flag, so no change is needed to the recipies.
>
> Backwards compatibility:
>
> If you want the old behavior of compare_results.dart, use the `--name-only` flag.
>
> test.py only uses this new logic if it detects that the `--tests` flag is JSON (if it starts with a `{`).
>
> Change-Id: I4113b68c54bfb7fd9a5e8fc9dab7a265807f3e77
> Bug: https://github.com/dart-lang/sdk/issues/55044
> Fixes: https://github.com/dart-lang/sdk/issues/55044
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435760
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Bug: https://github.com/dart-lang/sdk/issues/55044
Change-Id: I68268dcaffbe857ccec20e211c34325c03643b37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439180
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2025-07-07 16:15:51 -07:00
Liam Appelbe f95a84da5c [test_runner] Improve timeout deflaking
The usual deflaking logic is to simply rerun the test 5 times, but if the failure was a timeout this can be very expensive. Instead, only rerun timeout failures twice, and use the last successful run time to set a tighter timeout.

Repeat counts and timeouts are now per-test. The name, repeat count, and timeout make a `DeflakeInfo`. This object is constructed in compare_results.dart, and passed to test.py's `--tests` flag. The recipe was already passing the output of compare_results directly to that flag, so no change is needed to the recipies.

Backwards compatibility:

If you want the old behavior of compare_results.dart, use the `--name-only` flag.

test.py only uses this new logic if it detects that the `--tests` flag is JSON (if it starts with a `{`).

Change-Id: I4113b68c54bfb7fd9a5e8fc9dab7a265807f3e77
Bug: https://github.com/dart-lang/sdk/issues/55044
Fixes: https://github.com/dart-lang/sdk/issues/55044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435760
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-06-22 21:19:35 -07:00
Devon Carew 79b52401f2 Update various packages based on diagnostics from strict_top_level_inference.
Change-Id: I032d10fd1956b62a9e45ceee9ca2b28c9863d1ce
Tested: diagnostic updates only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401560
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2024-12-19 08:23:51 -08:00
Devon Carew e2fe203adc [deps] roll package:lints to the latest
Change-Id: I582f956cd4b712203c2f6dd630b4e1384040446d
Tested: analysis clean (this is a lint only related change)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329400
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-10-05 03:36:59 +00:00
Alexander Thomas 9394b30b77 Fix incorrect file reference in license headers
Bug: b/286184681
Change-Id: I903528c4adfbc576644aec7541903df6b9633e26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325523
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-18 06:44:08 +00:00
Alexander Thomas 0b26f4816b [testing] Remove --compiler=none from test.py
* Use dartk as the default compiler for runtime=vm.
* Status file entries for checking for the `none` compiler now either
  use dartk or are deleted.

Tested: Standard CQ and local testing.
Fixes: https://github.com/dart-lang/sdk/issues/50241
Change-Id: I7a08d3e491ae1c82a0348fb66ea7b557398f97e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264682
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-10-19 08:09:58 +00:00
Ömer Sinan Ağacan 293b6379b8 [infra] Avoid crash in test_runner.dart --help
`testConfigurations` expects at least one configuration, so avoid
calling it when there are no configurations.

This fixes the unhandled exception with `test_runner.dart --help`:

```
No build targets found.
Unhandled exception:
RangeError (index): Invalid value: Valid value range is empty: 0
<asynchronous suspension>
```

With this commit, `--help` just prints "No build targets found" and
exits with 0.

This crash was previously fixed in
02a0396f74.

Change-Id: Id82c83f66871c4e811a7502f1e831a0592db2065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257580
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2022-09-07 07:44:37 +00:00
Alexander Thomas a2d2d693dc [infra] Migrate test_runner to null safety
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm64c-try
Fixes: b/232495224
Change-Id: I0338db48c0cc89ec35d52bff2f508105e80c3538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248008
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2022-06-15 15:51:58 +00:00
Alexander Thomas 526d85ad79 [testing] Remove vendored args package
The vendored package was just used in some tooling that should be easy
to update to any breaking changes in args. Language versioning ensures
we can handle changes in the language as well.

Bug: b/232495224
Change-Id: I15223187f19b6fe2229dd4ac05e51fd794cbfbd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244627
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2022-05-13 17:15:46 +00:00
Alexander Thomas 11a6820f7c [infra] Use safaridriver to launch Safari
For some reason, we launched Safari from a file, which since macOS 10.14
requires the user to confirm the operation in a modal dialog which
caused timeouts.

* Removed unused http test driver port option.
* Added some basic tests for test.py's browser interactions.

Bug: b/208186791
Change-Id: I070529148d37bf312f219c576abca3da972f73e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204202
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-04-29 08:57:41 +00:00
Clement Skau 1320e644d5 [infra] Make test.py --build fail fast.
Currently, running `test.py --build` will attempt to build
the necessary files, before running the tests specified.
However, the tests are run even if this build fails, which
usually means old build artefacts are used for running the tests.
This can lead to some very confusing results if you do not yourself
catch that the build failed half-way through the run.

This change makes `test.py` exit with an error code and a message,
and does not proceed with the tests, if the build fails.

TEST=Manual testing locally.
Change-Id: I4e0f1d3f8d695219f2e4c0d7b474542af136aca9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241740
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2022-04-20 13:55:58 +00:00
Alexander Thomas b846a20e26 [testing] Detect test failures caused by test expectation changes
* Move compare_results.dart to pkg/test_runner.
* Clean up analyzer issues in compare_results.dart.
* Add a test for compare_results.dart.
* Fix compare and extend results to detect expectation changes.

Change-Id: I451ddc2d0b01a7e5fd7c9d791b000c786c2f2c93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214805
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-09-29 13:07:19 +00:00
pq a6e3008ded fix sort_directives violations
See: https://dart-review.googlesource.com/c/sdk/+/196026

TEST=Code cleanup exclusively (sorting imports); no new tests.


Change-Id: Ib07a82ff418138c542d6a83cfab9aabbb285f866
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196180
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-04-20 22:21:28 +00:00
Sam Rawlins a75fdd4d98 Remove unnecessary imports from analyzer_plugin, analysis_server, analyzer_cli, test_runner
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I52753bf0ac8112e0a2e6864ca2bd3289e63d5cf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-04-08 19:02:31 +00:00
Robert Nystrom 02a0396f74 Don't crash on --help, --find-configurations, or --list-configurations.
Change-Id: Ib774469489d9acfae7aa35fc75f00189b25a8161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192952
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-03-30 00:20:54 +00:00
Srujan Gaddam 774b80f2d3 [pkg:test_runner] Replace space from test config name
https://dart-review.googlesource.com/c/sdk/+/181404 disallows spaces
in Configurations.

Change-Id: I0582eca064bd6d88ebcbbf411e44a6147895148c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184902
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-02-13 21:35:39 +00:00
William Hesse d03b7e31f5 Add --build flag to test.py and test.dart
This flag causes test.py and test.dart to (re)build the necessary
build targets locally to run the selected configurations.

Change-Id: I526de702ac0eb8269c91d0be3673af096c94c1f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170822
Reviewed-by: Alexander Thomas <athom@google.com>
2020-11-12 11:19:38 +00:00
Jacob MacDonald 6f620781c9 delete packageRoot support in test runner package, migrate to package_config from package_resolver
Not sure what might be relying on this - going to check what the bots think about it :D

Bug: https://github.com/dart-lang/package_resolver/issues/30
Change-Id: I283d60d749a3db8a4e02dfdb1889ce56c8630620
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138324
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-04 20:15:19 +00:00
Robert Nystrom 3f7805a90e Make the NNBD command-line options less, uh, half-baked.
- Better name than "optedIn".
- Actually hook up the command-line option to the configuration.
- Add tests, which would have caught the previous mistake.
- Don't allow comma-separated values for "--progress" and "--nnbd".
- Remove unused dead "--strong" option.

Change-Id: I57d7cb0d81af50d662dcf3f7f4c9ca1f2b102f2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116544
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-10 22:39:19 +00:00
Robert Nystrom c1b56a9ea0 Catch the test_runner codebase up to somewhat modern practices.
- Run dartfmt --fix. This converts JavaDoc comments to "///", removes
  "new" and extraneous "const", and a couple of other things.
- Fix SCREAMING_CAPS constants to lowerCamelCase.
- Use collection literals where possible.
- Use UI-as-code in a couple of places where it seemed obvious.
- Use "var" for more local variables.
- Use "const" instead of "final" when possible.
- Make members private when possible. Deleted a few that then became
  obviously unused.
- ".length > 0" -> ".isNotEmpty".

There are no meaningful changes.

Change-Id: Ic6c5a74b2af9b3ebcbe881dbed69f65488bdef09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105880
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-06-15 01:02:50 +00:00
Robert Nystrom 99e8a9fba5 Move the test runner (i.e. "test.dart"/"test.py") to pkg/.
This makes it an actual Pub package like most other code inside the SDK
repo. The main goal is to make it easier to write tests for the test
runner itself.

This change:

- Moves all of the code from tools/testing/dart/ over to
  pkg/test_runner. Most of it ends up under test_runner/lib/src.

- Move tools/testing/dart/main.dart to
  pkg/test_runner/bin/test_runner.dart.

- Move standalone_2/io/test_runner_test.dart to
  pkg/test_runner/test/test_runner_test.dart. I don't think it currently
  works, but it wasn't being run in its old location either.

- Add test_runner to the analysis-server bot. This ensures the
  test_runner package is static error clean.

- Remove standalone_2/io/test_runner_analyze_test.dart which used to
  attempt to do the above and is no longer needed.

- Update test.py to look for the test runner at its new location.

- Add test_runner to the repo .packages file and remove the weird
  test_dart pseudo-package. (I think this fixes #35279.)

- Remove status file entries for the removed standalone_2 tests.

There are no code changes to the test runner itself aside from fixing
up import paths.

Change-Id: I3d05d50d222b291848fa5a30de2846e803bc81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105821
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-06-14 23:35:10 +00:00