Skip to content

Config-based MSI threshold + test-env-json override for mutation-test/test jobs - #5

Merged
tyrsson merged 1 commit into
0.1.xfrom
infection-msi-threshold
Aug 10, 2026
Merged

Config-based MSI threshold + test-env-json override for mutation-test/test jobs#5
tyrsson merged 1 commit into
0.1.xfrom
infection-msi-threshold

Conversation

@tyrsson

@tyrsson tyrsson commented Aug 10, 2026

Copy link
Copy Markdown
Member

What

  1. Adds min-msi / min-covered-msi inputs (default "10") to the shared mutation-test job, passed as --min-msi/--min-covered-msi flags at invocation time. Config-based per repo (php-db repos are legacy codebases just adopting mutation testing, most don't have a baseline MSI yet; a strict bar like message-bus's 90/90 would fail immediately).
  2. Adds test-env-json input (JSON object) exported via $GITHUB_ENV before running tests in both test and mutation-test. Lets a caller override a phpunit.xml.dist connection setting for CI (e.g. a DB hostname that needs to differ between local Docker Compose networking and CI's non-containerized job) without editing that file.

Why (test-env-json)

Found via phpdb-mysql's first real CI run: integration tests failed on every leg with getaddrinfo for mysql failed: Temporary failure in name resolution. Root cause: the test/mutation-test jobs run directly on the runner VM (no container: key), so the DB started by the manual docker run step is only reachable via 127.0.0.1 + the mapped port, not the container name — confirmed by GitHub's own docs on service containers. phpdb-mysql's phpunit.xml.dist defaults TESTS_PHPDB_ADAPTER_MYSQL_HOSTNAME to mysql for local Docker Compose dev (container-to-container, works fine there). Also confirmed via PHPUnit's docs: <env> does not override an already-set real env var unless force="true", so setting the real env var in CI via test-env-json correctly takes precedence without needing force (which would break local dev).

Adds min-msi / min-covered-msi inputs (default "10") to the shared
mutation-test job, passed as --min-msi/--min-covered-msi flags at
invocation time (composer script itself stays plain 'infection').

Config-based per repo rather than hardcoded, since php-db repos are
legacy codebases just adopting mutation testing and most don't have a
baseline MSI yet. Default is deliberately low so the first real run
doesn't fail outright; each repo raises it once it has a real score to
ratchet up from.
@tyrsson tyrsson self-assigned this Aug 10, 2026
@tyrsson tyrsson added the enhancement New feature or request label Aug 10, 2026
@tyrsson
tyrsson merged commit 8a6fd67 into 0.1.x Aug 10, 2026
@tyrsson tyrsson changed the title Config-based MSI threshold for mutation-test job Config-based MSI threshold + test-env-json override for mutation-test/test jobs Aug 10, 2026
tyrsson added a commit that referenced this pull request Aug 10, 2026
Add test-env-json input (follow-up to #5, missed in that merge)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant