Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 10 additions & 61 deletions .github/workflows/consumer_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ jobs:
strategy:
fail-fast: false
matrix:
consumer: ["process_description", "score", "module_template"]
consumer: [
"process_description and local",
"process_description and remote",
"score and local",
"score and remote",
"module_template and local",
"module_template and remote",
]

steps:
- name: 🛡️ Harden Runner
Expand All @@ -39,70 +46,12 @@ jobs:

- name: Prepare Python
run: |
bazel run --lockfile_mode=error //:ide_support
bazel run //:ide_support

- name: Prepare report directory
run: |
mkdir -p reports

# The pipefail ensures that non 0 exit codes inside the pytest execution get carried into the pipe
# & make the tests red in the end. Without this we only would check the exit code of the 'tee' command.
- name: Run Consumer tests

run: |
pytest_rc=0
.venv_docs/bin/python -m pytest -vv src/tests/ \
--repo="$CONSUMER" \
--junitxml="reports/${{ matrix.consumer }}.xml" \
|| pytest_rc=$?


if [ -f "consumer_test.log" ]; then
src_log="consumer_test.log"
else
echo "consumer_test.log not found; expected at ./consumer_test.log"
exit ${pytest_rc:-1}
fi

dest_log="reports/${{ matrix.consumer }}.log"
mv "$src_log" "$dest_log"

tail -n 15 "$dest_log" >> "$GITHUB_STEP_SUMMARY"

cat "$dest_log"
exit $pytest_rc
run: .venv_docs/bin/python -m pytest -vv src/tests/ -k "$CONSUMER"
env:
FORCE_COLOR: "1"
TERM: xterm-256color
PYTHONUNBUFFERED: "1"
CONSUMER: ${{ matrix.consumer }}

- name: Upload consumer test report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: tests-${{ matrix.consumer }}
path: reports/

summarize:
needs: test
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Prepare consumer report directory
run: |
mkdir -p tests-report

- name: Download individual consumer reports
uses: actions/download-artifact@v4
with:
pattern: tests-*
path: tests-report
merge-multiple: true

- name: Upload bundled consumer report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: tests-report
path: tests-report
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ __pycache__/
# bug: This file is created in repo root on test discovery.
/consumer_test.log
.clwb

# AI
/.codex
/.claude
6 changes: 0 additions & 6 deletions src/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@

def pytest_addoption(parser: pytest.Parser):
"""Add custom command line options to pytest"""
parser.addoption(
"--repo",
action="store",
default=None,
help="Comma separated string of ConsumerRepo's name tests to run",
)
parser.addoption(
"--disable-cache",
action="store_true",
Expand Down
Loading
Loading