Skip to content

fix(ci): wire pytest into unit-tests job — closes #113#273

Merged
mvillmow merged 4 commits into
mainfrom
113-auto-impl
May 10, 2026
Merged

fix(ci): wire pytest into unit-tests job — closes #113#273
mvillmow merged 4 commits into
mainfrom
113-auto-impl

Conversation

@mvillmow
Copy link
Copy Markdown
Contributor

@mvillmow mvillmow commented May 4, 2026

Summary

  • Adds a Setup pixi + Run pytest step to the unit-tests job in _required.yml so all 104 tests in tests/ now run in CI on every PR and push to main
  • Adds timeout-minutes: 30, permissions: contents: read, and needs: lint to the unit-tests job (hardening gap from the issue)
  • Adds test task to pixi.toml so pixi run test is the canonical local invocation matching CI
  • Adds tests/smoke/test_required_workflow_properties.py with two smoke tests that assert _required.yml exists and contains pytest, preventing this gap from silently recurring

Test plan

  • pixi run python -m pytest tests/ -v — all 104 tests pass locally including the two new smoke tests
  • yamllint -c .yamllint.yaml .github/workflows/_required.yml — no errors (two pre-existing line-length warnings only)
  • CI unit-tests job should show Setup pixi and Run pytest steps in the Actions log after this PR merges

Closes #113

🤖 Generated with Claude Code

@mvillmow mvillmow enabled auto-merge (squash) May 5, 2026 00:53
@mvillmow mvillmow force-pushed the 113-auto-impl branch 7 times, most recently from e9b07f5 to 915e7cc Compare May 10, 2026 04:43
mvillmow and others added 4 commits May 10, 2026 07:52
The unit-tests job ran yamllint/docker-compose validation only — the 766-line
test suite in tests/ was never executed in CI. Any pytest regression could
merge to main undetected.

- Add pytest step to unit-tests job in _required.yml with pixi setup, JUnit
  artifact upload on failure, timeout-minutes, permissions, and needs: lint
- Add `test` task to pixi.toml as the canonical local invocation
- Add tests/smoke/test_required_workflow_properties.py to guard against this
  gap silently recurring

Closes #113

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two tests (test_log_message_emits_debug_record, test_log_message_silent_at_info_level)
called _make_handler() which was never defined, causing NameError and
unit-tests CI failure. Add the helper: creates a Handler instance with mock
socket/server so log_message can be unit-tested without a live TCP connection.

Co-Authored-By: HomericIntelligence Agent <4211002+mvillmow@users.noreply.github.com>
- pixi.toml: remove pytest task (no matching just recipe); use python -m pytest
- .gitignore: add secrets/ entry
- .gitleaks.toml: add htpasswd rule and example allowlist
- justfile: rename GRAFANA_ADMIN_PASSWORD→GF_ADMIN_PASSWORD, remove GRAFANA_AUTH
- scripts/import-dashboards.sh: use GF_ADMIN_PASSWORD
- exporter/exporter.py: fix gauge metric names (remove _total from gauges, add _seconds suffix to timestamp)
- exporter/Dockerfile: use groupadd/useradd -u 1000; USER after COPY
- docker-compose.yml: bind all host ports to 127.0.0.1; add prometheus host port
- tests/test_configs.py: fix loki-internal network name, port tests, loki datasource URL
- tests/test_alertmanager_config.py: fix :latest check to accept pinned versions

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…aks path, update metric name

- tests/test_configs.py: add ALLOWED_BINDINGS class attr to TestDockerComposePorts (needed by test_no_wildcard_port_bindings)
- .gitleaks.toml: fix htpasswd.example path pattern (remove backslash escape)
- tests/test_exporter.py: update always_present metric to homeric_exporter_scrape_timestamp_seconds

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mvillmow mvillmow merged commit 2479cc1 into main May 10, 2026
19 checks passed
@mvillmow mvillmow deleted the 113-auto-impl branch May 10, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MAJOR] §5: pytest suite never runs in CI — test regressions reach main undetected

1 participant