E2e passing tests (#576)
Browse files* 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 +0 -32
- .github/workflows/pre-commit.yml +0 -16
- .github/workflows/tests.yml +44 -2
.github/workflows/e2e.yml
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
name: E2E
|
| 2 |
-
on:
|
| 3 |
-
workflow_dispatch:
|
| 4 |
-
|
| 5 |
-
jobs:
|
| 6 |
-
e2e-test:
|
| 7 |
-
runs-on: [self-hosted, gpu]
|
| 8 |
-
strategy:
|
| 9 |
-
fail-fast: false
|
| 10 |
-
matrix:
|
| 11 |
-
python_version: ["3.10"]
|
| 12 |
-
timeout-minutes: 10
|
| 13 |
-
|
| 14 |
-
steps:
|
| 15 |
-
- name: Check out repository code
|
| 16 |
-
uses: actions/checkout@v3
|
| 17 |
-
|
| 18 |
-
- name: Setup Python
|
| 19 |
-
uses: actions/setup-python@v4
|
| 20 |
-
with:
|
| 21 |
-
python-version: ${{ matrix.python_version }}
|
| 22 |
-
cache: 'pip' # caching pip dependencies
|
| 23 |
-
|
| 24 |
-
- name: Install dependencies
|
| 25 |
-
run: |
|
| 26 |
-
pip3 install -e .
|
| 27 |
-
pip3 install flash-attn
|
| 28 |
-
pip3 install -r requirements-tests.txt
|
| 29 |
-
|
| 30 |
-
- name: Run e2e tests
|
| 31 |
-
run: |
|
| 32 |
-
pytest tests/e2e/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/pre-commit.yml
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
name: pre-commit
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
pull_request:
|
| 5 |
-
push:
|
| 6 |
-
|
| 7 |
-
jobs:
|
| 8 |
-
pre-commit:
|
| 9 |
-
runs-on: ubuntu-latest
|
| 10 |
-
steps:
|
| 11 |
-
- uses: actions/checkout@v3
|
| 12 |
-
- uses: actions/setup-python@v4
|
| 13 |
-
with:
|
| 14 |
-
python-version: "3.9"
|
| 15 |
-
cache: 'pip' # caching pip dependencies
|
| 16 |
-
- uses: pre-commit/[email protected]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/tests.yml
CHANGED
|
@@ -1,10 +1,26 @@
|
|
| 1 |
-
name:
|
| 2 |
on:
|
|
|
|
| 3 |
push:
|
|
|
|
|
|
|
| 4 |
pull_request:
|
|
|
|
| 5 |
|
| 6 |
jobs:
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
runs-on: ubuntu-latest
|
| 9 |
strategy:
|
| 10 |
fail-fast: false
|
|
@@ -30,3 +46,29 @@ jobs:
|
|
| 30 |
- name: Run tests
|
| 31 |
run: |
|
| 32 |
pytest --ignore=tests/e2e/ tests/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Tests
|
| 2 |
on:
|
| 3 |
+
# check on push/merge to main, PRs, and manual triggers
|
| 4 |
push:
|
| 5 |
+
branches:
|
| 6 |
+
- "main"
|
| 7 |
pull_request:
|
| 8 |
+
workflow_dispatch:
|
| 9 |
|
| 10 |
jobs:
|
| 11 |
+
pre-commit:
|
| 12 |
+
name: pre-commit
|
| 13 |
+
runs-on: ubuntu-latest
|
| 14 |
+
steps:
|
| 15 |
+
- uses: actions/checkout@v3
|
| 16 |
+
- uses: actions/setup-python@v4
|
| 17 |
+
with:
|
| 18 |
+
python-version: "3.9"
|
| 19 |
+
cache: 'pip' # caching pip dependencies
|
| 20 |
+
- uses: pre-commit/[email protected]
|
| 21 |
+
|
| 22 |
+
pytest:
|
| 23 |
+
name: PyTest
|
| 24 |
runs-on: ubuntu-latest
|
| 25 |
strategy:
|
| 26 |
fail-fast: false
|
|
|
|
| 46 |
- name: Run tests
|
| 47 |
run: |
|
| 48 |
pytest --ignore=tests/e2e/ tests/
|
| 49 |
+
|
| 50 |
+
e2e-test:
|
| 51 |
+
name: E2E Tests
|
| 52 |
+
runs-on: [self-hosted, gpu]
|
| 53 |
+
timeout-minutes: 20
|
| 54 |
+
needs: [pre-commit, pytest]
|
| 55 |
+
|
| 56 |
+
steps:
|
| 57 |
+
- name: Check out repository code
|
| 58 |
+
uses: actions/checkout@v3
|
| 59 |
+
|
| 60 |
+
- name: Setup Python
|
| 61 |
+
uses: actions/setup-python@v4
|
| 62 |
+
with:
|
| 63 |
+
python-version: "3.10"
|
| 64 |
+
cache: 'pip' # caching pip dependencies
|
| 65 |
+
|
| 66 |
+
- name: Install dependencies
|
| 67 |
+
run: |
|
| 68 |
+
pip3 install -e .
|
| 69 |
+
pip3 install flash-attn
|
| 70 |
+
pip3 install -r requirements-tests.txt
|
| 71 |
+
|
| 72 |
+
- name: Run e2e tests
|
| 73 |
+
run: |
|
| 74 |
+
pytest tests/e2e/
|