Skip to content

Commit 0e4b2ae

Browse files
watsonrochdev
authored andcommitted
chore: verify all test:integration* scripts are exercised in CI (#7260)
Add validation to scripts/verify-exercised-tests.js to ensure all test:integration* scripts are invoked by GitHub Actions workflows. This prevents accidentally adding integration test scripts without corresponding CI coverage. The check excludes test:integration:plugins, which is a local convenience script whose tests are already fully covered by test:plugins:ci in CI. This validation complements the existing check for :ci suffixed scripts and helps maintain comprehensive test coverage in CI.
1 parent d7d9bef commit 0e4b2ae

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/verify-exercised-tests.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,18 @@ function main () {
928928
}
929929
}
930930

931+
// All test:integration* scripts should be referenced by CI (except test:integration:plugins).
932+
for (const name of Object.keys(scripts).sort((a, b) => a.localeCompare(b, 'en'))) {
933+
if (!name.startsWith('test:integration')) continue
934+
// Skip test:integration:plugins - it's a convenience script for running only plugin integration
935+
// tests locally, but in CI these are already covered by test:plugins:ci (which runs all plugin
936+
// tests including integration tests).
937+
if (name === 'test:integration:plugins') continue
938+
if (!invokedScripts.has(name)) {
939+
pushError(`package.json: script "${name}" is not invoked by any GitHub Actions workflow`)
940+
}
941+
}
942+
931943
// Validate plugin setup (domain-specific):
932944
// - test:plugins* expects packages/datadog-plugin-<name>
933945
// - test:appsec:plugins* expects matching *.plugin.spec.js files

0 commit comments

Comments
 (0)