Skip to content

Expand Analyzer constraints to allow 8.x #2518

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

Merged
merged 2 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.26.3

* Expand pub constraint to allow the latest `analyzer`.

## 1.26.2

* Graduate native assets from experiment to preview.
Expand Down
8 changes: 4 additions & 4 deletions pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test
version: 1.26.2
version: 1.26.3
description: >-
A full featured library for writing and running Dart tests across platforms.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test
Expand All @@ -10,7 +10,7 @@ environment:
sdk: ^3.5.0

dependencies:
analyzer: '>=6.0.0 <8.0.0'
analyzer: '>=6.0.0 <9.0.0'
async: ^2.5.0
boolean_selector: ^2.1.0
collection: ^1.15.0
Expand All @@ -36,8 +36,8 @@ dependencies:
stream_channel: ^2.1.0

# Use an exact version until the test_api and test_core package are stable.
test_api: 0.7.6
test_core: 0.6.11
test_api: 0.7.7
test_core: 0.6.12

typed_data: ^1.3.0
web_socket_channel: '>=2.0.0 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions pkgs/test_api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.7.7

* Expand pub constraint to allow the latest `analyzer`.

## 0.7.6

* Fix an assertion failure when using `setUpAll` or `tearDownAll` and running
Expand Down
4 changes: 2 additions & 2 deletions pkgs/test_api/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_api
version: 0.7.6
version: 0.7.7
description: >-
The user facing API for structuring Dart tests and checking expectations.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api
Expand All @@ -21,7 +21,7 @@ dependencies:
term_glyph: ^1.2.0

dev_dependencies:
analyzer: '>=6.0.0 <8.0.0'
analyzer: '>=6.0.0 <9.0.0'
fake_async: ^1.2.0
glob: ^2.0.0
graphs: ^2.0.0
Expand Down
4 changes: 4 additions & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.12

* Expand pub constraint to allow the latest `analyzer`.

## 0.6.11

* Graduate native assets from experiment to preview.
Expand Down
4 changes: 4 additions & 0 deletions pkgs/test_core/lib/src/runner/parse_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ class _Parser {
Object? skip;
for (var expression in expressions) {
if (expression is InstanceCreationExpression) {
// Replace name2 with name when bumping min analyzer dependency
// ignore: deprecated_member_use
var className = expression.constructorName.type.name2.lexeme;

if (className == 'Timeout') {
Expand Down Expand Up @@ -348,6 +350,8 @@ class _Parser {

String? _findConstructorNameFromInstantiation(
InstanceCreationExpression constructor, String className) {
// Replace name2 with name when bumping min analyzer dependency
// ignore: deprecated_member_use
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 doing it now?
When we will start removing old APIs from the analyzer, this will cause issues.
And than we will have to do one more iteration to clean this up.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure we can fix this now. Do you know the correct min version to include the new name field?

Copy link
Contributor

@scheglov scheglov Jul 18, 2025

Choose a reason for hiding this comment

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

8.0.0

  • Deprecate NamedType.name2, use name instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should have at least 1 release which allows both analyzer versions so I'll publish first with the ignore and then fix it in a followup.

var actualClassName = constructor.constructorName.type.name2.lexeme;
var constructorName = constructor.constructorName.name?.name;

Expand Down
6 changes: 3 additions & 3 deletions pkgs/test_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_core
version: 0.6.11
version: 0.6.12
description: A basic library for writing tests and running them on the VM.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core
issue_tracker: https://github.com/dart-lang/test/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Atest
Expand All @@ -9,7 +9,7 @@ environment:
sdk: ^3.5.0

dependencies:
analyzer: '>=6.0.0 <8.0.0'
analyzer: '>=6.0.0 <9.0.0'
args: ^2.0.0
async: ^2.5.0
boolean_selector: ^2.1.0
Expand All @@ -28,7 +28,7 @@ dependencies:
stack_trace: ^1.10.0
stream_channel: ^2.1.0
# Use an exact version until the test_api package is stable.
test_api: 0.7.6
test_api: 0.7.7
vm_service: '>=6.0.0 <16.0.0'
yaml: ^3.0.0

Expand Down
Loading