-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[misc] acceptance test GHA workflow (#897)
* full unit test workflow for python * temp addition of pull-request event to register workflow * add build tools install * add missing flag * add git install * debugging * more debugging * bump setup deps for package build * even more debugging * more debugging * clean up debug code * reorganize * rename * reorg files * first attempt at an R test * remove pull_request * remove testthat pkg * iterating.... * add cmake * install local package * refinement * debugging * refinement for OOM logging * fix some typos * comments * improve python logging * disable fast-fail of jobs * test smaller buffer for R * use smaller buffers * PR review f/b * add tiledbsoma package spec * debugging * remove debugging code * new LTS census has no unique cells in previous test range * add comments on usage * link back to PR * cap memory use for R acceptance tests * set job timeout to 24 hours
- Loading branch information
Bruce Martin
committed
Dec 20, 2023
1 parent
7cca895
commit 2f2bfd7
Showing
5 changed files
with
146 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,127 @@ | ||
name: cellxgene_census package full unit tests | ||
|
||
# Run all unit tests, including those that are too expensive to run frequently. | ||
# This workflow requires a very large capacity runner, e.g., 1+TiB RAM, which is | ||
# currently available through self-hosted runners. These runners have no swap, | ||
# so an OOM will cause the workflow to fail with OOMKilled (exit code 137). | ||
# | ||
# By default, will install from `main` and run the latest acceptance tests in `main`. | ||
# | ||
# gh workflow run full-unittests.yml | ||
# | ||
# You can run it against a branch with: | ||
# | ||
# gh workflow run full-unittests.yml --ref _branch_name_ | ||
# | ||
# The python (not R) job supports installing a specific `tiledbsoma` version, allowing | ||
# the test to run with any tiledbsoma version, including branches from the TileDB-SOMA | ||
# repo. For example, to test against the head of main, do: | ||
# | ||
# gh workflow run full-unittests.yml \ | ||
# -f 'tiledbsoma_python_dependency=git+https://github.com/single-cell-data/TileDB-SOMA.git#egg=tiledbsoma&subdirectory=apis/python/' | ||
|
||
on: | ||
schedule: | ||
- cron: "0 1 * * 6" # every Saturday night, 1AM UTC | ||
|
||
workflow_dispatch: # used for debugging or manual validation of a branch | ||
inputs: | ||
tiledbsoma_python_dependency: | ||
# Accepts any package spec that pip understand, e.g., | ||
# tiledbsoma==1.0 | ||
# git+https://github.com/single-cell-data/TileDB-SOMA.git#egg=tiledbsoma&subdirectory=apis/python/ | ||
# git+https://github.com/single-cell-data/[email protected]#egg=tiledbsoma&subdirectory=apis/python/ | ||
# or whatever... | ||
description: "tiledbsoma package specified as pip requirement" | ||
required: false | ||
default: "" | ||
type: string | ||
|
||
jobs: | ||
py_unit_tests: | ||
runs-on: single-cell-1tb-runner | ||
timeout-minutes: 1440 # 24 hour timeout | ||
strategy: | ||
fail-fast: false # prevent this job from killing other jobs | ||
steps: | ||
- name: log system state | ||
run: | | ||
free | ||
echo --------- | ||
df -kh | ||
echo --------- | ||
lscpu | ||
- name: install OS dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y build-essential git-all libxml2-dev libssl-dev libcurl4-openssl-dev cmake | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: install python dependencies (including experimental) | ||
run: | | ||
python -m pip install -U pip setuptools setuptools_scm wheel | ||
pip install --use-pep517 accumulation-tree # Geneformer dependency needs --use-pep517 for Cython | ||
pip install -r ./api/python/cellxgene_census/scripts/requirements-dev.txt | ||
pip install './api/python/cellxgene_census/[experimental]' | ||
- name: install tiledbsoma version override | ||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tiledbsoma_python_dependency != '' | ||
run: | | ||
# Due to a bug in the tiledbsoma setup, this must be installed editable, ie., `-e`. | ||
# Filed as single-cell-data/TileDB-SOMA#1991 | ||
# PR https://github.com/single-cell-data/TileDB-SOMA/pull/1937 will resolve the | ||
# issue and allow removal of `-e` | ||
pip install -e '${{ github.event.inputs.tiledbsoma_python_dependency }}' | ||
- name: pytest (--expensive --experimental) | ||
run: | | ||
echo '--------- tiledbsoma.show_package_version():' | ||
python -c 'import tiledbsoma; tiledbsoma.show_package_versions()' | ||
echo '--------- PIP package versions:' | ||
pip freeze | ||
PYTHONPATH=. pytest -v --durations=0 -rP --experimental --expensive ./api/python/cellxgene_census/tests/ | ||
r_unit_tests: | ||
runs-on: single-cell-1tb-runner | ||
timeout-minutes: 1440 # 24 hour timeout | ||
strategy: | ||
fail-fast: false # prevent this job from killing other jobs | ||
steps: | ||
- name: log system state | ||
run: | | ||
free | ||
echo --------- | ||
df -kh | ||
echo --------- | ||
lscpu | ||
- name: install OS dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y build-essential git-all libxml2-dev libssl-dev libcurl4-openssl-dev cmake | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
extra-repositories: https://tiledb-inc.r-universe.dev, https://cloud.r-project.org, https://chanzuckerberg.r-universe.dev | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
working-directory: ./api/r/cellxgene.census | ||
extra-packages: any::rcmdcheck, any::remotes | ||
cache: true | ||
|
||
- name: testthat | ||
run: | | ||
Rscript -e 'remotes::install_local("./api/r/cellxgene.census")' | ||
Rscript -e 'library("tiledbsoma"); tiledbsoma::show_package_versions()' | ||
Rscript -e 'library("testthat"); library("cellxgene.census"); test_dir("./api/r/cellxgene.census/tests/")' | ||
Rscript -e 'library("cellxgene.census"); library(testthat); test_file("./api/r/cellxgene.census/tests/testthat/acceptance-tests.R")' |
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
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
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
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