Test without HTTP #122
This file contains hidden or 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 ] | ||
workflow_dispatch: | ||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-latest | ||
services: | ||
singlestore: | ||
image: ghcr.io/singlestore-labs/singlestoredb-dev:latest | ||
ports: | ||
- 3307:3306 | ||
- 8081:8080 | ||
- 9080:9080 | ||
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.11" | ||
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 and SQLAlchemy 2.0.x | ||
run: | | ||
pip install 'sqlalchemy~=2.0.0' | ||
pip install . | ||
# - name: Run HTTP protocol tests | ||
# run: | | ||
# pytest -s -vv --cov=sqlalchemy_singlestoredb --pyargs sqlalchemy_singlestoredb.tests | ||
# env: | ||
# COVERAGE_FILE: "coverage-http.cov" | ||
# SINGLESTOREDB_URL: "http://root:[email protected]:9080" | ||
# 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]:3307" | ||
# SINGLESTOREDB_DEBUG_QUERIES: "1" | ||
- name: Run MySQL protocol tests | ||
run: | | ||
pytest -s -vv --cov=sqlalchemy_singlestoredb --pyargs sqlalchemy_singlestoredb.tests | ||
env: | ||
COVERAGE_FILE: "coverage-mysql-2-0.cov" | ||
SINGLESTOREDB_URL: "root:[email protected]:3307" | ||
SINGLESTOREDB_MANAGEMENT_TOKEN: ${{ secrets.CLUSTER_API_KEY }} | ||
- name: Install SingleStore package and SQLAlchemy 1.4.x | ||
run: | | ||
pip install 'sqlalchemy~=1.4.0' | ||
- name: Run MySQL protocol tests | ||
run: | | ||
pytest -s -vv --cov=sqlalchemy_singlestoredb --pyargs sqlalchemy_singlestoredb.tests | ||
env: | ||
COVERAGE_FILE: "coverage-mysql-1-4.cov" | ||
SINGLESTOREDB_URL: "root:[email protected]:3307" | ||
SINGLESTOREDB_MANAGEMENT_TOKEN: ${{ secrets.CLUSTER_API_KEY }} | ||
- name: Generate report | ||
run: | | ||
# coverage combine coverage-mysql-2-0.cov coverage-mysql-1-4.cov coverage-http.cov | ||
coverage combine coverage-mysql-2-0.cov coverage-mysql-1-4.cov | ||
coverage report | ||
coverage xml | ||
coverage html |