Skip to content

Switch to new scaling logic on image read #1149

Switch to new scaling logic on image read

Switch to new scaling logic on image read #1149

Workflow file for this run

name: Run tests
jobs:
test-cp:
name: Install and test Cellprofiler
strategy:
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# https://github.com/actions/runner-images/tree/main
# ensure macos tag uses architecture identical to setup-python (x64 vs arm)
os: [macos-13]
python-version: [3.9]
fail-fast: false
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
env:
CP_MYSQL_TEST_HOST: "127.0.0.1"
CP_MYSQL_TEST_DB: "cellprofiler_test"
CP_MYSQL_TEST_USER: "root"
CP_MYSQL_TEST_PASSWORD: "None"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# need to get git tags for setuptools-scm
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
# NOTE: if/when we move to a runner using apple M[1-3] (arm64)
# architecture we'll need to adjust:
# https://github.com/actions/setup-python/issues/108
architecture: x64
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "PIP_CACHE_DIR=$(pip cache dir)" >> "$GITHUB_OUTPUT"
- name: Cache pip
uses: actions/cache@v4
id: cache-pip
with:
path: ${{ steps.pip-cache-dir.outputs.PIP_CACHE_DIR }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
java-package: jdk
architecture: x64
- name: Mac - Install and setup mysql
if: startsWith(matrix.os, 'macos')
env:
LC_ALL: "en_US.UTF-8"
run: |
brew install mysql@8.4
brew link mysql@8.4 --force
mysql.server start
mysql --host=$CP_MYSQL_TEST_HOST --user=$CP_MYSQL_TEST_USER --execute="CREATE DATABASE $CP_MYSQL_TEST_DB;" --skip-password
- name: Install cellprofiler
working-directory: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -e src/subpackages/library
pip install -e src/subpackages/core
pip install -e src/frontend[test]
- name: Get all packages
run: |
pip freeze --all
- name: Run tests
run: |
pytest ${{ github.workspace }}/tests/frontend
test-core:
name: Install and test Core
strategy:
max-parallel: 4
matrix:
os: [macos-13]
python-version: [3.9]
fail-fast: false
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
env:
CP_MYSQL_TEST_HOST: "127.0.0.1"
CP_MYSQL_TEST_DB: "cellprofiler_test"
CP_MYSQL_TEST_USER: "root"
CP_MYSQL_TEST_PASSWORD: "None"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# need to get git tags for setuptools-scm
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
architecture: x64
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "PIP_CACHE_DIR=$(pip cache dir)" >> "$GITHUB_OUTPUT"
- name: Cache pip
uses: actions/cache@v4
id: cache-pip
with:
path: ${{ steps.pip-cache-dir.outputs.PIP_CACHE_DIR }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/setup.py') }}
- name: Install java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
java-package: jdk
architecture: x64
- name: Mac - Install and setup mysql
if: startsWith(matrix.os, 'macos')
env:
LC_ALL: "en_US.UTF-8"
run: |
brew install mysql@8.4
brew link mysql@8.4 --force
mysql.server start
mysql --host=$CP_MYSQL_TEST_HOST --user=$CP_MYSQL_TEST_USER --execute="CREATE DATABASE $CP_MYSQL_TEST_DB;" --skip-password
- name: Install core
working-directory: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -e src/subpackages/library
pip install -e src/subpackages/core[test]
- name: Run Tests
timeout-minutes: 10
run: |
# add -rP if you want to see debug for all tests, not just failed ones
pytest -v --exitfirst --disable-warnings -o log_cli_level=10 --tb=long --show-capture=all --capture=sys --color=yes --code-highlight=yes --timeout=60 -k 'not test_load_objects and not test_load_single_object' ${{ github.workspace }}/tests/core
test-library:
name: Install and test Library
strategy:
max-parallel: 4
matrix:
os: [macos-13]
python-version: [3.9]
fail-fast: false
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# need to get git tags for setuptools-scm
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
architecture: x64
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache-dir
run: |
echo "PIP_CACHE_DIR=$(pip cache dir)" >> "$GITHUB_OUTPUT"
- name: Cache pip
uses: actions/cache@v4
id: cache-pip
with:
path: ${{ steps.pip-cache-dir.outputs.PIP_CACHE_DIR }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/setup.py') }}
- name: Install library
working-directory: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -e src/subpackages/library[test]
- name: Run Tests
run: |
pytest ${{ github.workspace }}/tests/library
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review, review_requested]
push:
branches:
- "main"
workflow_dispatch: