diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9559060..133e11a 100755 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,6 +1,12 @@ name: Tests on: + workflow_dispatch: + inputs: + commit_hash: + description: 'The git commit hash to compare against' + required: true + default: 'fa5accc63ac39840422ff0d6b0ee875706c95e90' # legacy main branch commit hash push: pull_request: branches: [ main ] @@ -21,38 +27,47 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install msccl and dependencies + - name: Install msccl-tools and dependencies run: | pip install --upgrade pip pip install -r requirements.txt - - name: Run tests and check at least 85% coverage + - name: Run tests and check at least 90% coverage run: | pytest compare_outputs: runs-on: ubuntu-latest - name: Compare outputs + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10'] + name: Compare outputs with Python ${{ matrix.python-version }} steps: - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Checkout current branch uses: actions/checkout@v4 - - name: Install msccl and dependencies + - name: Install msccl-tools and dependencies run: | pip install --upgrade pip pip install -r requirements.txt - name: Copy test script/config to temp directory run: | - cp tests/generate_exmpale_results.py $RUNNER_TEMP/ - cp tests/configs/example-config.json $RUNNER_TEMP/ + cp tests/generate_test_results.py $RUNNER_TEMP/ + cp tests/configs/test-config.json $RUNNER_TEMP/ - name: generate outputs run: | - python $RUNNER_TEMP/generate_exmpale_results.py examples/mscclang/ $RUNNER_TEMP/example-config.json $RUNNER_TEMP/tests/pr-outputs/ + python $RUNNER_TEMP/generate_test_results.py examples/mscclang/ $RUNNER_TEMP/test-config.json $RUNNER_TEMP/tests/pr-outputs/ + - name: Checkout specific branch + if: github.event_name == 'workflow_dispatch' + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.commit_hash }} - name: Checkout main branch uses: actions/checkout@v4 + if: github.event_name == 'pull_request' || github.event_name == 'push' with: ref: main - name: Install msccl and dependencies @@ -61,7 +76,7 @@ jobs: pip install -r requirements.txt - name: generate outputs run: | - python $RUNNER_TEMP/generate_exmpale_results.py examples/mscclang/ $RUNNER_TEMP/example-config.json $RUNNER_TEMP/tests/main-outputs/ + python $RUNNER_TEMP/generate_test_results.py examples/mscclang/ $RUNNER_TEMP/test-config.json $RUNNER_TEMP/tests/main-outputs/ - name: Compare outputs run: | diff -rw $RUNNER_TEMP/tests/main-outputs/ $RUNNER_TEMP/tests/pr-outputs/ diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/SECURITY.md b/SECURITY.md old mode 100755 new mode 100644 index f7b8998..926b8ae --- a/SECURITY.md +++ b/SECURITY.md @@ -38,4 +38,4 @@ We prefer all communications to be in English. Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - \ No newline at end of file + diff --git a/SUPPORT.md b/SUPPORT.md old mode 100755 new mode 100644 diff --git a/pytest.ini b/pytest.ini index 4621e92..d68bf05 100755 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,2 @@ [pytest] -addopts = --cov=msccl --cov-report term-missing:skip-covered --cov-fail-under 85 -n auto +addopts = --cov=msccl --cov-report term-missing:skip-covered --cov-fail-under 90 -n auto diff --git a/tests/configs/example-config.json b/tests/configs/test-config.json similarity index 100% rename from tests/configs/example-config.json rename to tests/configs/test-config.json diff --git a/tests/generate_exmpale_results.py b/tests/generate_test_results.py similarity index 100% rename from tests/generate_exmpale_results.py rename to tests/generate_test_results.py