From 1078d3eae7b947da13b81dd7cffedf5ab773b063 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Fri, 15 Sep 2023 01:03:49 -0400 Subject: [PATCH] E2e passing tests (#576) * run e2e tests after all other checks have passed * tweak tests so they get run on PRs or push to main * change dependent action for chcecking * one test workflow to rule them all * no need for custom action, just use needs * whoops, python version should be a string * e2e tests can run on any available gpu --- .github/workflows/e2e.yml | 32 ---------------------- .github/workflows/pre-commit.yml | 16 ----------- .github/workflows/tests.yml | 46 ++++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/e2e.yml delete mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index 09c26c2a67..0000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: E2E -on: - workflow_dispatch: - -jobs: - e2e-test: - runs-on: [self-hosted, gpu] - strategy: - fail-fast: false - matrix: - python_version: ["3.10"] - timeout-minutes: 10 - - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - cache: 'pip' # caching pip dependencies - - - name: Install dependencies - run: | - pip3 install -e . - pip3 install flash-attn - pip3 install -r requirements-tests.txt - - - name: Run e2e tests - run: | - pytest tests/e2e/ diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 626edc6868..0000000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.9" - cache: 'pip' # caching pip dependencies - - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a2ee392626..017c1b1b6b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,10 +1,26 @@ -name: PyTest +name: Tests on: + # check on push/merge to main, PRs, and manual triggers push: + branches: + - "main" pull_request: + workflow_dispatch: jobs: - test: + pre-commit: + name: pre-commit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.9" + cache: 'pip' # caching pip dependencies + - uses: pre-commit/action@v3.0.0 + + pytest: + name: PyTest runs-on: ubuntu-latest strategy: fail-fast: false @@ -30,3 +46,29 @@ jobs: - name: Run tests run: | pytest --ignore=tests/e2e/ tests/ + + e2e-test: + name: E2E Tests + runs-on: [self-hosted, gpu] + timeout-minutes: 20 + needs: [pre-commit, pytest] + + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: 'pip' # caching pip dependencies + + - name: Install dependencies + run: | + pip3 install -e . + pip3 install flash-attn + pip3 install -r requirements-tests.txt + + - name: Run e2e tests + run: | + pytest tests/e2e/