Skip to content

test: align robotframework integration expected with full suite hiera… #1321

test: align robotframework integration expected with full suite hiera…

test: align robotframework integration expected with full suite hiera… #1321

Workflow file for this run

name: Python package
on: [ push ]
# Supply-chain protection: refuse PyPI packages uploaded less than 3 days ago.
# The cutoff is computed per job as an ISO 8601 datetime (see the "Compute
# supply-chain cutoff" step). pip 26.1 added the relative-duration form
# ("P3D"), but that requires Python>=3.10 and we still test on 3.9.
jobs:
test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
changed-dir:
- "qase-api-client"
- "qase-api-v2-client"
- "qase-pytest"
- "qase-robotframework"
- "qase-python-commons"
- "qase-behave"
- "qase-tavern"
name: Project ${{ matrix.changed-dir }} - Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: "shell"
filters: |
changes:
- '${{ matrix.changed-dir }}/**'
- name: Set up Python ${{ matrix.python-version }}
if: steps.filter.outputs.changes == 'true'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Compute supply-chain cutoff
if: steps.filter.outputs.changes == 'true'
run: |
cutoff=$(date -u -d '3 days ago' +%Y-%m-%dT%H:%M:%SZ)
echo "PIP_UPLOADED_PRIOR_TO=$cutoff" >> "$GITHUB_ENV"
- name: Install dependencies
if: steps.filter.outputs.changes == 'true'
run: |
# Bootstrap with PIP_UPLOADED_PRIOR_TO unset: a seeded pip older than
# 26.0 would treat the env var as an unknown --uploaded-prior-to flag
# and abort.
env -u PIP_UPLOADED_PRIOR_TO python -m pip install --upgrade 'pip>=26.0'
pip install tox tox-gh-actions
- name: Run tox
if: steps.filter.outputs.changes == 'true'
working-directory: ./${{ matrix.changed-dir }}
run: |
tox
integration-test:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Compute supply-chain cutoff
run: |
cutoff=$(date -u -d '3 days ago' +%Y-%m-%dT%H:%M:%SZ)
echo "PIP_UPLOADED_PRIOR_TO=$cutoff" >> "$GITHUB_ENV"
- name: Install reporters-validator
run: |
env -u PIP_UPLOADED_PRIOR_TO python -m pip install --upgrade 'pip>=26.0'
pip install git+https://github.com/qase-tms/reporters-validator.git
- name: Download report schemas
run: git clone --depth 1 https://github.com/qase-tms/specs.git /tmp/specs
- name: Validate Pytest reporter
run: |
python -m venv /tmp/venv-pytest
env -u PIP_UPLOADED_PRIOR_TO /tmp/venv-pytest/bin/python -m pip install --upgrade 'pip>=26.0'
/tmp/venv-pytest/bin/pip install -q \
./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-pytest
QASE_MODE=report \
QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/pytest-report \
/tmp/venv-pytest/bin/python -m pytest integration/pytest/tests/ -v || true
reporters-validator validate \
--report-dir ${{ github.workspace }}/build/pytest-report \
--expected integration/pytest/expected/pytest-examples.yaml \
--schema-dir /tmp/specs/report/schemas
- name: Validate Behave reporter
run: |
python -m venv /tmp/venv-behave
env -u PIP_UPLOADED_PRIOR_TO /tmp/venv-behave/bin/python -m pip install --upgrade 'pip>=26.0'
/tmp/venv-behave/bin/pip install -q \
./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-behave
cd integration/behave
QASE_MODE=report \
QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/behave-report \
/tmp/venv-behave/bin/behave --format=qase.behave.formatter:QaseFormatter --no-capture features/ || true
reporters-validator validate \
--report-dir ${{ github.workspace }}/build/behave-report \
--expected expected/behave-examples.yaml \
--schema-dir /tmp/specs/report/schemas
- name: Validate Robot Framework reporter
run: |
python -m venv /tmp/venv-robot
env -u PIP_UPLOADED_PRIOR_TO /tmp/venv-robot/bin/python -m pip install --upgrade 'pip>=26.0'
/tmp/venv-robot/bin/pip install -q \
./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-robotframework \
robotframework
QASE_MODE=report \
QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/robot-report \
/tmp/venv-robot/bin/robot --listener qase.robotframework.Listener \
--outputdir /tmp/robot-output \
integration/robot/tests/ || true
reporters-validator validate \
--report-dir ${{ github.workspace }}/build/robot-report \
--expected integration/robot/expected/robot-examples.yaml \
--schema-dir /tmp/specs/report/schemas
- name: Validate Tavern reporter
run: |
python -m venv /tmp/venv-tavern
env -u PIP_UPLOADED_PRIOR_TO /tmp/venv-tavern/bin/python -m pip install --upgrade 'pip>=26.0'
/tmp/venv-tavern/bin/pip install -q \
./qase-api-client ./qase-api-v2-client ./qase-python-commons ./qase-tavern \
tavern
QASE_MODE=report \
QASE_REPORT_CONNECTION_PATH=${{ github.workspace }}/build/tavern-report \
/tmp/venv-tavern/bin/python -m pytest integration/tavern/tests/ -v || true
reporters-validator validate \
--report-dir ${{ github.workspace }}/build/tavern-report \
--expected integration/tavern/expected/tavern-examples.yaml \
--schema-dir /tmp/specs/report/schemas
build-n-publish:
runs-on: ubuntu-latest
permissions:
contents: write
needs: test
strategy:
max-parallel: 1
matrix:
prefix:
[
"qase-api-client",
"qase-api-v2-client",
"qase-pytest",
"qase-robotframework",
"qase-python-commons",
"qase-behave",
"qase-tavern"
]
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
if: contains(github.event.ref, matrix.prefix)
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Compute supply-chain cutoff
if: contains(github.event.ref, matrix.prefix)
run: |
cutoff=$(date -u -d '3 days ago' +%Y-%m-%dT%H:%M:%SZ)
echo "PIP_UPLOADED_PRIOR_TO=$cutoff" >> "$GITHUB_ENV"
- name: Install build dependencies
if: contains(github.event.ref, matrix.prefix)
run: |
env -u PIP_UPLOADED_PRIOR_TO python -m pip install --upgrade 'pip>=26.0'
pip install --upgrade setuptools wheel build
- name: Build the package
if: contains(github.event.ref, matrix.prefix)
working-directory: ./${{ matrix.prefix }}
run: |
python -m build
- name: Publish distribution to PyPI
if: contains(github.event.ref, matrix.prefix)
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
packages-dir: ./${{ matrix.prefix }}/dist
- name: Extract tag name
if: contains(github.event.ref, matrix.prefix)
id: tag
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Create GitHub Release
if: contains(github.event.ref, matrix.prefix)
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Release ${{ steps.tag.outputs.tag }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}