-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* split unit-test to regression and partial versions
* set the trigger time of regression test to 7:00 on every Friday in Beijing time * replace the unit test before with the partial test, which only test on the corresponding unit tests of changed files. If there is no corresponding unit tests, run all tests.
- Loading branch information
Showing
4 changed files
with
145 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: unittest-partial | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | ||
|
||
jobs: | ||
unittest-single: | ||
runs-on: [GPU, unittest] | ||
environment: Testing | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: dj-${{ github.run_id }} | ||
|
||
- name: Setup docker compose | ||
working-directory: dj-${{ github.run_id }}/.github/workflows/docker | ||
run: | | ||
docker compose up -d | ||
- name: Install data-juicer | ||
working-directory: dj-${{ github.run_id }}/.github/workflows/docker | ||
run: | | ||
docker compose exec ray-head pip install -e .\[all\] | ||
docker compose exec ray-worker pip install -e .\[all\] | ||
- name: Clean dataset cache | ||
working-directory: dj-${{ github.run_id }}/.github/workflows/docker | ||
run: | | ||
docker compose exec ray-head rm -rf /data/huggingface/dataset | ||
- name: Run unittest standalone | ||
working-directory: dj-${{ github.run_id }}/.github/workflows/docker | ||
run: | | ||
docker compose exec -e OPENAI_BASE_URL=${{ secrets.OPENAI_BASE_URL }} -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} ray-head python tests/run.py --tag standalone --mode partial | ||
- name: Upload coverage report of standalone | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage_report_standalone | ||
include-hidden-files: true | ||
path: dj-${{ github.run_id }}/coverage_report_standalone | ||
|
||
- name: Run unittest ray | ||
working-directory: dj-${{ github.run_id }}/.github/workflows/docker | ||
run: | | ||
docker compose exec ray-head python tests/run.py --tag ray --mode regression | ||
- name: Upload coverage report of ray | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage_report_ray | ||
include-hidden-files: true | ||
path: dj-${{ github.run_id }}/coverage_report_ray | ||
|
||
- name: Remove docker compose | ||
working-directory: dj-${{ github.run_id }}/.github/workflows/docker | ||
if: always() | ||
run: | | ||
docker compose down --remove-orphans | ||
- name: Cleanup workspace | ||
if: always() | ||
run: | | ||
rm -rf dj-${{ github.run_id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters