2021-07-12 03:00:18 -04:00
|
|
|
# Python integration tests
|
|
|
|
name: Python-Integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-01-23 23:30:53 -05:00
|
|
|
branches:
|
2024-03-06 12:23:07 -05:00
|
|
|
- "master"
|
|
|
|
- "[0-9].[0-9]"
|
2021-07-12 03:00:18 -04:00
|
|
|
pull_request:
|
|
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
|
|
|
|
2024-01-31 02:03:25 -05:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-07-12 03:00:18 -04:00
|
|
|
jobs:
|
|
|
|
test-mysql:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
env:
|
|
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
|
|
|
|
REDIS_PORT: 16379
|
|
|
|
SUPERSET__SQLALCHEMY_DATABASE_URI: |
|
|
|
|
mysql+mysqldb://superset:superset@127.0.0.1:13306/superset?charset=utf8mb4&binary_prefix=true
|
|
|
|
services:
|
|
|
|
mysql:
|
|
|
|
image: mysql:5.7
|
|
|
|
env:
|
|
|
|
MYSQL_ROOT_PASSWORD: root
|
|
|
|
ports:
|
|
|
|
- 13306:3306
|
2024-04-15 18:49:09 -04:00
|
|
|
options: >-
|
|
|
|
--health-cmd="mysqladmin ping --silent"
|
|
|
|
--health-interval=10s
|
|
|
|
--health-timeout=5s
|
|
|
|
--health-retries=5
|
2021-07-12 03:00:18 -04:00
|
|
|
redis:
|
2023-01-16 10:45:32 -05:00
|
|
|
image: redis:7-alpine
|
2021-07-12 03:00:18 -04:00
|
|
|
options: --entrypoint redis-server
|
|
|
|
ports:
|
|
|
|
- 16379:6379
|
|
|
|
steps:
|
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
2021-07-12 03:00:18 -04:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2024-04-08 19:20:25 -04:00
|
|
|
- name: Check for file changes
|
2021-07-12 03:00:18 -04:00
|
|
|
id: check
|
2024-04-08 19:20:25 -04:00
|
|
|
uses: ./.github/actions/change-detector/
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-07-12 03:00:18 -04:00
|
|
|
- name: Setup Python
|
2024-03-18 21:39:41 -04:00
|
|
|
uses: ./.github/actions/setup-backend/
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2024-03-18 21:39:41 -04:00
|
|
|
- name: Setup MySQL
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
|
|
|
with:
|
2024-04-10 17:32:30 -04:00
|
|
|
run: setup-mysql
|
2021-07-12 03:00:18 -04:00
|
|
|
- name: Run celery
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
|
|
|
|
- name: Python integration tests (MySQL)
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: |
|
|
|
|
./scripts/python_tests.sh
|
|
|
|
- name: Upload code coverage
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: |
|
|
|
|
bash .github/workflows/codecov.sh -c -F python -F mysql
|
|
|
|
test-postgres:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-10 17:32:30 -04:00
|
|
|
python-version: ["current", "next"]
|
2021-07-12 03:00:18 -04:00
|
|
|
env:
|
|
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
|
|
|
|
REDIS_PORT: 16379
|
|
|
|
SUPERSET__SQLALCHEMY_DATABASE_URI: postgresql+psycopg2://superset:superset@127.0.0.1:15432/superset
|
|
|
|
services:
|
|
|
|
postgres:
|
2023-07-24 13:09:41 -04:00
|
|
|
image: postgres:15-alpine
|
2021-07-12 03:00:18 -04:00
|
|
|
env:
|
|
|
|
POSTGRES_USER: superset
|
|
|
|
POSTGRES_PASSWORD: superset
|
|
|
|
ports:
|
|
|
|
# Use custom ports for services to avoid accidentally connecting to
|
|
|
|
# GitHub action runner's default installations
|
|
|
|
- 15432:5432
|
|
|
|
redis:
|
2023-01-16 10:45:32 -05:00
|
|
|
image: redis:7-alpine
|
2021-07-12 03:00:18 -04:00
|
|
|
ports:
|
|
|
|
- 16379:6379
|
|
|
|
steps:
|
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
2021-07-12 03:00:18 -04:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2024-04-08 19:20:25 -04:00
|
|
|
- name: Check for file changes
|
2021-07-12 03:00:18 -04:00
|
|
|
id: check
|
2024-04-08 19:20:25 -04:00
|
|
|
uses: ./.github/actions/change-detector/
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-07-12 03:00:18 -04:00
|
|
|
- name: Setup Python
|
2024-03-18 21:39:41 -04:00
|
|
|
uses: ./.github/actions/setup-backend/
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2024-03-18 21:39:41 -04:00
|
|
|
- name: Setup Postgres
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
setup-postgres
|
|
|
|
- name: Run celery
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
|
|
|
|
- name: Python integration tests (PostgreSQL)
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: |
|
|
|
|
./scripts/python_tests.sh
|
|
|
|
- name: Upload code coverage
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: |
|
|
|
|
bash .github/workflows/codecov.sh -c -F python -F postgres
|
|
|
|
|
|
|
|
test-sqlite:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
env:
|
|
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
|
|
|
|
REDIS_PORT: 16379
|
|
|
|
SUPERSET__SQLALCHEMY_DATABASE_URI: |
|
2024-01-08 12:33:47 -05:00
|
|
|
sqlite:///${{ github.workspace }}/.temp/superset.db?check_same_thread=true
|
|
|
|
SUPERSET__SQLALCHEMY_EXAMPLES_URI: |
|
|
|
|
sqlite:///${{ github.workspace }}/.temp/examples.db?check_same_thread=true
|
2021-07-12 03:00:18 -04:00
|
|
|
services:
|
|
|
|
redis:
|
2023-01-16 10:45:32 -05:00
|
|
|
image: redis:7-alpine
|
2021-07-12 03:00:18 -04:00
|
|
|
ports:
|
|
|
|
- 16379:6379
|
|
|
|
steps:
|
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
2021-07-12 03:00:18 -04:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2024-04-08 19:20:25 -04:00
|
|
|
- name: Check for file changes
|
2021-07-12 03:00:18 -04:00
|
|
|
id: check
|
2024-04-08 19:20:25 -04:00
|
|
|
uses: ./.github/actions/change-detector/
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-07-12 03:00:18 -04:00
|
|
|
- name: Setup Python
|
2024-03-18 21:39:41 -04:00
|
|
|
uses: ./.github/actions/setup-backend/
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
- name: Install dependencies
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
|
|
|
with:
|
|
|
|
run: |
|
2024-03-18 21:39:41 -04:00
|
|
|
# sqlite needs this working directory
|
2021-07-12 03:00:18 -04:00
|
|
|
mkdir ${{ github.workspace }}/.temp
|
|
|
|
- name: Run celery
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
|
|
|
|
- name: Python integration tests (SQLite)
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: |
|
|
|
|
./scripts/python_tests.sh
|
|
|
|
- name: Upload code coverage
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-07-12 03:00:18 -04:00
|
|
|
run: |
|
|
|
|
bash .github/workflows/codecov.sh -c -F python -F sqlite
|