From 53266bbaf1dbfcd295fe81dcf0614cb604a68760 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 28 Apr 2025 12:35:48 +0800 Subject: [PATCH 1/2] test: workflow with shards --- .github/workflows/nomos_daily.yml | 6 ++++-- .github/workflows/test_common.yml | 6 +++++- requirements.txt | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nomos_daily.yml b/.github/workflows/nomos_daily.yml index 58b3c08..a9c4d96 100644 --- a/.github/workflows/nomos_daily.yml +++ b/.github/workflows/nomos_daily.yml @@ -1,10 +1,12 @@ -name: Nomos E2E Tests Daily +name: Test Nomos E2E Tests Daily on: schedule: - cron: '0 4 * * *' workflow_dispatch: - + push: + branches: + - chore-sharding-github-workflows jobs: test-common: uses: ./.github/workflows/test_common.yml diff --git a/.github/workflows/test_common.yml b/.github/workflows/test_common.yml index a625848..0a97ccc 100644 --- a/.github/workflows/test_common.yml +++ b/.github/workflows/test_common.yml @@ -9,6 +9,10 @@ env: jobs: tests: name: tests + strategy: + fail-fast: false + matrix: + shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] runs-on: ubuntu-latest timeout-minutes: 120 steps: @@ -29,4 +33,4 @@ jobs: - name: Run tests run: | - pytest \ No newline at end of file + pytest --shard-id=${{ matrix.shard }} --num-shards=10 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e90168e..1621ad8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -41,4 +41,5 @@ typing_extensions==4.9.0 urllib3==2.2.2 virtualenv==20.25.0 Jinja2~=3.1.5 -psutil~=7.0.0 \ No newline at end of file +psutil~=7.0.0 +pytest-shard==0.1.2 \ No newline at end of file From 566a6fc30b8328a2b69797205f0b1de35461d2d1 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 28 Apr 2025 14:25:36 +0800 Subject: [PATCH 2/2] fix: make daily workflow ready to merge --- .github/workflows/nomos_daily.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nomos_daily.yml b/.github/workflows/nomos_daily.yml index a9c4d96..58b3c08 100644 --- a/.github/workflows/nomos_daily.yml +++ b/.github/workflows/nomos_daily.yml @@ -1,12 +1,10 @@ -name: Test Nomos E2E Tests Daily +name: Nomos E2E Tests Daily on: schedule: - cron: '0 4 * * *' workflow_dispatch: - push: - branches: - - chore-sharding-github-workflows + jobs: test-common: uses: ./.github/workflows/test_common.yml