Overview
Several composer.json files across the monorepo contain Composer script definitions that are either unsupported syntax or produce incomplete results. These are non-blocking today but should be fixed for developer ergonomics and accurate coverage reporting.
Reported via PR #45 comment: #45 (comment)
Requested by: @juliolmuller
Problem 1 — @script extra-args is not supported by Composer
Composer does not support passing additional CLI arguments to a @script-name reference (e.g. "test:cov": "@test --coverage-html coverage"). The extra flags are silently ignored or cause unexpected behaviour.
Affected files:
packages/cpf-dv/composer.json: "test:watch": "@test --watch" and "test:cov": "@test --coverage-html coverage"
packages/cnpj-dv/composer.json: "test:watch": "@test --watch" and "test:cov": "@test --coverage-html coverage"
packages/cnpj-fmt/composer.json: "test:watch": "@test --watch" and "test:cov": "@test --coverage-html coverage"
Each of these should be rewritten as self-contained commands (e.g. pest --configuration=.pest.config.xml --coverage-html coverage).
Problem 2 — test:cov missing coverage flag on isolated-process run
For packages whose test script is split into two Pest invocations (one for --group isolated-process-tests and one for the rest), only the second invocation in test:cov includes --coverage-html coverage. The isolated-process run is excluded, underreporting package coverage.
Affected files:
packages/cnpj-utils/composer.json
packages/cnpj-gen/composer.json
packages/cnpj-val/composer.json
The first Pest call in each test:cov array should also include the coverage flag.
Problem 3 — Legacy PHPUnit-style scripts still in use
Several packages have not yet migrated to Pest and still reference phpunit-watcher which is no longer a dependency in most packages:
packages/cpf-utils/composer.json
packages/cpf-gen/composer.json
packages/cpf-val/composer.json
packages/cpf-fmt/composer.json
packages/utils/composer.json
packages/br-utils/composer.json
These packages should be evaluated for Pest migration or at minimum have their test:watch / test-coverage scripts corrected.
Acceptance Criteria
Overview
Several
composer.jsonfiles across the monorepo contain Composer script definitions that are either unsupported syntax or produce incomplete results. These are non-blocking today but should be fixed for developer ergonomics and accurate coverage reporting.Reported via PR #45 comment: #45 (comment)
Requested by: @juliolmuller
Problem 1 —
@script extra-argsis not supported by ComposerComposer does not support passing additional CLI arguments to a
@script-namereference (e.g."test:cov": "@test --coverage-html coverage"). The extra flags are silently ignored or cause unexpected behaviour.Affected files:
packages/cpf-dv/composer.json:"test:watch": "@test --watch"and"test:cov": "@test --coverage-html coverage"packages/cnpj-dv/composer.json:"test:watch": "@test --watch"and"test:cov": "@test --coverage-html coverage"packages/cnpj-fmt/composer.json:"test:watch": "@test --watch"and"test:cov": "@test --coverage-html coverage"Each of these should be rewritten as self-contained commands (e.g.
pest --configuration=.pest.config.xml --coverage-html coverage).Problem 2 —
test:covmissing coverage flag on isolated-process runFor packages whose
testscript is split into two Pest invocations (one for--group isolated-process-testsand one for the rest), only the second invocation intest:covincludes--coverage-html coverage. The isolated-process run is excluded, underreporting package coverage.Affected files:
packages/cnpj-utils/composer.jsonpackages/cnpj-gen/composer.jsonpackages/cnpj-val/composer.jsonThe first Pest call in each
test:covarray should also include the coverage flag.Problem 3 — Legacy PHPUnit-style scripts still in use
Several packages have not yet migrated to Pest and still reference
phpunit-watcherwhich is no longer a dependency in most packages:packages/cpf-utils/composer.jsonpackages/cpf-gen/composer.jsonpackages/cpf-val/composer.jsonpackages/cpf-fmt/composer.jsonpackages/utils/composer.jsonpackages/br-utils/composer.jsonThese packages should be evaluated for Pest migration or at minimum have their
test:watch/test-coveragescripts corrected.Acceptance Criteria
All@script extra-argspatterns replaced with self-contained commandstest:covscripts produce coverage for both isolated-process and regular test runsphpunit-watcherreferences removed or replacedcomposer testandcomposer test:covscripts verified to run successfully