-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] Refactor integration test to use wheel built for release (#1087)
* Refactors integration test workflow to build a wheel (similar to how we build for release) instead of doing a `maturin develop --release` in-place build with llvm-cov --------- Co-authored-by: Jay Chia <[email protected]@users.noreply.github.com>
- Loading branch information
Showing
1 changed file
with
56 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,19 +106,27 @@ jobs: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
integration-tests: | ||
integration-test-build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
env: | ||
package-name: getdaft | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7'] | ||
daft-runner: [py, ray] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: moonrepo/setup-rust@v0 | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- run: pip install -U twine toml | ||
- run: python tools/patch_package_version.py | ||
- name: Install Rust toolchain | ||
uses: moonrepo/setup-rust@v0 | ||
- uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-cargo | ||
|
@@ -131,36 +139,61 @@ jobs: | |
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
- name: Build wheels - x86 | ||
uses: messense/maturin-action@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Virtual Env | ||
run: | | ||
python -m venv venv | ||
echo "$GITHUB_WORKSPACE/venv/bin" >> $GITHUB_PATH | ||
target: x86_64 | ||
manylinux: auto | ||
# NOTE: we don't build with all the actual release optimizations to avoid hellish CI times | ||
args: --release --out dist --sdist | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
- name: Install dependencies | ||
integration-test-tpch: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
needs: | ||
- integration-test-build | ||
env: | ||
package-name: getdaft | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7'] | ||
daft-runner: [py, ray] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- name: Download built wheels | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
- name: Install Daft and dev dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
pip install dist/${{ env.package-name }}-*x86_64*.whl --force-reinstall | ||
rm -rf daft | ||
- uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-tpch-data | ||
with: | ||
path: data/tpch-dbgen | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('tests/integration/test_tpch.py', 'benchmarking/tpch/**') }} | ||
|
||
- name: Build library in release mode and run TPCH integration tests | ||
- name: Run TPCH integration tests | ||
run: | | ||
source activate | ||
maturin develop --release | ||
pytest tests/integration/ --durations=50 | ||
pytest tests/integration/test_tpch.py --durations=50 | ||
env: | ||
DAFT_RUNNER: ${{ matrix.daft-runner }} | ||
|
||
- name: Send Slack notification on failure | ||
uses: slackapi/[email protected] | ||
if: ${{ failure() && (github.ref == 'refs/heads/main') }} | ||
|