aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-05-11 21:57:43 +0300
committerAarni Koskela <akx@iki.fi>2023-05-19 17:42:34 +0300
commit793a491923ba11adbe1024e0eb0402923165dafa (patch)
treebf070c28ba3fff59e83e4bcbd3a0adb6e57f112f /.github
parentd41a31a50805fa70f7299f5c0384ad41db7142e5 (diff)
Overhaul tests to use py.test
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/run_tests.yaml49
1 files changed, 42 insertions, 7 deletions
diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml
index 0708398b..226cf759 100644
--- a/.github/workflows/run_tests.yaml
+++ b/.github/workflows/run_tests.yaml
@@ -18,18 +18,53 @@ jobs:
cache-dependency-path: |
**/requirements*txt
launch.py
- - name: Run tests
- run: python launch.py --tests test --no-half --disable-opt-split-attention --use-cpu all --skip-torch-cuda-test
+ - name: Install test dependencies
+ run: pip install wait-for-it -r requirements-test.txt
+ env:
+ PIP_DISABLE_PIP_VERSION_CHECK: "1"
+ PIP_PROGRESS_BAR: "off"
+ - name: Setup environment
+ run: python launch.py --skip-torch-cuda-test --exit
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
TORCH_INDEX_URL: https://download.pytorch.org/whl/cpu
WEBUI_LAUNCH_LIVE_OUTPUT: "1"
- - name: Upload main app stdout-stderr
+ PYTHONUNBUFFERED: "1"
+ - name: Start test server
+ run: >
+ python -m coverage run
+ --data-file=.coverage.server
+ launch.py
+ --skip-prepare-environment
+ --skip-torch-cuda-test
+ --test-server
+ --no-half
+ --disable-opt-split-attention
+ --use-cpu all
+ --add-stop-route
+ 2>&1 | tee output.txt &
+ - name: Run tests
+ run: |
+ wait-for-it --service 127.0.0.1:7860 -t 600
+ python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
+ - name: Kill test server
+ if: always()
+ run: curl -vv -XPOST http://127.0.0.1:7860/_stop && sleep 10
+ - name: Show coverage
+ run: |
+ python -m coverage combine .coverage*
+ python -m coverage report -i
+ python -m coverage html -i
+ - name: Upload main app output
+ uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: output
+ path: output.txt
+ - name: Upload coverage HTML
uses: actions/upload-artifact@v3
if: always()
with:
- name: stdout-stderr
- path: |
- test/stdout.txt
- test/stderr.txt
+ name: htmlcov
+ path: htmlcov