Skip to content

Bump pytest-subtests from 0.13.1 to 0.14.2 #807

Bump pytest-subtests from 0.13.1 to 0.14.2

Bump pytest-subtests from 0.13.1 to 0.14.2 #807

Workflow file for this run

# Regular tests
#
# Use this to ensure your tests are passing on every push and PR (skipped on
# pushes which only affect documentation).
#
# You should make sure you run jobs on at least the *oldest* and the *newest*
# versions of python that your codebase is intended to support.
name: tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
test:
timeout-minutes: 45
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
POETRY_HOME: '~/poetry'
steps:
- name: Set OS Environment Variables (Windows)
if: runner.os == 'Windows'
run: |
echo 'ACTIVATE_PYTHON_VENV=.venv/scripts/activate' >> $GITHUB_ENV
- name: Set OS Environment Variables (not Windows)
if: runner.os != 'Windows'
run: |
echo 'ACTIVATE_PYTHON_VENV=.venv/bin/activate' >> $GITHUB_ENV
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up python 3.13
id: setup-python-system
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Cache Poetry Install
uses: actions/cache@v4
id: cached-poetry
with:
path: ${{ env.POETRY_HOME }}
key: poetry-cache-${{ runner.os }}-${{ steps.setup-python-system.outputs.python-version }}-${{ hashFiles('.github/workflows/tests.yaml') }}
- name: Install poetry
uses: snok/install-poetry@v1
if: steps.cached-poetry.outputs.cache-hit != 'true'
with:
version: 1.8.5
- name: Add Poetry to PATH # Needs to be separate from install-poetry because cache.
run: |
echo "$POETRY_HOME/bin" >> $GITHUB_PATH
- name: Configure Poetry # Needs to be separate from install-poetry because cache.
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry config installer.parallel ${{ runner.os != 'Windows' }} # Currently there seems to be some race-condition in windows
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: setup-python-project
with:
python-version: ${{ matrix.python-version }}
- name: Cache venv
uses: actions/cache@v4
id: cached-venv
with:
path: .venv/
key: venv-cache-${{ runner.os }}-${{ steps.setup-python-project.outputs.python-version }}-${{ hashFiles('.github/workflows/tests.yaml') }}
- name: Install MicroPython
uses: BrianPugh/install-micropython@v2
with:
reference: v1.22.0
- name: Install library with sanitizers
run: |
poetry env use "${{ steps.setup-python-project.outputs.python-path }}"
TAMP_SANITIZE=1 poetry install --no-interaction
# Set ASAN options globally (won't affect non-ASAN binaries)
echo "ASAN_OPTIONS=detect_leaks=0" >> $GITHUB_ENV
echo "UBSAN_OPTIONS=print_stacktrace=1" >> $GITHUB_ENV
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Cache enwik8 dataset
uses: actions/cache@v4
with:
path: build/enwik8.zip
key: enwik8-dataset-${{ hashFiles('Makefile') }}
- name: Download enwik8 dataset
run: make download-enwik8
- name: Install cppcheck
run: sudo apt-get update && sudo apt-get install -y cppcheck
- name: Pre-commit run
run: |
source ${{ env.ACTIVATE_PYTHON_VENV }}
SKIP=wasm-eslint,wasm-npm-test,wasm-file-validation,typescript-check,package-json-lint pre-commit run --show-diff-on-failure --color=always --all-files
- name: Run tests with sanitizers
run: |
source ${{ env.ACTIVATE_PYTHON_VENV }}
LD_PRELOAD=$(gcc -print-file-name=libasan.so) python -m pytest --cov=tamp --cov-report term --cov-report xml --junitxml=testresults.xml
belay run micropython -X heapsize=200M -m unittest tests/*.py
coverage report
- name: Run C tests
run: make c-test
- name: Verify CLI compression/decompression integrity
run: |
source ${{ env.ACTIVATE_PYTHON_VENV }}
make download-enwik8
original_hash=$(sha256sum build/enwik8 | cut -d' ' -f1)
# Use LD_PRELOAD for ASAN when running the CLI commands
LIBASAN_PATH=$(gcc -print-file-name=libasan.so)
roundtrip_hash=$(LD_PRELOAD="$LIBASAN_PATH" tamp compress build/enwik8 | LD_PRELOAD="$LIBASAN_PATH" tamp decompress | sha256sum | cut -d' ' -f1)
if [ "$original_hash" = "$roundtrip_hash" ]; then
echo "✓ Compression/decompression integrity verified"
echo "Original hash: $original_hash"
echo "Roundtrip hash: $roundtrip_hash"
else
echo "✗ Compression/decompression integrity check failed"
echo "Original hash: $original_hash"
echo "Roundtrip hash: $roundtrip_hash"
exit 1
fi
- name: Upload coverage to Codecov
if: steps.check_test_files.outputs.files_exists == 'true'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
env_vars: OS,PYTHON
name: Python ${{ matrix.python-version }} on ${{ runner.os }}
#----------------------------------------------
# make sure docs build
#----------------------------------------------
- name: Build HTML docs
run: |
source ${{ env.ACTIVATE_PYTHON_VENV }}
LD_PRELOAD=$(gcc -print-file-name=libasan.so) sphinx-build -b html docs/source/ docs/build/html