From d33eaeee54ed37d44b66a7424f720a03a8dea323 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Thu, 28 Dec 2023 14:58:24 -0800 Subject: [PATCH] Prepare a hotfix release of DWDS 22.1.0+1 (#2321) --- .github/workflows/dart.yml | 562 +++--------------- dwds/CHANGELOG.md | 5 + dwds/lib/src/debugging/classes.dart | 10 +- dwds/lib/src/debugging/location.dart | 2 +- dwds/lib/src/version.dart | 2 +- dwds/mono_pkg.yaml | 5 - dwds/pubspec.yaml | 2 +- dwds/test/inspector_test.dart | 5 + .../test/instances/class_inspection_test.dart | 124 ++++ .../instances/common/instance_common.dart | 8 +- dwds/test/variable_scope_test.dart | 24 +- fixtures/_experimentSound/web/main.dart | 29 + .../test/frontend_sever_client_test.dart | 6 +- test_common/lib/utilities.dart | 10 + test_common/pubspec.yaml | 2 +- tool/ci.sh | 2 +- webdev/mono_pkg.yaml | 2 - webdev/test/e2e_test.dart | 9 +- 18 files changed, 316 insertions(+), 493 deletions(-) create mode 100644 dwds/test/instances/class_inspection_test.dart diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index d01b81339..34ac4c5e9 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.6.0 +# Created with package:mono_repo v6.5.3 name: Dart CI on: push: @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable" @@ -30,14 +30,14 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: stable - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - name: mono_repo self validate - run: dart pub global activate mono_repo 6.6.0 + run: dart pub global activate mono_repo 6.5.3 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:dwds;commands:format-analyze_0-test_0" @@ -55,12 +55,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -83,7 +83,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:example-fixtures/_webdevSoundSmoke-frontend_server_client-frontend_server_common-test_common;commands:format-analyze_0" @@ -93,12 +93,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: example_pub_upgrade name: example; dart pub upgrade run: dart pub upgrade @@ -169,7 +169,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:webdev;commands:format-analyze_0-test_7" @@ -179,12 +179,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: webdev_pub_upgrade name: webdev; dart pub upgrade run: dart pub upgrade @@ -207,7 +207,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:dwds;commands:command-test_1" @@ -217,12 +217,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -246,7 +246,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:dwds;commands:test_2" @@ -256,12 +256,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -281,7 +281,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:dwds;commands:test_3" @@ -291,12 +291,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -316,7 +316,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:dwds;commands:test_4" @@ -326,12 +326,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -351,7 +351,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:frontend_server_client;commands:test_5" @@ -361,12 +361,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: frontend_server_client_pub_upgrade name: frontend_server_client; dart pub upgrade run: dart pub upgrade @@ -386,7 +386,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:test_common;commands:command-test_6" @@ -396,12 +396,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: test_common_pub_upgrade name: test_common; dart pub upgrade run: dart pub upgrade @@ -425,7 +425,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:webdev;commands:command-test_5" @@ -435,12 +435,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: webdev_pub_upgrade name: webdev; dart pub upgrade run: dart pub upgrade @@ -460,155 +460,11 @@ jobs: - job_003 - job_004 job_012: - name: "unit_test; linux; Dart main; PKG: dwds; `Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &`, `dart test --tags=extension`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds;commands:command-test_1" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds - os:ubuntu-latest;pub-cache-hosted;sdk:main - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &" - run: "Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --tags=extension" - run: "dart test --tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_013: - name: "unit_test; linux; Dart main; PKG: dwds; `dart test --total-shards 3 --shard-index 0 --exclude-tags=extension`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds;commands:test_2" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds - os:ubuntu-latest;pub-cache-hosted;sdk:main - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --total-shards 3 --shard-index 0 --exclude-tags=extension" - run: "dart test --total-shards 3 --shard-index 0 --exclude-tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_014: - name: "unit_test; linux; Dart main; PKG: dwds; `dart test --total-shards 3 --shard-index 1 --exclude-tags=extension`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds;commands:test_3" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds - os:ubuntu-latest;pub-cache-hosted;sdk:main - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --total-shards 3 --shard-index 1 --exclude-tags=extension" - run: "dart test --total-shards 3 --shard-index 1 --exclude-tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_015: - name: "unit_test; linux; Dart main; PKG: dwds; `dart test --total-shards 3 --shard-index 2 --exclude-tags=extension`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds;commands:test_4" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:dwds - os:ubuntu-latest;pub-cache-hosted;sdk:main - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --total-shards 3 --shard-index 2 --exclude-tags=extension" - run: "dart test --total-shards 3 --shard-index 2 --exclude-tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_016: name: "unit_test; linux; Dart main; PKG: frontend_server_client; `dart test -j 1`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:frontend_server_client;commands:test_5" @@ -618,12 +474,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: main - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: frontend_server_client_pub_upgrade name: frontend_server_client; dart pub upgrade run: dart pub upgrade @@ -638,12 +494,12 @@ jobs: - job_002 - job_003 - job_004 - job_017: + job_013: name: "unit_test; linux; Dart main; PKG: test_common; `Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &`, `dart test --exclude-tags=release`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:test_common;commands:command-test_6" @@ -653,12 +509,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: main - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: test_common_pub_upgrade name: test_common; dart pub upgrade run: dart pub upgrade @@ -677,56 +533,17 @@ jobs: - job_002 - job_003 - job_004 - job_018: - name: "unit_test; linux; Dart main; PKG: webdev; `Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &`, `dart test -j 1`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:webdev;commands:command-test_5" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:webdev - os:ubuntu-latest;pub-cache-hosted;sdk:main - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: webdev_pub_upgrade - name: webdev; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: webdev - - name: "webdev; Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &" - run: "Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &" - if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" - working-directory: webdev - - name: "webdev; dart test -j 1" - run: dart test -j 1 - if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" - working-directory: webdev - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_019: + job_014: name: "unit_test; windows; Dart dev; PKG: dwds; `dart test --tags=extension`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -741,17 +558,17 @@ jobs: - job_002 - job_003 - job_004 - job_020: + job_015: name: "unit_test; windows; Dart dev; PKG: dwds; `dart test --total-shards 3 --shard-index 0 --exclude-tags=extension`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -766,17 +583,17 @@ jobs: - job_002 - job_003 - job_004 - job_021: + job_016: name: "unit_test; windows; Dart dev; PKG: dwds; `dart test --total-shards 3 --shard-index 1 --exclude-tags=extension`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -791,17 +608,17 @@ jobs: - job_002 - job_003 - job_004 - job_022: + job_017: name: "unit_test; windows; Dart dev; PKG: dwds; `dart test --total-shards 3 --shard-index 2 --exclude-tags=extension`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -816,17 +633,17 @@ jobs: - job_002 - job_003 - job_004 - job_023: + job_018: name: "unit_test; windows; Dart dev; PKG: frontend_server_client; `dart test -j 1`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: frontend_server_client_pub_upgrade name: frontend_server_client; dart pub upgrade run: dart pub upgrade @@ -841,17 +658,17 @@ jobs: - job_002 - job_003 - job_004 - job_024: + job_019: name: "unit_test; windows; Dart dev; PKG: webdev; `dart test -j 1`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: webdev_pub_upgrade name: webdev; dart pub upgrade run: dart pub upgrade @@ -866,17 +683,17 @@ jobs: - job_002 - job_003 - job_004 - job_025: + job_020: name: "unit_test; windows; Dart dev; PKG: test_common; `dart test --exclude-tags=release`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: dev - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: test_common_pub_upgrade name: test_common; dart pub upgrade run: dart pub upgrade @@ -891,117 +708,17 @@ jobs: - job_002 - job_003 - job_004 - job_026: - name: "unit_test; windows; Dart main; PKG: dwds; `dart test --tags=extension`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --tags=extension" - run: "dart test --tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_027: - name: "unit_test; windows; Dart main; PKG: dwds; `dart test --total-shards 3 --shard-index 0 --exclude-tags=extension`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --total-shards 3 --shard-index 0 --exclude-tags=extension" - run: "dart test --total-shards 3 --shard-index 0 --exclude-tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_028: - name: "unit_test; windows; Dart main; PKG: dwds; `dart test --total-shards 3 --shard-index 1 --exclude-tags=extension`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --total-shards 3 --shard-index 1 --exclude-tags=extension" - run: "dart test --total-shards 3 --shard-index 1 --exclude-tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_029: - name: "unit_test; windows; Dart main; PKG: dwds; `dart test --total-shards 3 --shard-index 2 --exclude-tags=extension`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: dwds_pub_upgrade - name: dwds; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: dwds - - name: "dwds; dart test --total-shards 3 --shard-index 2 --exclude-tags=extension" - run: "dart test --total-shards 3 --shard-index 2 --exclude-tags=extension" - if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" - working-directory: dwds - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_030: + job_021: name: "unit_test; windows; Dart main; PKG: frontend_server_client; `dart test -j 1`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: main - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: frontend_server_client_pub_upgrade name: frontend_server_client; dart pub upgrade run: dart pub upgrade @@ -1016,42 +733,17 @@ jobs: - job_002 - job_003 - job_004 - job_031: - name: "unit_test; windows; Dart main; PKG: webdev; `dart test -j 1`" - runs-on: windows-latest - steps: - - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 - with: - sdk: main - - id: checkout - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - id: webdev_pub_upgrade - name: webdev; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: webdev - - name: "webdev; dart test -j 1" - run: dart test -j 1 - if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" - working-directory: webdev - needs: - - job_001 - - job_002 - - job_003 - - job_004 - job_032: + job_022: name: "unit_test; windows; Dart main; PKG: test_common; `dart test --exclude-tags=release`" runs-on: windows-latest steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: main - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: test_common_pub_upgrade name: test_common; dart pub upgrade run: dart pub upgrade @@ -1066,13 +758,13 @@ jobs: - job_002 - job_003 - job_004 - job_033: + job_023: name: "beta_cron; linux; Dart beta; PKG: dwds; `Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &`, `dart test -j 1`" runs-on: ubuntu-latest if: "github.event_name == 'schedule'" steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:beta;packages:dwds;commands:command-test_5" @@ -1082,12 +774,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: beta - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -1124,23 +816,13 @@ jobs: - job_020 - job_021 - job_022 - - job_023 - - job_024 - - job_025 - - job_026 - - job_027 - - job_028 - - job_029 - - job_030 - - job_031 - - job_032 - job_034: + job_024: name: "beta_cron; linux; Dart beta; PKG: webdev; `Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &`, `dart test -j 1`" runs-on: ubuntu-latest if: "github.event_name == 'schedule'" steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:beta;packages:webdev;commands:command-test_5" @@ -1150,12 +832,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: beta - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: webdev_pub_upgrade name: webdev; dart pub upgrade run: dart pub upgrade @@ -1192,23 +874,13 @@ jobs: - job_020 - job_021 - job_022 - - job_023 - - job_024 - - job_025 - - job_026 - - job_027 - - job_028 - - job_029 - - job_030 - - job_031 - - job_032 - job_035: + job_025: name: "beta_cron; linux; Dart beta; PKG: dwds; `dart analyze .`" runs-on: ubuntu-latest if: "github.event_name == 'schedule'" steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:beta;packages:dwds;commands:analyze_1" @@ -1218,12 +890,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: beta - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -1256,23 +928,13 @@ jobs: - job_020 - job_021 - job_022 - - job_023 - - job_024 - - job_025 - - job_026 - - job_027 - - job_028 - - job_029 - - job_030 - - job_031 - - job_032 - job_036: + job_026: name: "beta_cron; linux; Dart beta; PKG: webdev; `dart analyze .`" runs-on: ubuntu-latest if: "github.event_name == 'schedule'" steps: - name: Cache Pub hosted dependencies - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" key: "os:ubuntu-latest;pub-cache-hosted;sdk:beta;packages:webdev;commands:analyze_1" @@ -1282,12 +944,12 @@ jobs: os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: beta - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: webdev_pub_upgrade name: webdev; dart pub upgrade run: dart pub upgrade @@ -1320,28 +982,18 @@ jobs: - job_020 - job_021 - job_022 - - job_023 - - job_024 - - job_025 - - job_026 - - job_027 - - job_028 - - job_029 - - job_030 - - job_031 - - job_032 - job_037: + job_027: name: "beta_cron; windows; Dart beta; PKG: dwds; `dart test -j 1`" runs-on: windows-latest if: "github.event_name == 'schedule'" steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: beta - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: dwds_pub_upgrade name: dwds; dart pub upgrade run: dart pub upgrade @@ -1374,28 +1026,18 @@ jobs: - job_020 - job_021 - job_022 - - job_023 - - job_024 - - job_025 - - job_026 - - job_027 - - job_028 - - job_029 - - job_030 - - job_031 - - job_032 - job_038: + job_028: name: "beta_cron; windows; Dart beta; PKG: webdev; `dart test -j 1`" runs-on: windows-latest if: "github.event_name == 'schedule'" steps: - name: Setup Dart SDK - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: beta - id: checkout name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 - id: webdev_pub_upgrade name: webdev; dart pub upgrade run: dart pub upgrade @@ -1428,17 +1070,7 @@ jobs: - job_020 - job_021 - job_022 - - job_023 - - job_024 - - job_025 - - job_026 - - job_027 - - job_028 - - job_029 - - job_030 - - job_031 - - job_032 - job_039: + job_029: name: Notify failure runs-on: ubuntu-latest if: "(github.event_name == 'push' || github.event_name == 'schedule') && failure()" @@ -1478,13 +1110,3 @@ jobs: - job_026 - job_027 - job_028 - - job_029 - - job_030 - - job_031 - - job_032 - - job_033 - - job_034 - - job_035 - - job_036 - - job_037 - - job_038 diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 631e3a03f..283bc689f 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -1,4 +1,9 @@ +## 22.1.0+1 + +- Fix a null cast error when debugging a `Class` from VS Code. - [#2303](https://github.com/dart-lang/webdev/pull/2303) + ## 22.1.0 + - Update `package:vm_service` constraint to `^13.0.0`. - [#2235](https://github.com/dart-lang/webdev/pull/2265) ## 22.0.0 diff --git a/dwds/lib/src/debugging/classes.dart b/dwds/lib/src/debugging/classes.dart index 7f4de281d..3b939ec99 100644 --- a/dwds/lib/src/debugging/classes.dart +++ b/dwds/lib/src/debugging/classes.dart @@ -96,10 +96,9 @@ class ClassHelper extends Domain { throw ChromeDebugException(e.json, evalContents: expression); } - final classDescriptor = result.value as Map; + final classDescriptor = _mapify(result.value); final methodRefs = []; - final methodDescriptors = - classDescriptor['methods'] as Map; + final methodDescriptors = _mapify(classDescriptor['methods']); methodDescriptors.forEach((name, descriptor) { final methodId = 'methods|$classId|$name'; methodRefs.add( @@ -118,7 +117,7 @@ class ClassHelper extends Domain { }); final fieldRefs = []; - final fieldDescriptors = classDescriptor['fields'] as Map; + final fieldDescriptors = _mapify(classDescriptor['fields']); fieldDescriptors.forEach((name, descriptor) { final classMetaData = ClassMetaData( runtimeKind: RuntimeObjectKind.type, @@ -168,4 +167,7 @@ class ClassHelper extends Domain { superClass: superClassRef, ); } + + Map _mapify(dynamic map) => + (map as Map?) ?? {}; } diff --git a/dwds/lib/src/debugging/location.dart b/dwds/lib/src/debugging/location.dart index 7895a229c..4b52f875d 100644 --- a/dwds/lib/src/debugging/location.dart +++ b/dwds/lib/src/debugging/location.dart @@ -78,7 +78,7 @@ class DartLocation { int get hashCode => Object.hashAll([uri, line, column]); @override - bool operator ==(Object? other) { + bool operator ==(Object other) { if (other is! DartLocation) { return false; } diff --git a/dwds/lib/src/version.dart b/dwds/lib/src/version.dart index 8896237aa..def30748b 100644 --- a/dwds/lib/src/version.dart +++ b/dwds/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '22.1.0'; +const packageVersion = '22.1.0+1'; diff --git a/dwds/mono_pkg.yaml b/dwds/mono_pkg.yaml index 15b55041f..27c09d8ce 100644 --- a/dwds/mono_pkg.yaml +++ b/dwds/mono_pkg.yaml @@ -15,7 +15,6 @@ stages: - test: --tags=extension sdk: - dev - - main os: - linux # Windows extension tests: @@ -23,7 +22,6 @@ stages: - test: --tags=extension sdk: - dev - - main os: - windows # First test shard: @@ -31,7 +29,6 @@ stages: - test: --total-shards 3 --shard-index 0 --exclude-tags=extension sdk: - dev - - main os: - linux - windows @@ -40,7 +37,6 @@ stages: - test: --total-shards 3 --shard-index 1 --exclude-tags=extension sdk: - dev - - main os: - linux - windows @@ -49,7 +45,6 @@ stages: - test: --total-shards 3 --shard-index 2 --exclude-tags=extension sdk: - dev - - main os: - linux - windows diff --git a/dwds/pubspec.yaml b/dwds/pubspec.yaml index 0f99ef1e3..db4bc5cd0 100644 --- a/dwds/pubspec.yaml +++ b/dwds/pubspec.yaml @@ -1,6 +1,6 @@ name: dwds # Every time this changes you need to run `dart run build_runner build`. -version: 22.1.0 +version: 22.1.0+1 description: >- A service that proxies between the Chrome debug protocol and the Dart VM service protocol. diff --git a/dwds/test/inspector_test.dart b/dwds/test/inspector_test.dart index e84cd64ad..b17fca8de 100644 --- a/dwds/test/inspector_test.dart +++ b/dwds/test/inspector_test.dart @@ -11,6 +11,7 @@ import 'package:dwds/src/debugging/inspector.dart'; import 'package:dwds/src/utilities/conversions.dart'; import 'package:test/test.dart'; import 'package:test_common/test_sdk_configuration.dart'; +import 'package:test_common/utilities.dart'; import 'package:vm_service/vm_service.dart'; import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; @@ -160,6 +161,10 @@ void main() { final names = properties.map((p) => p.name).where((x) => x != '__proto__').toList(); final expected = [ + if (dartSdkIsAtLeast( + newDdcTypeSystemVersion, + )) + '\$ti', '_privateField', 'abstractField', 'closure', diff --git a/dwds/test/instances/class_inspection_test.dart b/dwds/test/instances/class_inspection_test.dart new file mode 100644 index 000000000..6b0a43738 --- /dev/null +++ b/dwds/test/instances/class_inspection_test.dart @@ -0,0 +1,124 @@ +// Copyright (c) 2023, 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. + +@Tags(['daily']) +@TestOn('vm') +@Timeout(Duration(minutes: 2)) + +import 'package:test/test.dart'; +import 'package:test_common/logging.dart'; +import 'package:test_common/test_sdk_configuration.dart'; +import 'package:vm_service/vm_service.dart'; + +import '../fixtures/context.dart'; +import '../fixtures/project.dart'; +import 'common/test_inspector.dart'; + +void main() { + // Enable verbose logging for debugging. + final debug = false; + + final provider = TestSdkConfigurationProvider( + verbose: debug, + ); + + final context = + TestContext(TestProject.testExperimentWithSoundNullSafety, provider); + final testInspector = TestInspector(context); + + late VmService service; + late Stream stream; + late String isolateId; + late ScriptRef mainScript; + + onBreakPoint(breakPointId, body) => testInspector.onBreakPoint( + stream, + isolateId, + mainScript, + breakPointId, + body, + ); + + getObject(instanceId) => service.getObject(isolateId, instanceId); + + group('Class |', () { + tearDownAll(provider.dispose); + + for (var compilationMode in CompilationMode.values) { + group('$compilationMode |', () { + setUpAll(() async { + setCurrentLogWriter(debug: debug); + await context.setUp( + compilationMode: compilationMode, + enableExpressionEvaluation: true, + verboseCompiler: debug, + ); + service = context.debugConnection.vmService; + + final vm = await service.getVM(); + isolateId = vm.isolates!.first.id!; + final scripts = await service.getScripts(isolateId); + + await service.streamListen('Debug'); + stream = service.onEvent('Debug'); + + mainScript = scripts.scripts! + .firstWhere((each) => each.uri!.contains('main.dart')); + }); + + tearDownAll(() async { + await context.tearDown(); + }); + + setUp(() => setCurrentLogWriter(debug: debug)); + tearDown(() => service.resume(isolateId)); + + group('calling getObject for an existent class', () { + test('returns the correct class representation', () async { + await onBreakPoint('testClass1Case1', (event) async { + // classes|dart:core|Object_Diagnosticable + final result = await getObject( + 'classes|org-dartlang-app:///web/main.dart|GreeterClass', + ); + final clazz = result as Class?; + expect(clazz!.name, equals('GreeterClass')); + expect( + clazz.fields!.map((field) => field.name), + unorderedEquals([ + 'greeteeName', + 'useFrench', + ]), + ); + expect( + clazz.functions!.map((fn) => fn.name), + containsAll([ + 'sayHello', + 'greetInEnglish', + 'greetInFrench', + ]), + ); + }); + }); + }); + + group('calling getObject for a non-existent class', () { + // TODO(https://github.com/dart-lang/webdev/issues/2297): Ideally we + // should throw an error in this case for the client to catch instead + // of returning an empty class. + test('returns an empty class representation', () async { + await onBreakPoint('testClass1Case1', (event) async { + final result = await getObject( + 'classes|dart:core|Object_Diagnosticable', + ); + final clazz = result as Class?; + expect(clazz!.name, equals('Object_Diagnosticable')); + expect(clazz.fields, isEmpty); + expect(clazz.functions, isEmpty); + }); + }); + }); + }); + } + }); +} diff --git a/dwds/test/instances/common/instance_common.dart b/dwds/test/instances/common/instance_common.dart index 946b7b60f..59033423b 100644 --- a/dwds/test/instances/common/instance_common.dart +++ b/dwds/test/instances/common/instance_common.dart @@ -7,6 +7,7 @@ import 'package:dwds/src/debugging/inspector.dart'; import 'package:test/test.dart'; import 'package:test_common/logging.dart'; import 'package:test_common/test_sdk_configuration.dart'; +import 'package:test_common/utilities.dart'; import 'package:vm_service/vm_service.dart'; import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; @@ -73,7 +74,12 @@ void runTypeSystemVerificationTests({ ); expect( remoteObject.json['className'], - canaryFeatures ? 'dart_rti.Rti.new' : 'Function', + canaryFeatures || + dartSdkIsAtLeast( + newDdcTypeSystemVersion, + ) + ? 'dart_rti.Rti.new' + : 'Function', ); }); }); diff --git a/dwds/test/variable_scope_test.dart b/dwds/test/variable_scope_test.dart index a89d94d16..d60d00e51 100644 --- a/dwds/test/variable_scope_test.dart +++ b/dwds/test/variable_scope_test.dart @@ -9,6 +9,7 @@ import 'package:dwds/src/services/chrome_proxy_service.dart'; import 'package:test/test.dart'; import 'package:test_common/logging.dart'; import 'package:test_common/test_sdk_configuration.dart'; +import 'package:test_common/utilities.dart'; import 'package:vm_service/vm_service.dart'; import 'fixtures/context.dart'; @@ -203,7 +204,18 @@ void main() { final variableNames = variables.keys.toList()..sort(); expect( variableNames, - ['closureLocalInsideMethod', 'local', 'parameter', 'this'], + [ + // TODO(https://github.com/dart-lang/webdev/issues/2316): Make sure T + // doesn't show up here. + if (dartSdkIsAtLeast( + newDdcTypeSystemVersion, + )) + 'T', + 'closureLocalInsideMethod', + 'local', + 'parameter', + 'this', + ], ); }); @@ -213,7 +225,15 @@ void main() { await expectDartVariables(variables); final variableNames = variables.keys.toList()..sort(); - expect(variableNames, ['this']); + expect(variableNames, [ + // TODO(https://github.com/dart-lang/webdev/issues/2316): Make sure T + // doesn't show up here. + if (dartSdkIsAtLeast( + newDdcTypeSystemVersion, + )) + 'T', + 'this', + ]); }); test('variables in extension method', () async { diff --git a/fixtures/_experimentSound/web/main.dart b/fixtures/_experimentSound/web/main.dart index 3783bc6e1..b68f1d438 100644 --- a/fixtures/_experimentSound/web/main.dart +++ b/fixtures/_experimentSound/web/main.dart @@ -20,6 +20,8 @@ void main() { testPattern([3.14, 'b']); testPattern([0, 1]); testPattern2(); + print('Classes'); + testClass(); }); document.body!.appendText('Program is running!'); @@ -55,6 +57,11 @@ void printNestedNamedLocalRecord() { print(record); // Breakpoint: printNestedNamedLocalRecord } +void testClass() { + final greeter = GreeterClass(greeteeName: 'Charlie Brown'); + greeter.sayHello(); +} + String testPattern(Object obj) { switch (obj) { case [var a, int n] || [int n, var a] when n == 1 && a is String: @@ -73,3 +80,25 @@ String testPattern2() { print(firstCat); // Breakpoint: testPattern2Case2 return '$dog, $firstCat, $secondCat'; } + +class GreeterClass { + final String greeteeName; + final bool useFrench; + + GreeterClass({ + this.greeteeName = 'Snoopy', + this.useFrench = false, + }); + + void sayHello() { + useFrench ? greetInFrench() : greetInEnglish(); + } + + void greetInEnglish() { + print('Hello $greeteeName'); // Breakpoint: testClass1Case1 + } + + void greetInFrench() { + print('Bonjour $greeteeName'); + } +} diff --git a/frontend_server_client/test/frontend_sever_client_test.dart b/frontend_server_client/test/frontend_sever_client_test.dart index 4deab4fac..ccab70bf8 100644 --- a/frontend_server_client/test/frontend_sever_client_test.dart +++ b/frontend_server_client/test/frontend_sever_client_test.dart @@ -111,7 +111,8 @@ String get message => p.join('hello', 'world'); expect(await stdoutLines.next, p.join('goodbye', 'world')); expect(await process.exitCode, 0); - }); + // TODO(https://github.com/dart-lang/webdev/issues/2315): Fix and re-enable. + }, skip: true); test('can handle compile errors and reload fixes', () async { var entrypoint = p.join(packageRoot, 'bin', 'main.dart'); @@ -174,7 +175,8 @@ String get message => p.join('hello', 'world'); expect(await stdoutLines.next, p.join('goodbye', 'world')); expect(await process.exitCode, 0); - }); + // TODO(https://github.com/dart-lang/webdev/issues/2315): Fix and re-enable. + }, skip: true); test('can compile and recompile a dartdevc app', () async { var entrypoint = diff --git a/test_common/lib/utilities.dart b/test_common/lib/utilities.dart index 3b53bf429..7ba1dca32 100644 --- a/test_common/lib/utilities.dart +++ b/test_common/lib/utilities.dart @@ -1,13 +1,17 @@ // Copyright (c) 2023, 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. +import 'dart:io'; import 'package:path/path.dart' as p; +import 'package:pub_semver/pub_semver.dart'; const webdevDirName = 'webdev'; const dwdsDirName = 'dwds'; const fixturesDirName = 'fixtures'; +const newDdcTypeSystemVersion = '3.3.0-242.0.dev'; + /// The path to the webdev directory in the local machine, e.g. /// '/workstation/webdev'. String get webdevPath { @@ -61,3 +65,9 @@ String absolutePath({ } throw Exception('Expected a path parameter.'); } + +bool dartSdkIsAtLeast(String sdkVersion) { + final expectedVersion = Version.parse(sdkVersion); + final actualVersion = Version.parse(Platform.version.split(' ')[0]); + return actualVersion >= expectedVersion; +} diff --git a/test_common/pubspec.yaml b/test_common/pubspec.yaml index 760d45f98..39da7872f 100644 --- a/test_common/pubspec.yaml +++ b/test_common/pubspec.yaml @@ -10,9 +10,9 @@ dependencies: file: ">=6.0.0 <8.0.0" logging: ^1.0.1 path: ^1.8.1 + pub_semver: ^2.1.1 test: ^1.21.1 dev_dependencies: lints: ^2.0.0 pubspec_parse: ^1.2.2 - pub_semver: ^2.1.1 diff --git a/tool/ci.sh b/tool/ci.sh index 116a97713..cfb1ea3b6 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Created with package:mono_repo v6.6.0 +# Created with package:mono_repo v6.5.3 # Support built in commands on windows out of the box. # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") diff --git a/webdev/mono_pkg.yaml b/webdev/mono_pkg.yaml index 8fd305797..77d9f44a1 100644 --- a/webdev/mono_pkg.yaml +++ b/webdev/mono_pkg.yaml @@ -12,12 +12,10 @@ stages: - test: -j 1 sdk: - dev - - main - test: -j 1 os: windows sdk: - dev - - main - beta_cron: - analyze: . sdk: beta diff --git a/webdev/test/e2e_test.dart b/webdev/test/e2e_test.dart index 9a574010d..2ffb8b584 100644 --- a/webdev/test/e2e_test.dart +++ b/webdev/test/e2e_test.dart @@ -9,6 +9,7 @@ import 'package:io/io.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as p; import 'package:test/test.dart'; +import 'package:test_common/utilities.dart'; import 'package:test_descriptor/test_descriptor.dart' as d; import 'package:test_process/test_process.dart'; import 'package:vm_service/vm_service.dart'; @@ -459,7 +460,9 @@ void main() { const TypeMatcher().having( (instance) => instance.classRef?.name, 'class name', - 'List')); + dartSdkIsAtLeast('3.3.0-242.0.dev') + ? 'JSArray' + : 'List')); final instanceRef = result as InstanceRef; final list = @@ -469,7 +472,9 @@ void main() { const TypeMatcher().having( (instance) => instance.classRef?.name, 'class name', - 'List')); + dartSdkIsAtLeast('3.3.0-242.0.dev') + ? 'JSArray' + : 'List')); final elements = (list as Instance).elements; expect(elements, [