From ad66117044b51ede0ae6c93828a7848cd818c307 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 09:50:32 +0800 Subject: [PATCH 1/9] [CI] fix test names --- .github/workflows/unit_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index a190a64..9e2afb0 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, macos-13, windows-latest ] # macos-latest arm64, macos-13 intel - test_script: ${{ fromJSON(needs.list-test-files.outputs.torch-files) }} + test_script: ${{ fromJSON(needs.list-test-files.outputs.test-files) }} steps: - uses: actions/checkout@v5 @@ -76,7 +76,7 @@ jobs: strategy: fail-fast: false matrix: - test_script: ${{ fromJSON(needs.list-test-files.outputs.torch-files) }} + test_script: ${{ fromJSON(needs.list-test-files.outputs.test-files) }} steps: - uses: actions/checkout@v5 @@ -103,7 +103,7 @@ jobs: strategy: fail-fast: false matrix: - test_script: ${{ fromJSON(needs.list-test-files.outputs.torch-files) }} + test_script: ${{ fromJSON(needs.list-test-files.outputs.test-files) }} steps: - uses: actions/checkout@v5 @@ -128,7 +128,7 @@ jobs: strategy: fail-fast: false matrix: - test_script: ${{ fromJSON(needs.list-test-files.outputs.torch-files) }} + test_script: ${{ fromJSON(needs.list-test-files.outputs.test-files) }} steps: - uses: actions/checkout@v5 From ac1c8928a3c1d851a704318c83dccc7fb1bcc145 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:04:12 +0800 Subject: [PATCH 2/9] [CI] fix var name --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 9e2afb0..f4daef9 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -41,7 +41,7 @@ jobs: test_files=$(python3 -c "$script") IFS='|' read -r test_files <<< "$test_files" - echo "test-files=$torch_test_files" >> "$GITHUB_OUTPUT" + echo "test-files=$test_files" >> "$GITHUB_OUTPUT" echo "Test files: $test_files" From 85b2c590db31fef33dfa38d38e82d46191736147 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:19:25 +0800 Subject: [PATCH 3/9] [CI] install pcre2 dependencies --- .github/workflows/unit_tests.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f4daef9..28309fd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -62,6 +62,17 @@ jobs: python-version: 3.12 cache: 'pip' + - name: install dependencies + run: | + echo "OS is ${{ runner.os }}" + if [ "${{ runner.os }}" = "macOS" ]; then + brew install pcre2 + elif [ "${{ runner.os }}" = "Linux" ]; then + apt update && apt install libpcre2-dev + else + echo "Unknown OS" + fi + - name: install run: pip install . pytest @@ -88,7 +99,7 @@ jobs: with: copyback: false prepare: | - env ASSUME_ALWAYS_YES=yes pkg install -y python py312-pip + env ASSUME_ALWAYS_YES=yes pkg install -y python py312-pip pcre2 run: | python -V python -m venv venv @@ -113,6 +124,8 @@ jobs: - name: Test in Solaris uses: vmactions/solaris-vm@v1 with: + prepare: | + pkg install library/pcre2 copyback: false run: | python -V @@ -138,6 +151,7 @@ jobs: additional-packages: python3-pip python3-venv + libpcre2-dev - name: test os shell: wsl-bash -u root {0} From e0567e13bf9de8539bb596084e7515296f22d3e9 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:24:00 +0800 Subject: [PATCH 4/9] [CI] disable concurrency, try to fix github's cancellation bug.. --- .github/workflows/unit_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 28309fd..c0e53e1 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -9,9 +9,9 @@ on: repository_dispatch: workflow_dispatch: -concurrency: - group: ${{ github.ref }}-workflow-unit-tests - cancel-in-progress: true +#concurrency: +# group: ${{ github.ref }}-workflow-unit-tests +# cancel-in-progress: true jobs: list-test-files: From 45b3fa6201e939b957d9e2f5973102954c3acdb4 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:25:11 +0800 Subject: [PATCH 5/9] [CI] sudo --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c0e53e1..5fdaf36 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -68,7 +68,7 @@ jobs: if [ "${{ runner.os }}" = "macOS" ]; then brew install pcre2 elif [ "${{ runner.os }}" = "Linux" ]; then - apt update && apt install libpcre2-dev + sudo apt update && sudo apt install libpcre2-dev else echo "Unknown OS" fi From d4eedff704e2cf55a0ff397f9713b8dd74109406 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:31:51 +0800 Subject: [PATCH 6/9] [CI] install with -e --- .github/workflows/unit_tests.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 5fdaf36..ee1561f 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -74,7 +74,9 @@ jobs: fi - name: install - run: pip install . pytest + run: | + pip install pytest + pip install -v -e . - name: test_close.py run: pytest --durations=0 tests/${{ matrix.test_script }}.py @@ -104,7 +106,8 @@ jobs: python -V python -m venv venv . venv/bin/activate - pip install . pytest + pip install pytest + pip install -v -e . pytest --durations=0 tests/${{ matrix.test_script }}.py solaris: @@ -131,7 +134,8 @@ jobs: python -V python -m venv venv source venv/bin/activate - pip install . pytest + pip install pytest + pip install -v -e . pytest --durations=0 tests/${{ matrix.test_script }}.py wsl: @@ -158,5 +162,6 @@ jobs: run: | python3 -m venv venv source venv/bin/activate - pip install . pytest + pip install pytest + pip install -v -e . pytest --durations=0 tests/${{ matrix.test_script }}.py From e7832765e4f4659febe6c467146914d83afb3555 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:46:16 +0800 Subject: [PATCH 7/9] [CI] install tabulate --- .github/workflows/unit_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index ee1561f..8884790 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -75,7 +75,7 @@ jobs: - name: install run: | - pip install pytest + pip install pytest tabulate pip install -v -e . - name: test_close.py @@ -106,7 +106,7 @@ jobs: python -V python -m venv venv . venv/bin/activate - pip install pytest + pip install pytest tabulate pip install -v -e . pytest --durations=0 tests/${{ matrix.test_script }}.py @@ -134,7 +134,7 @@ jobs: python -V python -m venv venv source venv/bin/activate - pip install pytest + pip install pytest tabulate pip install -v -e . pytest --durations=0 tests/${{ matrix.test_script }}.py @@ -162,6 +162,6 @@ jobs: run: | python3 -m venv venv source venv/bin/activate - pip install pytest + pip install pytest tabulate pip install -v -e . pytest --durations=0 tests/${{ matrix.test_script }}.py From f2f7d24a63b998bcb409efedbef01b897edde8ff Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:49:27 +0800 Subject: [PATCH 8/9] [CI] fix job's name --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8884790..24fe9f4 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -78,7 +78,7 @@ jobs: pip install pytest tabulate pip install -v -e . - - name: test_close.py + - name: test ${{ matrix.test_script }} run: pytest --durations=0 tests/${{ matrix.test_script }}.py From c9ad6b1e64fd1e9ed79df98c389edf502a4657ae Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Thu, 9 Oct 2025 10:52:42 +0800 Subject: [PATCH 9/9] [CI] fix empty test error --- tests/test_bench_string.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_bench_string.py b/tests/test_bench_string.py index 9fddb7a..3986e9a 100644 --- a/tests/test_bench_string.py +++ b/tests/test_bench_string.py @@ -147,6 +147,9 @@ def main() -> None: print(_render_table(baseline, candidate)) +# fix CI empty test error +def test_bench() -> None: + print() if __name__ == "__main__": main()