From 2cb82b89fe0d410db096d2569c8e606bc569c70a Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 2 May 2023 00:33:18 +0000 Subject: [PATCH 1/7] Remove the matcher export from test_api `package:test` exports directly from `package:matcher`. Resolves a cyclic dependency between `matcher` and `test_api`. --- pkgs/test_api/CHANGELOG.md | 5 +++++ pkgs/test_api/lib/expect.dart | 5 ----- pkgs/test_api/lib/src/expect/async_matcher.dart | 5 ----- pkgs/test_api/pubspec.yaml | 6 +----- 4 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 pkgs/test_api/lib/expect.dart delete mode 100644 pkgs/test_api/lib/src/expect/async_matcher.dart diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index ec38d0ca0..a215ecaf9 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.0-dev + +* Remove the `package:test_api/expect.dart' library. `test` will export from + `package:matcher` directly. + ## 0.5.2 * Remove deprecation for the `scaffolding.dart` and `backend.dart` libraries. diff --git a/pkgs/test_api/lib/expect.dart b/pkgs/test_api/lib/expect.dart deleted file mode 100644 index 5e62622fe..000000000 --- a/pkgs/test_api/lib/expect.dart +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -export 'package:matcher/expect.dart'; diff --git a/pkgs/test_api/lib/src/expect/async_matcher.dart b/pkgs/test_api/lib/src/expect/async_matcher.dart deleted file mode 100644 index 044c1924c..000000000 --- a/pkgs/test_api/lib/src/expect/async_matcher.dart +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -export 'package:matcher/src/expect/async_matcher.dart'; diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml index 91e0126ab..a1556c994 100644 --- a/pkgs/test_api/pubspec.yaml +++ b/pkgs/test_api/pubspec.yaml @@ -1,5 +1,5 @@ name: test_api -version: 0.5.2 +version: 0.6.0-dev description: >- The user facing API for structuring Dart tests and checking expectations. repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api @@ -18,10 +18,6 @@ dependencies: string_scanner: ^1.1.0 term_glyph: ^1.2.0 - # Use a tight version constraint to ensure that a constraint on matcher - # properly constrains all features it provides. - matcher: '>=0.12.15 <0.12.16' - dev_dependencies: analyzer: '>=2.1.0 <6.0.0' fake_async: ^1.2.0 From 0f98f67dccbea43d9328c876ab8cef9f7209c93c Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 2 May 2023 00:36:56 +0000 Subject: [PATCH 2/7] Fix up pubspecs, remove dep from test_core --- pkgs/test/pubspec.yaml | 4 ++-- pkgs/test_api/CHANGELOG.md | 2 +- pkgs/test_api/pubspec.yaml | 2 +- pkgs/test_core/pubspec.yaml | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 58cb29648..2677d40f5 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -32,8 +32,8 @@ dependencies: webkit_inspection_protocol: ^1.0.0 yaml: ^3.0.0 # Use an exact version until the test_api and test_core package are stable. - test_api: 0.5.2 - test_core: 0.5.2 + test_api: 0.6.0 + test_core: 0.5.3 # Use a tight version constraint to ensure that a constraint on matcher # properly constrains all features it provides. matcher: '>=0.12.15 <0.12.16' diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index a215ecaf9..091ccd13b 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.6.0-dev +## 0.6.0-wip * Remove the `package:test_api/expect.dart' library. `test` will export from `package:matcher` directly. diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml index a1556c994..84142f903 100644 --- a/pkgs/test_api/pubspec.yaml +++ b/pkgs/test_api/pubspec.yaml @@ -1,5 +1,5 @@ name: test_api -version: 0.6.0-dev +version: 0.6.0-wip description: >- The user facing API for structuring Dart tests and checking expectations. repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index 6cf8cb15e..2e5bb2a1b 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -27,10 +27,8 @@ dependencies: stream_channel: ^2.1.0 vm_service: ">=6.0.0 <12.0.0" yaml: ^3.0.0 - # matcher is tightly constrained by test_api - matcher: ^0.12.11 # Use an exact version until the test_api package is stable. - test_api: 0.5.2 + test_api: 0.6.0 dev_dependencies: lints: '>=1.0.0 <3.0.0' From 30afb9d73a91fbac13263fe7d9469056a89a57a4 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 2 May 2023 01:32:01 +0000 Subject: [PATCH 3/7] Expand matcher range, drop export of matcher from test_api library --- pkgs/test/pubspec.yaml | 2 +- pkgs/test_api/lib/test_api.dart | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 2677d40f5..25dda8551 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: test_core: 0.5.3 # Use a tight version constraint to ensure that a constraint on matcher # properly constrains all features it provides. - matcher: '>=0.12.15 <0.12.16' + matcher: '>=0.12.15 <0.12.17' dev_dependencies: fake_async: ^1.0.0 diff --git a/pkgs/test_api/lib/test_api.dart b/pkgs/test_api/lib/test_api.dart index 17a1ef433..7804cda5d 100644 --- a/pkgs/test_api/lib/test_api.dart +++ b/pkgs/test_api/lib/test_api.dart @@ -6,7 +6,5 @@ 'Please use package:test.') library test_api; -export 'package:matcher/expect.dart'; - export 'hooks.dart' show TestFailure; export 'scaffolding.dart'; From 9180d0ad587a01371666a3670afcbf2f66b02d77 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 2 May 2023 02:29:44 +0000 Subject: [PATCH 4/7] Remove redundant export --- pkgs/test_core/lib/test_core.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/test_core/lib/test_core.dart b/pkgs/test_core/lib/test_core.dart index 55c7a5051..01f44542c 100644 --- a/pkgs/test_core/lib/test_core.dart +++ b/pkgs/test_core/lib/test_core.dart @@ -7,7 +7,5 @@ library test_core; export 'package:test_api/hooks.dart' show TestFailure; -// Not yet deprecated, but not exposed through focused libraries. -export 'package:test_api/test_api.dart' show registerException; export 'scaffolding.dart'; From a37e6c3403c80b678815cac3902a218b20d926c0 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 2 May 2023 02:52:07 +0000 Subject: [PATCH 5/7] Override matcher dep Matcher will get published soon and the override will be removed --- pkgs/test_api/pubspec_overrides.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/test_api/pubspec_overrides.yaml b/pkgs/test_api/pubspec_overrides.yaml index bdb2cf470..ebec53f46 100644 --- a/pkgs/test_api/pubspec_overrides.yaml +++ b/pkgs/test_api/pubspec_overrides.yaml @@ -3,3 +3,7 @@ dependency_overrides: path: ../test test_core: path: ../test_core + matcher: + git: + url: https://github.com/dart-lang/matcher.git + ref: 3262428d5a701b514eb20ee27b3e02a92cde5761 From 9f20ea1791455d91daaca6641577d332582758f8 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 2 May 2023 04:09:00 +0000 Subject: [PATCH 6/7] Why are overrides not working? Try an explicit dep on matcher --- pkgs/test_api/pubspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml index 84142f903..adde9e6a4 100644 --- a/pkgs/test_api/pubspec.yaml +++ b/pkgs/test_api/pubspec.yaml @@ -27,3 +27,4 @@ dev_dependencies: lints: '>=1.0.0 <3.0.0' test: any test_core: any + matcher: any From 3b059cd49c70d37d39256596f78ba1bcd1077b92 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 2 May 2023 04:26:40 +0000 Subject: [PATCH 7/7] matcher is published now --- pkgs/test/pubspec.yaml | 2 +- pkgs/test_api/pubspec.yaml | 1 - pkgs/test_api/pubspec_overrides.yaml | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 25dda8551..00c153a3e 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: test_core: 0.5.3 # Use a tight version constraint to ensure that a constraint on matcher # properly constrains all features it provides. - matcher: '>=0.12.15 <0.12.17' + matcher: '>=0.12.16 <0.12.17' dev_dependencies: fake_async: ^1.0.0 diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml index adde9e6a4..84142f903 100644 --- a/pkgs/test_api/pubspec.yaml +++ b/pkgs/test_api/pubspec.yaml @@ -27,4 +27,3 @@ dev_dependencies: lints: '>=1.0.0 <3.0.0' test: any test_core: any - matcher: any diff --git a/pkgs/test_api/pubspec_overrides.yaml b/pkgs/test_api/pubspec_overrides.yaml index ebec53f46..bdb2cf470 100644 --- a/pkgs/test_api/pubspec_overrides.yaml +++ b/pkgs/test_api/pubspec_overrides.yaml @@ -3,7 +3,3 @@ dependency_overrides: path: ../test test_core: path: ../test_core - matcher: - git: - url: https://github.com/dart-lang/matcher.git - ref: 3262428d5a701b514eb20ee27b3e02a92cde5761