Fusion fixes #457
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test-coverage: | |
runs-on: ubuntu-20.04 | |
services: | |
singlestore: | |
image: ghcr.io/singlestore-labs/singlestoredb-dev:latest | |
ports: | |
- 3306:3306 | |
- 8080:8080 | |
- 9000:9000 | |
env: | |
SINGLESTORE_LICENSE: ${{ secrets.SINGLESTORE_LICENSE }} | |
ROOT_PASSWORD: "root" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r test-requirements.txt | |
- name: Install SingleStore package | |
run: | | |
python setup.py install | |
- name: Run MySQL protocol tests | |
run: | | |
pytest -q --cov=singlestoredb singlestoredb/tests | |
env: | |
COVERAGE_FILE: "coverage-mysql.cov" | |
SINGLESTOREDB_URL: "root:[email protected]:3306" | |
SINGLESTOREDB_PURE_PYTHON: 0 | |
SINGLESTOREDB_MANAGEMENT_TOKEN: ${{ secrets.CLUSTER_API_KEY }} | |
- name: Run MySQL protocol tests (pure Python) | |
run: | | |
pytest -q -m 'not management' --cov=singlestoredb singlestoredb/tests | |
env: | |
COVERAGE_FILE: "coverage-mysql-py.cov" | |
SINGLESTOREDB_URL: "root:[email protected]:3306" | |
SINGLESTOREDB_PURE_PYTHON: 1 | |
SINGLESTOREDB_MANAGEMENT_TOKEN: ${{ secrets.CLUSTER_API_KEY }} | |
- name: Run HTTP protocol tests | |
run: | | |
pytest -q -m 'not management' --cov=singlestoredb singlestoredb/tests | |
env: | |
COVERAGE_FILE: "coverage-http.cov" | |
SINGLESTOREDB_URL: "http://root:[email protected]:9000" | |
SINGLESTOREDB_MANAGEMENT_TOKEN: ${{ secrets.CLUSTER_API_KEY }} | |
# Can not change databases using HTTP API. The URL below will be | |
# used to create the database and the generated database name will | |
# be applied to the above URL. | |
SINGLESTOREDB_INIT_DB_URL: "root:[email protected]:3306" | |
- name: Generate report | |
run: | | |
coverage combine coverage-mysql.cov coverage-http.cov coverage-mysql-py.cov | |
coverage report | |
coverage xml | |
coverage html |