Skip to content

Commit

Permalink
Different sharding. (dart-lang#7221)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Nov 27, 2023
1 parent ac22fbc commit cc0a415
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 25 deletions.
66 changes: 52 additions & 14 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ jobs:
- job_006
- job_007
job_024:
name: "unit_test; PKG: pkg/pub_integration; `dart test --run-skipped --total-shards 3 --shard-index 0`"
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '0~4p'``"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -1021,8 +1021,8 @@ jobs:
run: dart pub get
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkg/pub_integration
- name: "pkg/pub_integration; dart test --run-skipped --total-shards 3 --shard-index 0"
run: dart test --run-skipped --total-shards 3 --shard-index 0
- name: "pkg/pub_integration; dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '0~4p'`"
run: "dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '0~4p'`"
if: "always() && steps.pkg_pub_integration_pub_get.conclusion == 'success'"
working-directory: pkg/pub_integration
needs:
Expand All @@ -1034,7 +1034,7 @@ jobs:
- job_006
- job_007
job_025:
name: "unit_test; PKG: pkg/pub_integration; `dart test --run-skipped --total-shards 3 --shard-index 1`"
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '1~4p'``"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -1059,8 +1059,8 @@ jobs:
run: dart pub get
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkg/pub_integration
- name: "pkg/pub_integration; dart test --run-skipped --total-shards 3 --shard-index 1"
run: dart test --run-skipped --total-shards 3 --shard-index 1
- name: "pkg/pub_integration; dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '1~4p'`"
run: "dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '1~4p'`"
if: "always() && steps.pkg_pub_integration_pub_get.conclusion == 'success'"
working-directory: pkg/pub_integration
needs:
Expand All @@ -1072,7 +1072,7 @@ jobs:
- job_006
- job_007
job_026:
name: "unit_test; PKG: pkg/pub_integration; `dart test --run-skipped --total-shards 3 --shard-index 2`"
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '2~4p'``"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
Expand All @@ -1097,8 +1097,8 @@ jobs:
run: dart pub get
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkg/pub_integration
- name: "pkg/pub_integration; dart test --run-skipped --total-shards 3 --shard-index 2"
run: dart test --run-skipped --total-shards 3 --shard-index 2
- name: "pkg/pub_integration; dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '2~4p'`"
run: "dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '2~4p'`"
if: "always() && steps.pkg_pub_integration_pub_get.conclusion == 'success'"
working-directory: pkg/pub_integration
needs:
Expand All @@ -1110,14 +1110,52 @@ jobs:
- job_006
- job_007
job_027:
name: "unit_test; PKG: pkg/pub_integration; `dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '3~4p'``"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_integration;commands:test_12"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_integration
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
with:
sdk: "3.2.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- id: pkg_pub_integration_pub_get
name: pkg/pub_integration; dart pub get
run: dart pub get
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: pkg/pub_integration
- name: "pkg/pub_integration; dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '3~4p'`"
run: "dart test -j1 --run-skipped `find test -name \"*_test\\\\.dart\" | sort | sed -n '3~4p'`"
if: "always() && steps.pkg_pub_integration_pub_get.conclusion == 'success'"
working-directory: pkg/pub_integration
needs:
- job_001
- job_002
- job_003
- job_004
- job_005
- job_006
- job_007
job_028:
name: "unit_test; PKG: pkg/pub_worker; `dart test --run-skipped --concurrency=1 `find test -name \"*_test\\\\.dart\" | sort | sed -n '0~3p'``"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker;commands:test_12"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker;commands:test_13"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0
Expand Down Expand Up @@ -1147,15 +1185,15 @@ jobs:
- job_005
- job_006
- job_007
job_028:
job_029:
name: "unit_test; PKG: pkg/pub_worker; `dart test --run-skipped --concurrency=1 `find test -name \"*_test\\\\.dart\" | sort | sed -n '1~3p'``"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker;commands:test_13"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker;commands:test_14"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0
Expand Down Expand Up @@ -1185,15 +1223,15 @@ jobs:
- job_005
- job_006
- job_007
job_029:
job_030:
name: "unit_test; PKG: pkg/pub_worker; `dart test --run-skipped --concurrency=1 `find test -name \"*_test\\\\.dart\" | sort | sed -n '2~3p'``"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker;commands:test_14"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker;commands:test_15"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkg/pub_worker
os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0
Expand Down
10 changes: 7 additions & 3 deletions pkg/pub_integration/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ stages:
- analyze: --fatal-infos lib/
- analyze: --fatal-infos test/
- unit_test:
- test: --run-skipped --total-shards 3 --shard-index 0
- test: --run-skipped --total-shards 3 --shard-index 1
- test: --run-skipped --total-shards 3 --shard-index 2
# Instead of --total-shards and --shard index, we are using file-based sharding,
# as it provided better distribution of the tests.
# https://github.com/dart-lang/test/issues/2141
- test: -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '0~4p'`
- test: -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '1~4p'`
- test: -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '2~4p'`
- test: -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '3~4p'`
20 changes: 12 additions & 8 deletions tool/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,30 @@ for PKG in ${PKGS}; do
dart test --run-skipped || EXIT_CODE=$?
;;
test_09)
echo 'dart test --run-skipped --total-shards 3 --shard-index 0'
dart test --run-skipped --total-shards 3 --shard-index 0 || EXIT_CODE=$?
echo 'dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '0~4p'`'
dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '0~4p'` || EXIT_CODE=$?
;;
test_10)
echo 'dart test --run-skipped --total-shards 3 --shard-index 1'
dart test --run-skipped --total-shards 3 --shard-index 1 || EXIT_CODE=$?
echo 'dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '1~4p'`'
dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '1~4p'` || EXIT_CODE=$?
;;
test_11)
echo 'dart test --run-skipped --total-shards 3 --shard-index 2'
dart test --run-skipped --total-shards 3 --shard-index 2 || EXIT_CODE=$?
echo 'dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '2~4p'`'
dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '2~4p'` || EXIT_CODE=$?
;;
test_12)
echo 'dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '3~4p'`'
dart test -j1 --run-skipped `find test -name "*_test\\.dart" | sort | sed -n '3~4p'` || EXIT_CODE=$?
;;
test_13)
echo 'dart test --run-skipped --concurrency=1 `find test -name "*_test\\.dart" | sort | sed -n '0~3p'`'
dart test --run-skipped --concurrency=1 `find test -name "*_test\\.dart" | sort | sed -n '0~3p'` || EXIT_CODE=$?
;;
test_13)
test_14)
echo 'dart test --run-skipped --concurrency=1 `find test -name "*_test\\.dart" | sort | sed -n '1~3p'`'
dart test --run-skipped --concurrency=1 `find test -name "*_test\\.dart" | sort | sed -n '1~3p'` || EXIT_CODE=$?
;;
test_14)
test_15)
echo 'dart test --run-skipped --concurrency=1 `find test -name "*_test\\.dart" | sort | sed -n '2~3p'`'
dart test --run-skipped --concurrency=1 `find test -name "*_test\\.dart" | sort | sed -n '2~3p'` || EXIT_CODE=$?
;;
Expand Down

0 comments on commit cc0a415

Please sign in to comment.