feat: move clickhouse load to luigi #3891
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: unit tests | |
| # Run the test suite on pushes (incl. merges) to main and dev | |
| # Run the test suite when a PR is opened, pushed to, or reopened | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| unit_tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11'] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Create ClickHouse Config | |
| run: | | |
| cat <<EOF > test_config.xml | |
| <clickhouse> | |
| <user_files_path>/tmp</user_files_path> | |
| </clickhouse> | |
| EOF | |
| - name: Start ClickHouse with mounted config | |
| run: | | |
| docker run -d --name clickhouse \ | |
| -v ${{ github.workspace }}/test_config.xml:/etc/clickhouse-server/config.d/config.xml \ | |
| -v /tmp:/tmp \ | |
| -p 9000:9000 \ | |
| -e CLICKHOUSE_USER=default \ | |
| -e CLICKHOUSE_PASSWORD=default_password \ | |
| bitnamilegacy/clickhouse:latest | |
| - name: Wait for ClickHouse | |
| run: | | |
| until docker exec clickhouse clickhouse-client --query "SELECT 1"; do | |
| echo "Waiting for ClickHouse to start..." | |
| sleep 2 | |
| done | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements**.txt' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements-dataproc.txt | |
| pip install -r requirements-dev.txt | |
| - name: Check Ruff Format | |
| run: ruff format --check v03_pipeline --diff | |
| - name: Check Ruff | |
| run: ruff check --output-format github | |
| - name: Run ShellCheck | |
| uses: ludeeus/action-shellcheck@master | |
| with: | |
| severity: error | |
| scandir: './v03_pipeline/bin' | |
| - name: Unit Tests | |
| run: | | |
| export ACCESS_PRIVATE_REFERENCE_DATASETS=1 | |
| export CLICKHOUSE_OPTIMIZE_TABLE_WAIT_S=1 | |
| export PYSPARK_SUBMIT_ARGS='--driver-memory 8G pyspark-shell' | |
| export CLICKHOUSE_DATABASE=test | |
| export LOCAL_DISK_MOUNT_PATH=. | |
| nosetests --with-coverage --cover-package v03_pipeline v03_pipeline | |
| coverage report --omit '*test*' --fail-under=90 |