declapract-typescript-ehmpathy 0.49.14 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.test/assets/cicd-common/declarations/declapract.declare.yml +8 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.declapract.integration.test.ts +597 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/.test.yml +19 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/consumer-owned.yml +21 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/review.yml +26 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/declapract.use.yml +6 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/package.json +4 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/.declapract.integration.test.ts.snap +604 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/declastruct-insync-grep.declapract.integration.test.ts.snap +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/report-slow-tests.play.declapract.integration.test.ts.snap +28 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/has-changelog-file/changelog.md.declapract.ts +11 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci-on-commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci_on_commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/pr-release-on-main.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test-on-commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test_on_commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-use-apikeys/.agent/repo=.this/role=any/skills/use.apikeys.json.declapract.ts +7 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-use-apikeys/.agent/repo=.this/role=any/skills/use.apikeys.sh.declapract.ts +7 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/please-release/action.yml +469 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/test-shards-setup/action.yml +68 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.declastruct.yml +218 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.install.yml +56 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml +434 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml.declapract.ts +26 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/release.yml +32 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/report-slow-tests.sh +65 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/review.yml +26 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml +25 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml.declapract.ts +15 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/declastruct-insync-grep.declapract.integration.test.ts +49 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/report-slow-tests.play.declapract.integration.test.ts +161 -0
- package/dist/.test/assets/cicd-common/declarations/useCases.yml +11 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/package.json +5 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/.declapract.integration.test.ts +15 -21
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.declapract.integration.test.ts +2 -2
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/expo-migration/declarations/practices/git/.declapract.integration.test.ts +2 -2
- package/dist/.test/assets/expo-migration/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
- package/dist/.test/assets/expo-migration/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
- package/dist/.test/assets/expo-migration/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
- package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
- package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/git/declarations/declapract.declare.yml +8 -0
- package/dist/.test/assets/git/declarations/practices/git/.declapract.integration.test.ts +1001 -0
- package/dist/.test/assets/git/declarations/practices/git/.gitattributes.declapract.integration.test.ts +120 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/.gitattributes +6 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +7 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/declapract.use.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +55 -0
- package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +24 -0
- package/dist/.test/assets/git/declarations/practices/git/best-practice/.declapract.readme.md +60 -0
- package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitattributes.declapract.ts +77 -0
- package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitignore.declapract.ts +100 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.declapract.integration.test.ts +181 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.use.yml +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/package.json +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/useCases.yml +8 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/__snapshots__/.declapract.integration.test.ts.snap +234 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/codegen.dynamodb.dao.ts +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/provision/docker/integration-test-db/docker-compose.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.declapract.integration.test.ts +237 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +159 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declapract.use.yml +20 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declarations/declapract.declare.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/codegen.sql.dao.yml +20 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/provision/docker/testdb/build-image.dockerfile +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.use.yml +21 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/provision/schema/sql/init/.extensions.sql +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +77 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/config-validates-schema.declapract.integration.test.ts.snap +500 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/database-wrappers-typecheck.declapract.integration.test.ts.snap +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/engine-upgrade.declapract.integration.test.ts.snap +151 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/ssm-param-names.declapract.integration.test.ts.snap +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/with-connection-in-input.declapract.integration.test.ts.snap +57 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.integration.test.ts +71 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.readme.md +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/provision/schema/sql/init.yml +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/__snapshots__/.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/provision/schema/<star><star>/<star>.yml.declapract.ts +68 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/.declapract.readme.md +5 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/database.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/extensions.sql.declapract.ts +13 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/schema.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.cicd.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.datalakedb.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-config-file-names/codegen.sql.yml.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +23 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.integration.test.ts +221 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.readme.md +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/access/daos/daoSurfer.ts +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/domain.operations/getSurfLesson.ts +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/utils/database/getDatabaseConnection.integration.test.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/utils/database/getDatabaseConnection.ts +68 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.3a193e5.ts +65 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.66284e3.ts +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.68cf8ba.ts +90 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.9e1bdc4.ts +65 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.c6cef7e.ts +68 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.c8eb35b.ts +90 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.d1e8cd7.ts +31 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.e0c53d8.ts +90 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.eab15c0.ts +89 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.ef25ae0.ts +32 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.integration.test.66284e3.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/__snapshots__/.declapract.integration.test.ts.snap +75 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/<star><star>/<star>.ts.declapract.ts +33 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/utils/database/getDatabaseConnection.integration.test.ts.declapract.ts +43 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/utils/database/getDatabaseConnection.ts.declapract.ts +51 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/provision/docker/integration_test_db/<star><star>/<star>.declapract.ts +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/provision/docker/integration-test-db/<star><star>/<star>.declapract.ts +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json +8 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +22 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-param-placeholder/config/<star>.json.declapract.ts +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.integration.test.ts +86 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.readme.md +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/src/access/sdks/sdkWaveArchive.ts +7 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/src/utils/database/getSurfReportConnection.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/__snapshots__/.declapract.integration.test.ts.snap +72 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/src/<star><star>/<star>.ts.declapract.ts +32 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +12 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +13 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.declapract.integration.test.ts +95 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.use.yml +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/provision/aws/product/parameter-store.tf +32 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/__snapshots__/.declapract.integration.test.ts.snap +60 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/provision/aws/product/parameter-store.tf.declapract.ts +94 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.declapract.readme.md +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/declapract.use.yml +2 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/src/domain.operations/findSurferById.ts +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/src/utils/database/withDatabaseConnection.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/src/<star><star>/<star>.ts.declapract.ts +55 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +114 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml.declapract.ts +35 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.schema.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.types.yml +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json +40 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json +40 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json +37 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json +36 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/readme.md +113 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +60 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.ts +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile +7 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile.declapract.ts +37 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.integration.test.ts +115 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.sh +165 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/compose.sh +43 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/docker-compose.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/.gitignore +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/readme.md +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +25 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/connection.config.js +36 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/control.yml +7 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +97 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.database.sql +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +46 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.schema.sql +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.cicd.sql +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.datalakedb.sql +12 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/default_transaction_isolation.sql +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/user.service.sql +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbIdentity.ts +52 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbPort.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +77 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.test.ts +82 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.ts +52 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/databaseClientTimeouts.ts +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts +119 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabasePort.ts +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.test.ts +51 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.ts +86 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +54 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +35 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/config-validates-schema.declapract.integration.test.ts +332 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-client.declapract.integration.test.ts +291 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-wrappers-typecheck.declapract.integration.test.ts +225 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/engine-upgrade.declapract.integration.test.ts +243 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/ssm-param-names.declapract.integration.test.ts +154 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-per-worktree.declapract.integration.test.ts +332 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/with-connection-in-input.declapract.integration.test.ts +97 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/.agent/keyrack.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.node.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/declapract.use.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/package.json +22 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +46 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +33 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/keyrack-yml-findsert.declapract.integration.test.ts.snap +28 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/self-link-build-order.declapract.integration.test.ts.snap +81 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/.declapract.readme.md +11 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/rhachet.use.ts.declapract.ts +12 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +59 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.use.yml +2 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json +5 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +88 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/<star><star>/<star>peer-review<star>.md.declapract.ts +16 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/peer/<star><star>/<star>.md.declapract.ts +16 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/keyrack.yml.declapract.ts +143 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +22 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +189 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.declapract.readme.md +40 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +94 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json +19 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json.declapract.ts +51 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +91 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +149 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/keyrack-yml-findsert.declapract.integration.test.ts +105 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/self-link-build-order.declapract.integration.test.ts +88 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/blackbox/lambdas/consumeSESEmailEventFromSNS.acceptance.test.ts +23 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/livedb-wake-branches.declapract.integration.test.ts.snap +6 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/old-acceptance-test-utils.declapract.integration.test.ts.snap +162 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/test-kind-seam.declapract.integration.test.ts.snap +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +111 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.integration.test.ts +69 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.readme.md +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.test/assets/demo-repo-with-stale-test-fns-dep/declapract.use.yml +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.test/assets/demo-repo-with-stale-test-fns-dep/package.json +11 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/__snapshots__/.declapract.integration.test.ts.snap +43 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/package.json.declapract.ts +81 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/jest.<star>.js.declapract.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/.declapract.readme.md +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.js +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.integration.test.ts +83 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.readme.md +22 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/.test/assets/.agent/config.yml +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/.test/assets/.rhachet/manifest.json +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/somefile.ts +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/declapract.use.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/accept.blackbox/<star><star>/<star>.declapract.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/acceptance/<star><star>/<star>.declapract.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +31 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/<star><star>/<star>.ts.declapract.ts +25 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/getDataFromLastOpenBracketAtStartOfLine.ts.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/invokeLambda.ts.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +49 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-2/blackbox/lambdas/<star>.ts.declapract.ts +27 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/_utils/environment.ts.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/lambdas/<star>.ts.declapract.ts +23 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/.declapract.readme.md +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.acceptance.ts.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.integration.ts.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/.declapract.readme.md +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/<star>.ts.declapract.ts +27 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/__test_assets__/<star><star>/<star>.declapract.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/__test_utils__/<star><star>/<star>.declapract.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.readme.md +52 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.todo.md +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json +18 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/.test/useWakeOfLivedb.ts +209 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.integration.test.ts.declapract.ts +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.test.ts.declapract.ts +7 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/build-ifstale.declapract.integration.test.ts +124 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/livedb-wake-branches.declapract.integration.test.ts +315 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/old-acceptance-test-utils.declapract.integration.test.ts +122 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/package.json.shell-flags.declapract.integration.test.ts +139 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/test-kind-seam.declapract.integration.test.ts +87 -0
- package/dist/.test/assets/git/declarations/useCases.yml +29 -0
- package/dist/.test/assets/{expo-fullusecase/declarations/practices/git/best-practice → git/repo-with-all-gitattributes-declarers}/.gitattributes +3 -0
- package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/declapract.use.yml +26 -0
- package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/package.json +4 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/__snapshots__/gitattributesDeclarers.declapract.integration.test.ts.snap +79 -0
- package/dist/__snapshots__/repoSkills.declapract.acceptance.test.ts.snap +512 -0
- package/dist/__snapshots__/typecheckBestPracticeTemplates.declapract.integration.test.ts.snap +80 -0
- package/dist/gitattributesDeclarers.declapract.integration.test.ts +438 -0
- package/dist/practiceOwnerPerFile.declapract.integration.test.ts +53 -0
- package/dist/practices/cicd-common/.declapract.integration.test.ts +15 -21
- package/dist/practices/git/.declapract.integration.test.ts +2 -2
- package/dist/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
- package/dist/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
- package/dist/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
- package/dist/practices/git/best-practice/.declapract.readme.md +37 -0
- package/dist/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
- package/dist/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
- package/dist/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
- package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
- package/dist/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
- package/dist/practices/persist-with-rds/best-practice/package.json +5 -0
- package/dist/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
- package/dist/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/repoSkills.declapract.acceptance.test.ts +1150 -0
- package/dist/typecheckBestPracticeTemplates.declapract.integration.test.ts +181 -19
- package/dist/utils/defineExpectedGitattributesContents.ts +247 -0
- package/package.json +6 -6
- package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes +0 -7
- package/dist/practices/git/best-practice/.gitattributes +0 -7
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
import { given, then, useBeforeAll, when } from 'test-fns';
|
|
4
|
+
import { getModuleExportsFromTsSource } from '../../utils/getModuleExportsFromTsSource';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* .what = executes the REAL shipped `useWakeOfLivedb` template through its deterministic
|
|
8
|
+
* decide-gate branches, with every boundary (fs, child_process, env) injected — so
|
|
9
|
+
* the wake's actual logic runs, not a source-text pin of it.
|
|
10
|
+
* .why = `livedb-wake-globalsetup.declapract.integration.test.ts` pins the wake by SOURCE TEXT
|
|
11
|
+
* (it `.toContain`s `process.env.CI`, `=== 'prod'`, `.database?.tunnel`, …). a logic
|
|
12
|
+
* bug that keeps those tokens — an inverted gate, a swallowed timeout, a classifier that
|
|
13
|
+
* rethrows every failure — sails through every pin green. the decide-steps are pure
|
|
14
|
+
* state decisions (ci-skip, prod-skip, tunnel present/absent, parse-failure throw) and
|
|
15
|
+
* the failure classifier is a pure allowlist, so they run for real here with no live
|
|
16
|
+
* infra — the repo's own `runTargetSlug`/`probeTestDb` pattern.
|
|
17
|
+
* .the-invariant = each gate lets the wake through ONLY when it should: not-ci ∧ not-prod ∧
|
|
18
|
+
* reaches-cluster. a config the consumer authored but the setup cannot parse throws
|
|
19
|
+
* (never a silent false). a wake-command failure is tolerated loud; a non-child-process
|
|
20
|
+
* error is rethrown.
|
|
21
|
+
* .teeth = invert any gate in the template (drop the ci return, the prod return, the tunnel
|
|
22
|
+
* gate) and the matched case reddens — a caller reaches the cluster it must not, or
|
|
23
|
+
* skips one it must. drop the parse-failure throw and the malformed-config case
|
|
24
|
+
* reddens. widen the classifier to rethrow-none and the non-child-process case reddens.
|
|
25
|
+
* .note = INTEGRATION by `rule.forbid.unit.remote-boundaries`: it reads the shipped template off
|
|
26
|
+
* the filesystem. no network, no real subprocess — the child_process boundary is stubbed,
|
|
27
|
+
* so the deployed cluster is never touched. it sits at the PRACTICE ROOT (not under
|
|
28
|
+
* `best-practice/`), because declapract's compile strips `.declapract.test.ts` (+ `.snap`)
|
|
29
|
+
* but NOT `.declapract.integration.test.ts` — so an integration clamp collocated inside
|
|
30
|
+
* `best-practice/` would SHIP to a consumer and apply as an EQUALS template until
|
|
31
|
+
* ehmpathy/declapract#109 lands. the practice-root home keeps it out of the emission set
|
|
32
|
+
* while it still clamps the shipped template by path (`rule.require.declapract-integration-tests`).
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
const SOURCE_PATH = `${__dirname}/best-practice/src/.test/useWakeOfLivedb.ts`;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* .what = transpile the template to CommonJS + execute its sole export with every boundary
|
|
39
|
+
* stubbed, then report what crossed each boundary (the exec calls, the stderr warns).
|
|
40
|
+
* .why = the template imports `node:fs`, `node:child_process`, `node:path`, `helpful-errors`;
|
|
41
|
+
* a require-stub feeds each a controlled fake so the real decide-logic runs against
|
|
42
|
+
* inputs this test dictates, and the boundary effects are observed rather than performed.
|
|
43
|
+
*/
|
|
44
|
+
const runUseWakeOfLivedb = async (input: {
|
|
45
|
+
env: 'test' | 'prep' | 'prod' | null;
|
|
46
|
+
reaches?: 'via-tunnel' | 'via-gateway'; // the node prepares pass via-tunnel; default to it here
|
|
47
|
+
ci: boolean;
|
|
48
|
+
configText: string | null; // null = the config file is absent
|
|
49
|
+
wakeThrows?: unknown; // when set, the stubbed execSync throws this
|
|
50
|
+
}): Promise<{ execCalls: string[]; stderr: string[] }> => {
|
|
51
|
+
const execCalls: string[] = [];
|
|
52
|
+
const stderr: string[] = [];
|
|
53
|
+
|
|
54
|
+
class FakeConstraintError extends Error {
|
|
55
|
+
public readonly cause: unknown;
|
|
56
|
+
constructor(message: string, meta?: { cause?: unknown }) {
|
|
57
|
+
super(message);
|
|
58
|
+
this.name = 'ConstraintError';
|
|
59
|
+
this.cause = meta?.cause;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const requireStub = (id: string): unknown => {
|
|
64
|
+
if (id === 'node:child_process')
|
|
65
|
+
return {
|
|
66
|
+
execSync: (cmd: string): void => {
|
|
67
|
+
execCalls.push(cmd);
|
|
68
|
+
if (input.wakeThrows !== undefined) throw input.wakeThrows;
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
if (id === 'node:fs')
|
|
72
|
+
return {
|
|
73
|
+
existsSync: (): boolean => input.configText !== null,
|
|
74
|
+
readFileSync: (): string => input.configText ?? '',
|
|
75
|
+
};
|
|
76
|
+
if (id === 'node:path')
|
|
77
|
+
return { join: (...parts: string[]): string => parts.join('/') };
|
|
78
|
+
if (id === 'helpful-errors') return { ConstraintError: FakeConstraintError };
|
|
79
|
+
return {};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// control the two process globals the template reads, and capture its stderr warns
|
|
83
|
+
const priorCi = process.env.CI;
|
|
84
|
+
if (input.ci) process.env.CI = '1';
|
|
85
|
+
else delete process.env.CI;
|
|
86
|
+
const priorWrite = process.stderr.write.bind(process.stderr);
|
|
87
|
+
(process.stderr as unknown as { write: (s: string) => boolean }).write = (
|
|
88
|
+
s: string,
|
|
89
|
+
): boolean => {
|
|
90
|
+
stderr.push(s);
|
|
91
|
+
return true;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
const { useWakeOfLivedb } = getModuleExportsFromTsSource<{
|
|
96
|
+
useWakeOfLivedb: (i: {
|
|
97
|
+
env: 'test' | 'prep' | 'prod' | null;
|
|
98
|
+
reaches: 'via-tunnel' | 'via-gateway';
|
|
99
|
+
}) => Promise<void>;
|
|
100
|
+
}>({ source: readFileSync(SOURCE_PATH, 'utf8'), requireStub });
|
|
101
|
+
await useWakeOfLivedb!({
|
|
102
|
+
env: input.env,
|
|
103
|
+
reaches: input.reaches ?? 'via-tunnel',
|
|
104
|
+
});
|
|
105
|
+
} finally {
|
|
106
|
+
(process.stderr as unknown as { write: (s: string) => boolean }).write =
|
|
107
|
+
priorWrite as never;
|
|
108
|
+
if (priorCi === undefined) delete process.env.CI;
|
|
109
|
+
else process.env.CI = priorCi;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return { execCalls, stderr };
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const TUNNEL_CONFIG = '{"database":{"tunnel":{"lambda":{"host":"x"}}}}';
|
|
116
|
+
|
|
117
|
+
describe('the useWakeOfLivedb decide-gate runs its real branches (executed, no live infra)', () => {
|
|
118
|
+
given('a service that reaches the shared cluster (config declares a db tunnel)', () => {
|
|
119
|
+
when('the caller is not in ci and targets prep', () => {
|
|
120
|
+
const state = useBeforeAll(() =>
|
|
121
|
+
runUseWakeOfLivedb({ env: 'prep', ci: false, configText: TUNNEL_CONFIG }),
|
|
122
|
+
);
|
|
123
|
+
then('it wakes the cluster via the rhx skill for that access', () => {
|
|
124
|
+
expect(state.execCalls).toEqual(['rhx use.rds.capacity --env prep']);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
when('the target access is null (defaults to prep)', () => {
|
|
129
|
+
const state = useBeforeAll(() =>
|
|
130
|
+
runUseWakeOfLivedb({ env: null, ci: false, configText: TUNNEL_CONFIG }),
|
|
131
|
+
);
|
|
132
|
+
then('it wakes the prep cluster by default', () => {
|
|
133
|
+
expect(state.execCalls).toEqual(['rhx use.rds.capacity --env prep']);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
when('the run is in ci', () => {
|
|
138
|
+
const state = useBeforeAll(() =>
|
|
139
|
+
runUseWakeOfLivedb({ env: 'prep', ci: true, configText: TUNNEL_CONFIG }),
|
|
140
|
+
);
|
|
141
|
+
then('it does NOT wake (ci wakes via the dedicated workflow step)', () => {
|
|
142
|
+
expect(state.execCalls).toEqual([]);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
when('the target access is prod', () => {
|
|
147
|
+
const state = useBeforeAll(() =>
|
|
148
|
+
runUseWakeOfLivedb({ env: 'prod', ci: false, configText: TUNNEL_CONFIG }),
|
|
149
|
+
);
|
|
150
|
+
then('it does NOT wake (prod never scales to 0)', () => {
|
|
151
|
+
expect(state.execCalls).toEqual([]);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
given('a service that reaches no shared cluster', () => {
|
|
157
|
+
when('its config is absent', () => {
|
|
158
|
+
const state = useBeforeAll(() =>
|
|
159
|
+
runUseWakeOfLivedb({ env: 'prep', ci: false, configText: null }),
|
|
160
|
+
);
|
|
161
|
+
then('it does NOT wake (no known cluster)', () => {
|
|
162
|
+
expect(state.execCalls).toEqual([]);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
when('its config declares no db tunnel', () => {
|
|
167
|
+
const state = useBeforeAll(() =>
|
|
168
|
+
runUseWakeOfLivedb({ env: 'prep', ci: false, configText: '{"database":{}}' }),
|
|
169
|
+
);
|
|
170
|
+
then('it does NOT wake (no reaches-cluster signal)', () => {
|
|
171
|
+
expect(state.execCalls).toEqual([]);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
given('a config the consumer authored but the setup cannot parse', () => {
|
|
177
|
+
when('the wake gate reads it', () => {
|
|
178
|
+
then('it throws a ConstraintError that names the parse failure (never a silent false)', async () => {
|
|
179
|
+
const error = await runUseWakeOfLivedb({
|
|
180
|
+
env: 'prep',
|
|
181
|
+
ci: false,
|
|
182
|
+
configText: '{ not: valid json',
|
|
183
|
+
}).catch((caught: unknown) => caught);
|
|
184
|
+
expect(error).toBeInstanceOf(Error);
|
|
185
|
+
expect((error as Error).name).toBe('ConstraintError');
|
|
186
|
+
expect((error as Error).message).toContain('could not parse');
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
given('the wake command fails', () => {
|
|
192
|
+
when('it fails with a child-process shape (a non-zero exit)', () => {
|
|
193
|
+
const state = useBeforeAll(() =>
|
|
194
|
+
runUseWakeOfLivedb({
|
|
195
|
+
env: 'prep',
|
|
196
|
+
ci: false,
|
|
197
|
+
configText: TUNNEL_CONFIG,
|
|
198
|
+
wakeThrows: { status: 1 },
|
|
199
|
+
}),
|
|
200
|
+
);
|
|
201
|
+
then('it tolerates the failure (non-fatal) and warns loud to stderr', () => {
|
|
202
|
+
expect(state.stderr.length).toBe(1);
|
|
203
|
+
});
|
|
204
|
+
then('the wake-failure warn matches snapshot', () => {
|
|
205
|
+
expect(state.stderr[0]).toMatchSnapshot('useWakeOfLivedb wake-failure warn');
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
when('it fails with a NON-child-process shape (a code malfunction)', () => {
|
|
210
|
+
then('it rethrows, never warns it away (rule.forbid.failhide)', async () => {
|
|
211
|
+
const error = await runUseWakeOfLivedb({
|
|
212
|
+
env: 'prep',
|
|
213
|
+
ci: false,
|
|
214
|
+
configText: TUNNEL_CONFIG,
|
|
215
|
+
wakeThrows: new Error('a real bug in this module'),
|
|
216
|
+
}).catch((caught: unknown) => caught);
|
|
217
|
+
expect(error).toBeInstanceOf(Error);
|
|
218
|
+
expect((error as Error).message).toBe('a real bug in this module');
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
given('a caller that reaches the cluster via its gateway, with no config/ dir (an expo app, #621)', () => {
|
|
224
|
+
when('the run targets prep, outside ci', () => {
|
|
225
|
+
const state = useBeforeAll(() =>
|
|
226
|
+
runUseWakeOfLivedb({
|
|
227
|
+
env: 'prep',
|
|
228
|
+
reaches: 'via-gateway',
|
|
229
|
+
ci: false,
|
|
230
|
+
configText: null,
|
|
231
|
+
}),
|
|
232
|
+
);
|
|
233
|
+
then('it wakes the prep cluster, with no tunnel config to gate on', () => {
|
|
234
|
+
expect(state.execCalls).toEqual(['rhx use.rds.capacity --env prep']);
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
when('the run targets prod', () => {
|
|
239
|
+
const state = useBeforeAll(() =>
|
|
240
|
+
runUseWakeOfLivedb({
|
|
241
|
+
env: 'prod',
|
|
242
|
+
reaches: 'via-gateway',
|
|
243
|
+
ci: false,
|
|
244
|
+
configText: null,
|
|
245
|
+
}),
|
|
246
|
+
);
|
|
247
|
+
then('it refuses to wake prod, rather than write capacity against production', () => {
|
|
248
|
+
expect(state.execCalls).toEqual([]);
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
when('the run targets test access', () => {
|
|
253
|
+
const state = useBeforeAll(() =>
|
|
254
|
+
runUseWakeOfLivedb({
|
|
255
|
+
env: 'test',
|
|
256
|
+
reaches: 'via-gateway',
|
|
257
|
+
ci: false,
|
|
258
|
+
configText: null,
|
|
259
|
+
}),
|
|
260
|
+
);
|
|
261
|
+
then('it wakes the prep cluster, since test access reaches prep peers', () => {
|
|
262
|
+
expect(state.execCalls).toEqual(['rhx use.rds.capacity --env prep']);
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* .what = clamps the pure wake decision the expo port asked for (#621): prod is refused, an
|
|
270
|
+
* undeclared access falls to prep (never prod), and ci is skipped.
|
|
271
|
+
* .teeth = flip the prod arm to `{ wake: true }` and [case1] reddens; default an absent access to
|
|
272
|
+
* prod and [case2] reddens.
|
|
273
|
+
*/
|
|
274
|
+
describe('getWakeDecision', () => {
|
|
275
|
+
const loadGetWakeDecision = (): ((input: {
|
|
276
|
+
access: 'test' | 'prep' | 'prod' | null;
|
|
277
|
+
ci: string | null;
|
|
278
|
+
}) => { wake: boolean; access: 'test' | 'prep' | 'prod' }) => {
|
|
279
|
+
const { getWakeDecision } = getModuleExportsFromTsSource<{
|
|
280
|
+
getWakeDecision: (input: {
|
|
281
|
+
access: 'test' | 'prep' | 'prod' | null;
|
|
282
|
+
ci: string | null;
|
|
283
|
+
}) => { wake: boolean; access: 'test' | 'prep' | 'prod' };
|
|
284
|
+
}>({ source: readFileSync(SOURCE_PATH, 'utf8'), requireStub: () => ({}) });
|
|
285
|
+
return getWakeDecision!;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
given('[case1] prod access', () => {
|
|
289
|
+
then('it refuses to wake prod, rather than write capacity against production', () => {
|
|
290
|
+
expect(loadGetWakeDecision()({ access: 'prod', ci: null }).wake).toEqual(false);
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
given('[case2] no declared access', () => {
|
|
295
|
+
then('an undeclared access falls to prep, never to prod', () => {
|
|
296
|
+
const decision = loadGetWakeDecision()({ access: null, ci: null });
|
|
297
|
+
expect(decision).toEqual({ wake: true, access: 'prep' });
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
given('[case3] test access', () => {
|
|
302
|
+
then('it wakes the prep cluster its peers query', () => {
|
|
303
|
+
expect(loadGetWakeDecision()({ access: 'test', ci: null })).toEqual({
|
|
304
|
+
wake: true,
|
|
305
|
+
access: 'prep',
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
given('[case4] a ci runner', () => {
|
|
311
|
+
then('it does not wake (ci wakes via its own workflow step)', () => {
|
|
312
|
+
expect(loadGetWakeDecision()({ access: 'prep', ci: 'true' }).wake).toEqual(false);
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { executeApply } from 'declapract';
|
|
5
|
+
import { given, then, useThen, when } from 'test-fns';
|
|
6
|
+
|
|
7
|
+
import { isOnRetiredLambdaTestLib } from '../../utils/asSourceOnRunLambdaEndpoint';
|
|
8
|
+
import { genTempRepoWithDeclarationsOutside } from '../../utils/genTempRepoWithDeclarationsOutside';
|
|
9
|
+
|
|
10
|
+
// one file-scoped executeApply evaluates the tests-any practice; grant a wide bound
|
|
11
|
+
jest.setTimeout(240_000);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* .what = end-to-end proof of the three old-acceptance-test-utils bad-practices (`-`, `-2`, `-3`):
|
|
15
|
+
* each moves a `blackbox/lambdas/*.ts` acceptance test off its old util import and, in the
|
|
16
|
+
* same apply, off the retired lambda test lib onto runLambdaEndpoint (#650).
|
|
17
|
+
* .why = the unit tests prove each fix in isolation; only the real pipeline proves the glob matches
|
|
18
|
+
* the consumer file, `getProjectVariables` reads the consumer's declapract.use.yml, and a
|
|
19
|
+
* second apply over the output converges (rule.require.declapract-integration-tests).
|
|
20
|
+
* .note = the declarations mirror holds the tests-any practice alone (the tests-any-only usecase),
|
|
21
|
+
* mounted OUTSIDE the temp repo, so the apply evaluates one practice and walks no link back
|
|
22
|
+
* into this repo's source. each apply is scoped with `file` too.
|
|
23
|
+
* this file sits at the practice ROOT: a test directly under `bad-practices/` has no
|
|
24
|
+
* bad-practice name to extract, and declapract throws.
|
|
25
|
+
*/
|
|
26
|
+
const RETIRED_LIB = 'simple-lambda-testing-methods';
|
|
27
|
+
const CASES = [
|
|
28
|
+
{
|
|
29
|
+
slug: 'old-acceptance-test-utils',
|
|
30
|
+
fixture: 'repo-old-acceptance-utils',
|
|
31
|
+
file: 'blackbox/lambdas/consumeSESEmailEventFromSNS.acceptance.test.ts',
|
|
32
|
+
oldImport: "import { invokeLambda } from '../_utils/invokeLambda';",
|
|
33
|
+
whichExpected:
|
|
34
|
+
"which: { service: 'svc-notifications', function: 'consumeSESEmailEventFromSNS' }",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
slug: 'old-acceptance-test-utils-2',
|
|
38
|
+
fixture: 'repo-old-acceptance-utils-2',
|
|
39
|
+
file: 'blackbox/lambdas/addDecoratedImage.acceptance.test.ts',
|
|
40
|
+
oldImport: "import { locally } from '../__test_utils__/environment';",
|
|
41
|
+
whichExpected:
|
|
42
|
+
"which: { service: 'svc-images', function: 'addDecoratedImage' }",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
slug: 'old-acceptance-test-utils-3',
|
|
46
|
+
fixture: 'repo-old-acceptance-utils-3',
|
|
47
|
+
file: 'blackbox/lambdas/addDecoratedImage.acceptance.test.ts',
|
|
48
|
+
oldImport: "import { locally } from '../_utils/environment';",
|
|
49
|
+
whichExpected:
|
|
50
|
+
"which: { service: 'svc-images', function: 'addDecoratedImage' }",
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
describe('tests-any old-acceptance-test-utils', () => {
|
|
55
|
+
CASES.forEach((thisCase, index) =>
|
|
56
|
+
given(`[case${index + 1}] a repo on the ${thisCase.slug} shape`, () => {
|
|
57
|
+
const tempDir = genTempRepoWithDeclarationsOutside({
|
|
58
|
+
slug: `declapract-${thisCase.slug}`,
|
|
59
|
+
clone: `./src/practices/tests-any/.test/assets/${thisCase.fixture}`,
|
|
60
|
+
declarations: './src/.test/assets/tests-any-only/declarations',
|
|
61
|
+
symlink: [{ at: 'node_modules', to: 'node_modules' }],
|
|
62
|
+
});
|
|
63
|
+
const read = () =>
|
|
64
|
+
fs.readFile(path.join(tempDir, thisCase.file), 'utf-8');
|
|
65
|
+
const applyOne = () =>
|
|
66
|
+
executeApply({
|
|
67
|
+
config: path.join(tempDir, 'declapract.use.yml'),
|
|
68
|
+
practice: 'tests-any',
|
|
69
|
+
file: thisCase.file,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
when('[t0] the input (before any fix)', () => {
|
|
73
|
+
then('the file holds the old import, and matches snapshot', async () => {
|
|
74
|
+
const before = await read();
|
|
75
|
+
expect(before).toContain(thisCase.oldImport);
|
|
76
|
+
expect(before).toMatchSnapshot(`${thisCase.slug} — before`);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
when('[t1] the fix is applied', () => {
|
|
81
|
+
const after = useThen('apply succeeds', async () => {
|
|
82
|
+
await applyOne();
|
|
83
|
+
return { contents: await read() };
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
then('the old import is gone, and the environment import points at ../environment', () => {
|
|
87
|
+
expect(after.contents).not.toContain(thisCase.oldImport);
|
|
88
|
+
expect(after.contents).toContain(
|
|
89
|
+
"import { locally } from '../environment';",
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
then('the file is off the retired lib, onto runLambdaEndpoint (#650)', () => {
|
|
94
|
+
expect(after.contents).not.toContain(RETIRED_LIB);
|
|
95
|
+
expect(isOnRetiredLambdaTestLib({ contents: after.contents })).toBe(
|
|
96
|
+
false,
|
|
97
|
+
);
|
|
98
|
+
expect(after.contents).toContain('runLambdaEndpoint.onSerialized');
|
|
99
|
+
expect(after.contents).toContain(thisCase.whichExpected);
|
|
100
|
+
expect(after.contents).toContain("at: locally ? 'local' : 'cloud'");
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
then('no template token leaks, and the file matches snapshot', () => {
|
|
104
|
+
expect(after.contents).not.toContain('@declapract{');
|
|
105
|
+
expect(after.contents).toMatchSnapshot(`${thisCase.slug} — after`);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
when('[t2] the fix is applied a second time (idempotency)', () => {
|
|
110
|
+
const passes = useThen('a second apply over its own output', async () => {
|
|
111
|
+
const before = await read();
|
|
112
|
+
await applyOne();
|
|
113
|
+
return { before, after: await read() };
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
then('the second apply is a no-op', () => {
|
|
117
|
+
expect(passes.after).toEqual(passes.before);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}),
|
|
121
|
+
);
|
|
122
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* .what = read the whitespace-split arg list out of the stand-in jest echo output.
|
|
5
|
+
* .why = a pure transformer that names the `JEST_ARGS: …` decode, so `getJestFlags` reads
|
|
6
|
+
* what-not-how rather than an inline regex-match + positional `match[1]` a reader must
|
|
7
|
+
* simulate. no output line = an empty arg list.
|
|
8
|
+
*/
|
|
9
|
+
const asArgsFromJestEchoOutput = (input: { output: string }): string[] => {
|
|
10
|
+
const found = input.output.match(/JEST_ARGS: (.*)/);
|
|
11
|
+
if (!found) return [];
|
|
12
|
+
return found[1].split(/\s+/).filter(Boolean);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Tests the shell flag expressions used in package.json test commands.
|
|
17
|
+
*
|
|
18
|
+
* These tests verify that env vars like RESNAP and THOROUGH produce
|
|
19
|
+
* the correct flags when passed to jest via the package.json commands.
|
|
20
|
+
*
|
|
21
|
+
* We use a stand-in jest function that echoes the arguments it receives,
|
|
22
|
+
* so we can verify what flags would actually be passed.
|
|
23
|
+
*
|
|
24
|
+
* .why integration = this drives a real `bash -c` via execSync — a child-process
|
|
25
|
+
* boundary. per rule.forbid.unit.remote-boundaries a `.test.ts` (unit) may not
|
|
26
|
+
* cross a process boundary, so the shell-flag behavior is proven at the
|
|
27
|
+
* integration grain, where a real shell is the point of the test.
|
|
28
|
+
*/
|
|
29
|
+
describe('package.json shell flag expressions', () => {
|
|
30
|
+
/**
|
|
31
|
+
* Evaluates a shell command with given env vars and returns the arguments
|
|
32
|
+
* that would be passed to jest (everything after the config flag).
|
|
33
|
+
*/
|
|
34
|
+
const getJestFlags = (
|
|
35
|
+
command: string,
|
|
36
|
+
env: Record<string, string | undefined>,
|
|
37
|
+
): string[] => {
|
|
38
|
+
// .note = deliberate mutation — cleanEnv is built up across two scoped local loops (base env
|
|
39
|
+
// minus the flag vars, then the test overlay); a single-threaded local zone
|
|
40
|
+
// (rule.require.immutable-vars sanctions in-place mutation with this note).
|
|
41
|
+
const cleanEnv: Record<string, string> = {};
|
|
42
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
43
|
+
if (!['CI', 'THOROUGH', 'RESNAP'].includes(key) && value !== undefined) {
|
|
44
|
+
cleanEnv[key] = value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// overlay the test env vars (undefined means unset)
|
|
48
|
+
for (const [key, value] of Object.entries(env)) {
|
|
49
|
+
if (value !== undefined) {
|
|
50
|
+
cleanEnv[key] = value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// run the command with jest replaced by echo to capture args
|
|
55
|
+
const result = execSync(
|
|
56
|
+
`bash -c 'jest() { echo "JEST_ARGS: $*"; }; ${command}'`,
|
|
57
|
+
{
|
|
58
|
+
env: cleanEnv,
|
|
59
|
+
encoding: 'utf-8',
|
|
60
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
61
|
+
// bound the call so a stuck shell fails fast rather than hangs the suite;
|
|
62
|
+
// the command is a trivial echo, so 5s is generous
|
|
63
|
+
timeout: 5000,
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
// read the jest args out of the stand-in echo output (named, what-not-how)
|
|
68
|
+
return asArgsFromJestEchoOutput({ output: result });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// the test:unit command from package.json best-practice
|
|
72
|
+
const testUnitCommand = `set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n "\${CI:-}" ] && echo '--ci') $([ "\${THOROUGH:-}" != "true" ] && echo '--changedSince=origin/main') $([ "\${RESNAP:-}" = "true" ] && echo '--updateSnapshot')`;
|
|
73
|
+
|
|
74
|
+
describe('RESNAP flag', () => {
|
|
75
|
+
it('should pass --updateSnapshot when RESNAP=true', () => {
|
|
76
|
+
const flags = getJestFlags(testUnitCommand, { RESNAP: 'true' });
|
|
77
|
+
expect(flags).toContain('--updateSnapshot');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should not pass --updateSnapshot when RESNAP is unset', () => {
|
|
81
|
+
const flags = getJestFlags(testUnitCommand, {});
|
|
82
|
+
expect(flags).not.toContain('--updateSnapshot');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should not pass --updateSnapshot when RESNAP=false', () => {
|
|
86
|
+
const flags = getJestFlags(testUnitCommand, { RESNAP: 'false' });
|
|
87
|
+
expect(flags).not.toContain('--updateSnapshot');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('should not pass --updateSnapshot when RESNAP is empty string', () => {
|
|
91
|
+
const flags = getJestFlags(testUnitCommand, { RESNAP: '' });
|
|
92
|
+
expect(flags).not.toContain('--updateSnapshot');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('should not pass --updateSnapshot when RESNAP=0', () => {
|
|
96
|
+
const flags = getJestFlags(testUnitCommand, { RESNAP: '0' });
|
|
97
|
+
expect(flags).not.toContain('--updateSnapshot');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('THOROUGH flag', () => {
|
|
102
|
+
it('should pass --changedSince=origin/main when THOROUGH is unset (run only changed)', () => {
|
|
103
|
+
const flags = getJestFlags(testUnitCommand, {});
|
|
104
|
+
expect(flags).toContain('--changedSince=origin/main');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should pass --changedSince=origin/main when THOROUGH=false', () => {
|
|
108
|
+
const flags = getJestFlags(testUnitCommand, { THOROUGH: 'false' });
|
|
109
|
+
expect(flags).toContain('--changedSince=origin/main');
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('should pass --changedSince=origin/main when THOROUGH is empty string', () => {
|
|
113
|
+
const flags = getJestFlags(testUnitCommand, { THOROUGH: '' });
|
|
114
|
+
expect(flags).toContain('--changedSince=origin/main');
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('should not pass --changedSince=origin/main when THOROUGH=true (run all tests)', () => {
|
|
118
|
+
const flags = getJestFlags(testUnitCommand, { THOROUGH: 'true' });
|
|
119
|
+
expect(flags).not.toContain('--changedSince=origin/main');
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
describe('CI flag', () => {
|
|
124
|
+
it('should pass --ci when CI=true', () => {
|
|
125
|
+
const flags = getJestFlags(testUnitCommand, { CI: 'true' });
|
|
126
|
+
expect(flags).toContain('--ci');
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('should pass --ci when CI=1', () => {
|
|
130
|
+
const flags = getJestFlags(testUnitCommand, { CI: '1' });
|
|
131
|
+
expect(flags).toContain('--ci');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('should not pass --ci when CI is unset', () => {
|
|
135
|
+
const flags = getJestFlags(testUnitCommand, {});
|
|
136
|
+
expect(flags).not.toContain('--ci');
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
|
|
4
|
+
import type { FileCheckContext, FileCheckFunction } from 'declapract';
|
|
5
|
+
import { genTempDir, getError, given, then } from 'test-fns';
|
|
6
|
+
|
|
7
|
+
import { check as checkServiceAcceptance } from '../tests-service/best-practice/blackbox/**/*.acceptance.test.ts.declapract';
|
|
8
|
+
import { check as checkServiceLambdaAcceptance } from '../tests-service/best-practice/blackbox/lambdas/*.acceptance.test.ts.declapract';
|
|
9
|
+
import { check as checkServiceIntegration } from '../tests-service/best-practice/src/**/*.integration.test.ts.declapract';
|
|
10
|
+
import { check as checkAnyIntegration } from './best-practice/src/**/*.integration.test.ts.declapract';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* .what = clamps #679 on every name-keyed test-presence declaration: a repo whose tests carry only
|
|
14
|
+
* the `._.` kind seam (`._.intg`, `._.acpt`) passes, as one with the old suffix does; a repo
|
|
15
|
+
* with neither form still fails.
|
|
16
|
+
* .why = the jest configs match both suffix forms; a declaration that still demanded the old
|
|
17
|
+
* suffix would flag a repo that runs that suite just fine.
|
|
18
|
+
* .teeth = revert any declaration to `FileCheckType.EXISTS` (or to a throw on absent contents) and
|
|
19
|
+
* its seam case reddens (an enum is no function; a bare throw rejects the seam repo).
|
|
20
|
+
* .note = sits at the practice root, so declapract never reads it as a declaration.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
// the single documented cast: these checks read only getProjectRootDirectory() + relativeFilePath.
|
|
24
|
+
const genContextForRoot = (root: string): FileCheckContext =>
|
|
25
|
+
({
|
|
26
|
+
getProjectRootDirectory: () => root,
|
|
27
|
+
relativeFilePath: 'absent',
|
|
28
|
+
}) as unknown as FileCheckContext;
|
|
29
|
+
|
|
30
|
+
const DECLARATIONS: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
check: unknown;
|
|
33
|
+
dir: string;
|
|
34
|
+
seamFile: string;
|
|
35
|
+
}> = [
|
|
36
|
+
{
|
|
37
|
+
name: 'tests-any integration',
|
|
38
|
+
check: checkAnyIntegration,
|
|
39
|
+
dir: 'src',
|
|
40
|
+
seamFile: 'a._.intg.test.ts',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'tests-service integration',
|
|
44
|
+
check: checkServiceIntegration,
|
|
45
|
+
dir: 'src',
|
|
46
|
+
seamFile: 'a._.intg.test.ts',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'tests-service blackbox acceptance',
|
|
50
|
+
check: checkServiceAcceptance,
|
|
51
|
+
dir: 'blackbox',
|
|
52
|
+
seamFile: 'a._.acpt.test.ts',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'tests-service lambda acceptance',
|
|
56
|
+
check: checkServiceLambdaAcceptance,
|
|
57
|
+
dir: 'blackbox/lambdas',
|
|
58
|
+
seamFile: 'getWidget._.acpt.test.ts',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
describe('#679 test-kind presence accepts the `._.` seam', () => {
|
|
63
|
+
for (const declaration of DECLARATIONS) {
|
|
64
|
+
given(`[case] the ${declaration.name} declaration, on a repo with only ${declaration.seamFile}`, () => {
|
|
65
|
+
then('the check is a function that passes', async () => {
|
|
66
|
+
expect(typeof declaration.check).toEqual('function');
|
|
67
|
+
const root = genTempDir({ slug: `seam-${declaration.name.replaceAll(' ', '-')}` });
|
|
68
|
+
mkdirSync(join(root, declaration.dir), { recursive: true });
|
|
69
|
+
writeFileSync(join(root, declaration.dir, declaration.seamFile), '// test');
|
|
70
|
+
await (declaration.check as FileCheckFunction)(null, genContextForRoot(root));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
given(`[case] the ${declaration.name} declaration, on a repo with no test of either form`, () => {
|
|
75
|
+
then('the check still fails', async () => {
|
|
76
|
+
const root = genTempDir({ slug: `seamless-${declaration.name.replaceAll(' ', '-')}` });
|
|
77
|
+
mkdirSync(join(root, declaration.dir), { recursive: true });
|
|
78
|
+
const error = await getError(
|
|
79
|
+
async () =>
|
|
80
|
+
(declaration.check as FileCheckFunction)(null, genContextForRoot(root)),
|
|
81
|
+
);
|
|
82
|
+
expect(error.message).toContain(declaration.dir);
|
|
83
|
+
expect(error.message).toMatchSnapshot();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|