2020-11-24 14:40:16 -05:00
|
|
|
# Python Presto/Hive unit tests
|
|
|
|
name: Python Presto/Hive
|
|
|
|
|
2021-01-07 03:47:00 -05:00
|
|
|
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-01-07 03:47:00 -05:00
|
|
|
pull_request:
|
2021-01-21 19:10:17 -05:00
|
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
2020-11-24 14:40:16 -05:00
|
|
|
|
2024-02-01 10:08:41 -05:00
|
|
|
# cancel previous workflow jobs for PRs
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-11-24 14:40:16 -05:00
|
|
|
jobs:
|
|
|
|
test-postgres-presto:
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
env:
|
|
|
|
PYTHONPATH: ${{ github.workspace }}
|
2021-07-01 11:03:07 -04:00
|
|
|
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
|
2020-11-24 14:40:16 -05:00
|
|
|
REDIS_PORT: 16379
|
|
|
|
SUPERSET__SQLALCHEMY_DATABASE_URI: postgresql+psycopg2://superset:superset@127.0.0.1:15432/superset
|
|
|
|
SUPERSET__SQLALCHEMY_EXAMPLES_URI: presto://localhost:15433/memory/default
|
|
|
|
services:
|
|
|
|
postgres:
|
2023-07-24 13:09:41 -04:00
|
|
|
image: postgres:15-alpine
|
2020-11-24 14:40:16 -05: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
|
|
|
|
presto:
|
2021-03-23 23:11:58 -04:00
|
|
|
image: starburstdata/presto:350-e.6
|
2020-11-24 14:40:16 -05: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
|
|
|
|
- 15433:8080
|
|
|
|
redis:
|
2023-01-16 10:45:32 -05:00
|
|
|
image: redis:7-alpine
|
2020-11-24 14:40:16 -05:00
|
|
|
ports:
|
|
|
|
- 16379:6379
|
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2024-04-08 19:20:25 -04:00
|
|
|
- name: Check for file changes
|
2021-02-05 10:40:08 -05:00
|
|
|
id: check
|
2024-04-08 19:20:25 -04:00
|
|
|
uses: ./.github/actions/change-detector/
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2020-11-24 14:40:16 -05: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 == 'true'
|
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-01-04 07:16:07 -05:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
2020-11-24 14:40:16 -05:00
|
|
|
with:
|
2024-04-08 19:20:25 -04:00
|
|
|
run: |
|
|
|
|
echo "${{ steps.check.outputs.python }}"
|
|
|
|
setup-postgres
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Run celery
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-06-08 23:18:55 -04:00
|
|
|
run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Python unit tests (PostgreSQL)
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2020-11-24 14:40:16 -05:00
|
|
|
run: |
|
2021-12-31 00:17:54 -05:00
|
|
|
./scripts/python_tests.sh -m 'chart_data_flow or sql_json_flow'
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Upload code coverage
|
2024-04-30 18:32:33 -04:00
|
|
|
uses: codecov/codecov-action@v4
|
|
|
|
with:
|
|
|
|
flags: python,presto
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
verbose: true
|
2020-11-24 14:40:16 -05:00
|
|
|
|
|
|
|
test-postgres-hive:
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
env:
|
|
|
|
PYTHONPATH: ${{ github.workspace }}
|
2021-07-01 11:03:07 -04:00
|
|
|
SUPERSET_CONFIG: tests.integration_tests.superset_test_config
|
2020-11-24 14:40:16 -05:00
|
|
|
REDIS_PORT: 16379
|
|
|
|
SUPERSET__SQLALCHEMY_DATABASE_URI: postgresql+psycopg2://superset:superset@127.0.0.1:15432/superset
|
|
|
|
SUPERSET__SQLALCHEMY_EXAMPLES_URI: hive://localhost:10000/default
|
|
|
|
UPLOAD_FOLDER: /tmp/.superset/uploads/
|
|
|
|
services:
|
|
|
|
postgres:
|
2023-07-24 13:09:41 -04:00
|
|
|
image: postgres:15-alpine
|
2020-11-24 14:40:16 -05: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
|
2020-11-24 14:40:16 -05:00
|
|
|
ports:
|
|
|
|
- 16379:6379
|
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2024-04-08 19:20:25 -04:00
|
|
|
- name: Check for file changes
|
2021-02-05 10:40:08 -05:00
|
|
|
id: check
|
2024-04-08 19:20:25 -04:00
|
|
|
uses: ./.github/actions/change-detector/
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Create csv upload directory
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2020-11-24 14:40:16 -05:00
|
|
|
run: sudo mkdir -p /tmp/.superset/uploads
|
|
|
|
- name: Give write access to the csv upload directory
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2020-11-24 14:40:16 -05:00
|
|
|
run: sudo chown -R $USER:$USER /tmp/.superset
|
|
|
|
- name: Start hadoop and hive
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2023-10-10 17:38:40 -04:00
|
|
|
run: docker compose -f scripts/databases/hive/docker-compose.yml up -d
|
2020-11-24 14:40:16 -05: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 Postgres
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-01-04 07:16:07 -05:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
2020-11-24 14:40:16 -05:00
|
|
|
with:
|
2024-03-18 21:39:41 -04:00
|
|
|
run: setup-postgres
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Run celery
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-06-08 23:18:55 -04:00
|
|
|
run: celery --app=superset.tasks.celery_app:app worker -Ofair -c 2 &
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Python unit tests (PostgreSQL)
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2020-11-24 14:40:16 -05:00
|
|
|
run: |
|
2021-12-31 00:17:54 -05:00
|
|
|
./scripts/python_tests.sh -m 'chart_data_flow or sql_json_flow'
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Upload code coverage
|
2024-04-30 18:32:33 -04:00
|
|
|
uses: codecov/codecov-action@v4
|
|
|
|
with:
|
|
|
|
flags: python,hive
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
verbose: true
|