@aws-cdk-testing/cli-integ 3.5.0 → 3.6.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.
Files changed (307) hide show
  1. package/lib/aws.js +6 -9
  2. package/lib/cli/query-github.js +2 -3
  3. package/lib/cli/run-suite.js +2 -3
  4. package/lib/cli/stage-distribution.js +4 -4
  5. package/lib/eventually.js +3 -3
  6. package/lib/files.js +2 -3
  7. package/lib/github.js +5 -6
  8. package/lib/integ-test.js +58 -3
  9. package/lib/package-sources/release-source.d.ts +1 -1
  10. package/lib/package-sources/release-source.js +2 -3
  11. package/lib/package-sources/repo-source.d.ts +1 -1
  12. package/lib/package-sources/repo-source.js +1 -1
  13. package/lib/package-sources/repo-tools/npm.js +4 -5
  14. package/lib/package-sources/subprocess.d.ts +1 -1
  15. package/lib/package-sources/subprocess.js +1 -1
  16. package/lib/process.js +5 -6
  17. package/lib/proxy.d.ts +1 -1
  18. package/lib/proxy.js +2 -2
  19. package/lib/resource-pool.js +5 -3
  20. package/lib/shell.d.ts +3 -3
  21. package/lib/shell.js +8 -12
  22. package/lib/staging/codeartifact.js +8 -11
  23. package/lib/staging/maven.d.ts +2 -2
  24. package/lib/staging/maven.js +3 -5
  25. package/lib/staging/npm.d.ts +2 -2
  26. package/lib/staging/npm.js +1 -1
  27. package/lib/staging/nuget.d.ts +2 -2
  28. package/lib/staging/nuget.js +1 -1
  29. package/lib/staging/parallel-shell.js +2 -2
  30. package/lib/staging/pypi.d.ts +2 -2
  31. package/lib/staging/pypi.js +1 -1
  32. package/lib/with-aws.d.ts +2 -2
  33. package/lib/with-aws.js +5 -4
  34. package/lib/with-cdk-app.d.ts +7 -5
  35. package/lib/with-cdk-app.js +28 -33
  36. package/lib/with-cli-lib.d.ts +4 -3
  37. package/lib/with-cli-lib.js +1 -1
  38. package/lib/with-packages.d.ts +1 -1
  39. package/lib/with-packages.js +1 -1
  40. package/lib/with-sam.d.ts +3 -3
  41. package/lib/with-sam.js +4 -7
  42. package/lib/with-temporary-directory.d.ts +1 -1
  43. package/lib/with-temporary-directory.js +1 -1
  44. package/lib/xpmutex.js +5 -3
  45. package/npm-shrinkwrap.json +8722 -0
  46. package/package.json +11 -7
  47. package/resources/cdk-apps/refactoring/cdk.json +7 -0
  48. package/resources/cdk-apps/refactoring/refactoring.js +18 -0
  49. package/test-reports/junit.xml +15 -0
  50. package/tests/cli-integ-tests/cdk-assets/cdk-assets-uses-profile.integtest.js +11 -11
  51. package/tests/cli-integ-tests/cdk-assets/smoketest.integtest.js +9 -9
  52. package/tests/cli-integ-tests/cdk-bootstrap-add-tags.integtest.js +2 -3
  53. package/tests/cli-integ-tests/cdk-bootstrap-can-add-tags-then-update-tags-during-re-bootstrap.integtest.js +2 -3
  54. package/tests/cli-integ-tests/cdk-bootstrap-can-bootstrap-without-execution.integtest.js +2 -3
  55. package/tests/cli-integ-tests/cdk-bootstrap-can-create-a-legacy-bootstrap-stack-with---public-access-block-configuration-false.integtest.js +2 -3
  56. package/tests/cli-integ-tests/cdk-bootstrap-can-create-multiple-legacy-bootstrap-stacks.integtest.js +2 -3
  57. package/tests/cli-integ-tests/cdk-bootstrap-can-remove-custompermissionsboundary.integtest.js +4 -6
  58. package/tests/cli-integ-tests/cdk-bootstrap-can-remove-trusted-account.integtest.js +2 -3
  59. package/tests/cli-integ-tests/cdk-bootstrap-create-ecr-with-tag-immutability-to-set-on.integtest.js +4 -5
  60. package/tests/cli-integ-tests/cdk-bootstrap-switch-on-termination-protection.integtest.js +2 -3
  61. package/tests/cli-integ-tests/cdk-ci-true-output-to-stdout.integtest.js +1 -1
  62. package/tests/cli-integ-tests/cdk-deploy---method-direct.integtest.js +2 -3
  63. package/tests/cli-integ-tests/cdk-deploy-and-test-stack-with-lambda-asset.integtest.js +3 -4
  64. package/tests/cli-integ-tests/cdk-deploy-deletes-all-notification-arns-when-empty-array-is-passed.integtest.js +3 -4
  65. package/tests/cli-integ-tests/cdk-deploy-preserves-existing-notification-arns-when-not-specified.integtest.js +2 -3
  66. package/tests/cli-integ-tests/cdk-deploy-with-import-existing-resources-true.integtest.js +2 -3
  67. package/tests/cli-integ-tests/cdk-deploy-with-notification-arn-as-flag.integtest.js +2 -3
  68. package/tests/cli-integ-tests/cdk-deploy-with-notification-arn-as-prop-and-flag.integtest.js +2 -3
  69. package/tests/cli-integ-tests/cdk-deploy-with-notification-arn-as-prop.integtest.js +2 -3
  70. package/tests/cli-integ-tests/cdk-deploy-with-parameters-multi.integtest.js +3 -4
  71. package/tests/cli-integ-tests/cdk-deploy-with-parameters.integtest.js +2 -3
  72. package/tests/cli-integ-tests/cdk-deploy-without-execute-a-named-change-set.integtest.js +2 -3
  73. package/tests/cli-integ-tests/cdk-deploy-without-import-existing-resources.integtest.js +2 -3
  74. package/tests/cli-integ-tests/cdk-deploy.integtest.js +2 -3
  75. package/tests/cli-integ-tests/cdk-destroy-interactive.integtest.js +6 -7
  76. package/tests/cli-integ-tests/cdk-fast-deploy.integtest.js +4 -5
  77. package/tests/cli-integ-tests/cdk-gc-garbage-collection-untags-in-use-s3-objects.integtest.js +2 -2
  78. package/tests/cli-integ-tests/cdk-hotswap-deployment-for-ecs-service-waits-for-deployment-to-complete.integtest.js +6 -5
  79. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-appsync-apis-with-many-functions.integtest.js +2 -3
  80. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-ecs-service.integtest.js +3 -4
  81. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-fn::importvalue-intrinsic.integtest.js +3 -4
  82. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-lambda-functions-description-and-environment-variables.integtest.js +3 -4
  83. package/tests/cli-integ-tests/cdk-hotswap-ecs-deployment-respects-properties-override.integtest.js +5 -6
  84. package/tests/cli-integ-tests/cdk-import-interactive.integtest.js +5 -6
  85. package/tests/cli-integ-tests/cdk-lib-cli-lib-deploy.integtest.js +2 -3
  86. package/tests/cli-integ-tests/cdk-lib-security-related-changes-without-a-cli-are-expected-to-fail-when-approval-is-required.integtest.js +1 -2
  87. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-csharp.integtest.js +1 -1
  88. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-java.integtest.js +1 -1
  89. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-python.integtest.js +1 -1
  90. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-typescript.integtest.js +1 -1
  91. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-csharp.integtest.js +1 -1
  92. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-java.integtest.js +1 -1
  93. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-python.integtest.js +1 -1
  94. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-typescript.integtest.js +1 -1
  95. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-generates-migrate.json.integtest.js +1 -1
  96. package/tests/cli-integ-tests/cdk-migrate/testcase.d.ts +1 -1
  97. package/tests/cli-integ-tests/cdk-migrate/testcase.js +4 -6
  98. package/tests/cli-integ-tests/cdk-nested-stack-with-parameters.integtest.js +2 -3
  99. package/tests/cli-integ-tests/cdk-refactor-dry-run.integtest.d.ts +1 -0
  100. package/tests/cli-integ-tests/cdk-refactor-dry-run.integtest.js +41 -0
  101. package/tests/cli-integ-tests/cdk-requests-go-through-a-proxy-when-configured.integtest.js +2 -3
  102. package/tests/cli-integ-tests/cdk-stack-in-update_rollback_complete-state-can-be-updated.integtest.js +5 -6
  103. package/tests/cli-integ-tests/cdk-test-migrate-deployment-for-app-with-localfile-source-in-migrate.json.integtest.js +4 -4
  104. package/tests/cli-integ-tests/cdk-update-to-stack-in-rollback_complete-state-will-delete-stack-and-create-a-new-one.integtest.js +5 -6
  105. package/tests/cli-integ-tests/proxy.integtest.js +2 -3
  106. package/tests/init-go/init-go.integtest.js +2 -3
  107. package/tests/init-typescript-app/init-typescript-app.integtest.js +1 -1
  108. package/tests/tool-integrations/amplify.integtest.js +4 -4
  109. package/tests/tool-integrations/with-tool-context.d.ts +5 -5
  110. package/tests/tool-integrations/with-tool-context.js +1 -1
  111. package/.eslintrc.js +0 -9
  112. package/lib/aws.ts +0 -303
  113. package/lib/cli/query-github.ts +0 -56
  114. package/lib/cli/run-suite.ts +0 -153
  115. package/lib/cli/stage-distribution.ts +0 -262
  116. package/lib/cli/test-root.ts +0 -3
  117. package/lib/corking.ts +0 -33
  118. package/lib/eventually.ts +0 -42
  119. package/lib/files.ts +0 -80
  120. package/lib/github.ts +0 -43
  121. package/lib/index.ts +0 -13
  122. package/lib/integ-test.ts +0 -110
  123. package/lib/lists.ts +0 -9
  124. package/lib/memoize.ts +0 -14
  125. package/lib/npm.ts +0 -41
  126. package/lib/package-sources/release-source.ts +0 -82
  127. package/lib/package-sources/repo-source.ts +0 -112
  128. package/lib/package-sources/repo-tools/npm.ts +0 -48
  129. package/lib/package-sources/source.ts +0 -35
  130. package/lib/package-sources/subprocess.ts +0 -15
  131. package/lib/process.ts +0 -154
  132. package/lib/proxy.ts +0 -64
  133. package/lib/resource-pool.ts +0 -140
  134. package/lib/resources.ts +0 -4
  135. package/lib/shell.ts +0 -331
  136. package/lib/staging/codeartifact.ts +0 -387
  137. package/lib/staging/maven.ts +0 -95
  138. package/lib/staging/npm.ts +0 -62
  139. package/lib/staging/nuget.ts +0 -75
  140. package/lib/staging/parallel-shell.ts +0 -51
  141. package/lib/staging/pypi.ts +0 -50
  142. package/lib/staging/usage-dir.ts +0 -99
  143. package/lib/with-aws.ts +0 -111
  144. package/lib/with-cdk-app.ts +0 -847
  145. package/lib/with-cli-lib.ts +0 -150
  146. package/lib/with-packages.ts +0 -15
  147. package/lib/with-sam.ts +0 -295
  148. package/lib/with-temporary-directory.ts +0 -35
  149. package/lib/with-timeout.ts +0 -33
  150. package/lib/xpmutex.ts +0 -218
  151. package/resources/cli-regression-patches/v2.130.0/node_modules/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/lib/nested-stack.js +0 -19
  152. package/resources/cli-regression-patches/v2.130.0/node_modules/@aws-cdk-testing/cli-integ/resources/cdk-apps/sam_cdk_integ_app/lib/test-stack.js +0 -134
  153. package/tests/cli-integ-tests/cdk---exclusively-selects-only-selected-stack.integtest.ts +0 -29
  154. package/tests/cli-integ-tests/cdk-assets/cdk-assets-uses-profile.integtest.ts +0 -92
  155. package/tests/cli-integ-tests/cdk-assets/smoketest.integtest.ts +0 -82
  156. package/tests/cli-integ-tests/cdk-automatic-ordering-with-concurrency.integtest.ts +0 -15
  157. package/tests/cli-integ-tests/cdk-automatic-ordering.integtest.ts +0 -15
  158. package/tests/cli-integ-tests/cdk-automatic-rollback-if-paused-and---no-rollback-is-removed-from-flags.integtest.ts +0 -40
  159. package/tests/cli-integ-tests/cdk-automatic-rollback-if-paused-and-change-contains-a-replacement.integtest.ts +0 -40
  160. package/tests/cli-integ-tests/cdk-automatic-rollback-if-replacement-and---no-rollback-is-removed-from-flags.integtest.ts +0 -29
  161. package/tests/cli-integ-tests/cdk-bootstrap-a-customized-template-vendor-will-not-overwrite-the-default-template.integtest.ts +0 -42
  162. package/tests/cli-integ-tests/cdk-bootstrap-add-tags.integtest.ts +0 -26
  163. package/tests/cli-integ-tests/cdk-bootstrap-can-add-tags-then-update-tags-during-re-bootstrap.integtest.ts +0 -28
  164. package/tests/cli-integ-tests/cdk-bootstrap-can-and-deploy-if-omitting-execution-policies.integtest.ts +0 -21
  165. package/tests/cli-integ-tests/cdk-bootstrap-can-bootstrap-without-execution.integtest.ts +0 -22
  166. package/tests/cli-integ-tests/cdk-bootstrap-can-create-a-legacy-bootstrap-stack-with---public-access-block-configuration-false.integtest.ts +0 -21
  167. package/tests/cli-integ-tests/cdk-bootstrap-can-create-multiple-legacy-bootstrap-stacks.integtest.ts +0 -27
  168. package/tests/cli-integ-tests/cdk-bootstrap-can-deploy-modern-synthesized-stack-even-if-bootstrap-stack-name-is-unknown.integtest.ts +0 -24
  169. package/tests/cli-integ-tests/cdk-bootstrap-can-deploy-with-session-tags-on-the-deploy.integtest.ts +0 -25
  170. package/tests/cli-integ-tests/cdk-bootstrap-can-deploy-without-execution-role-and-with-session-tags-on-deploy-role.integtest.ts +0 -22
  171. package/tests/cli-integ-tests/cdk-bootstrap-can-dump-the-template.integtest.ts +0 -32
  172. package/tests/cli-integ-tests/cdk-bootstrap-can-remove-custompermissionsboundary.integtest.ts +0 -77
  173. package/tests/cli-integ-tests/cdk-bootstrap-can-remove-trusted-account.integtest.ts +0 -30
  174. package/tests/cli-integ-tests/cdk-bootstrap-can-use-the-custom-permissions-boundary-(with-slashes)-to-bootstrap.integtest.ts +0 -15
  175. package/tests/cli-integ-tests/cdk-bootstrap-can-use-the-custom-permissions-boundary-to-bootstrap.integtest.ts +0 -15
  176. package/tests/cli-integ-tests/cdk-bootstrap-can-use-the-default-permissions-boundary-to-bootstrap.integtest.ts +0 -15
  177. package/tests/cli-integ-tests/cdk-bootstrap-create-ecr-with-tag-immutability-to-set-on.integtest.ts +0 -34
  178. package/tests/cli-integ-tests/cdk-bootstrap-deploy-new-style-synthesis-to-new-style-bootstrap-(with-docker-image).integtest.ts +0 -22
  179. package/tests/cli-integ-tests/cdk-bootstrap-deploy-new-style-synthesis-to-new-style-bootstrap.integtest.ts +0 -22
  180. package/tests/cli-integ-tests/cdk-bootstrap-deploy-old-style-synthesis-to-new-style-bootstrap.integtest.ts +0 -21
  181. package/tests/cli-integ-tests/cdk-bootstrap-switch-on-termination-protection.integtest.ts +0 -24
  182. package/tests/cli-integ-tests/cdk-bootstrap-upgrade-legacy-bootstrap-stack-to-new-bootstrap-stack-while-in-use.integtest.ts +0 -47
  183. package/tests/cli-integ-tests/cdk-can-still-load-old-assemblies.integtest.ts +0 -57
  184. package/tests/cli-integ-tests/cdk-cdk-diff---fail-on-multiple-stacks-exits-with-error-if-any-of-the-stacks-contains-a-diff.integtest.ts +0 -22
  185. package/tests/cli-integ-tests/cdk-cdk-diff---fail-with-multiple-stack-exits-with-if-any-of-the-stacks-contains-a-diff.integtest.ts +0 -22
  186. package/tests/cli-integ-tests/cdk-cdk-diff---quiet-does-not-print-there-were-no-differences-message-for-stacks-which-have-no-differences.integtest.ts +0 -19
  187. package/tests/cli-integ-tests/cdk-cdk-diff---security-only---fail-exits-when-security-changes-are-present.integtest.ts +0 -14
  188. package/tests/cli-integ-tests/cdk-cdk-diff---security-only---fail-exits-when-security-diff-for-sso-access-control-config.integtest.ts +0 -13
  189. package/tests/cli-integ-tests/cdk-cdk-diff---security-only---fail-exits-when-security-diff-for-sso-assignment.integtest.ts +0 -13
  190. package/tests/cli-integ-tests/cdk-cdk-diff---security-only---fail-exits-when-security-diff-for-sso-perm-set-with-managed-policy.integtest.ts +0 -13
  191. package/tests/cli-integ-tests/cdk-cdk-diff---security-only---fail-exits-when-security-diff-for-sso-perm-set-without-managed-policy.integtest.ts +0 -13
  192. package/tests/cli-integ-tests/cdk-cdk-diff---security-only-successfully-outputs-sso-access-control-information.integtest.ts +0 -35
  193. package/tests/cli-integ-tests/cdk-cdk-diff---security-only-successfully-outputs-sso-assignment-information.integtest.ts +0 -37
  194. package/tests/cli-integ-tests/cdk-cdk-diff---security-only-successfully-outputs-sso-permission-set-with-managed-policy-information.integtest.ts +0 -35
  195. package/tests/cli-integ-tests/cdk-cdk-diff---security-only-successfully-outputs-sso-permission-set-without-managed-policy-information.integtest.ts +0 -37
  196. package/tests/cli-integ-tests/cdk-cdk-diff-doesnt-show-resource-metadata-changes.integtest.ts +0 -23
  197. package/tests/cli-integ-tests/cdk-cdk-diff-shows-resource-metadata-changes-with---no-change-set.integtest.ts +0 -23
  198. package/tests/cli-integ-tests/cdk-cdk-diff-with-large-changeset-and-custom-toolkit-stack-name-and-qualifier-does-not-fail.integtest.ts +0 -39
  199. package/tests/cli-integ-tests/cdk-cdk-diff-with-large-changeset-does-not-fail.integtest.ts +0 -28
  200. package/tests/cli-integ-tests/cdk-cdk-diff.integtest.ts +0 -18
  201. package/tests/cli-integ-tests/cdk-cdk-ls---show-dependencies---json---long.integtest.ts +0 -50
  202. package/tests/cli-integ-tests/cdk-cdk-ls---show-dependencies---json.integtest.ts +0 -95
  203. package/tests/cli-integ-tests/cdk-cdk-ls.integtest.ts +0 -36
  204. package/tests/cli-integ-tests/cdk-cdk-notices-are-displayed-correctly.integtest.ts +0 -42
  205. package/tests/cli-integ-tests/cdk-cdk-notices-with---unacknowledged.integtest.ts +0 -14
  206. package/tests/cli-integ-tests/cdk-cdk-synth-add-the-metadata-properties-expected-by-sam.integtest.ts +0 -126
  207. package/tests/cli-integ-tests/cdk-cdk-synth-bundled-functions-as-expected.integtest.ts +0 -80
  208. package/tests/cli-integ-tests/cdk-cdk-synth.integtest.ts +0 -53
  209. package/tests/cli-integ-tests/cdk-ci-output-to-stderr.integtest.ts +0 -19
  210. package/tests/cli-integ-tests/cdk-ci-true-output-to-stdout.integtest.ts +0 -28
  211. package/tests/cli-integ-tests/cdk-construct-with-builtin-lambda-function.integtest.ts +0 -14
  212. package/tests/cli-integ-tests/cdk-context-in-stage-propagates-to-top.integtest.ts +0 -20
  213. package/tests/cli-integ-tests/cdk-context-setting.integtest.ts +0 -33
  214. package/tests/cli-integ-tests/cdk-deploy---method-direct.integtest.ts +0 -23
  215. package/tests/cli-integ-tests/cdk-deploy-all-concurrently.integtest.ts +0 -17
  216. package/tests/cli-integ-tests/cdk-deploy-all.integtest.ts +0 -14
  217. package/tests/cli-integ-tests/cdk-deploy-and-test-stack-with-lambda-asset.integtest.ts +0 -31
  218. package/tests/cli-integ-tests/cdk-deploy-deletes-all-notification-arns-when-empty-array-is-passed.integtest.ts +0 -50
  219. package/tests/cli-integ-tests/cdk-deploy-no-stacks-error.integtest.ts +0 -18
  220. package/tests/cli-integ-tests/cdk-deploy-no-stacks-with---ignore-no-stacks.integtest.ts +0 -17
  221. package/tests/cli-integ-tests/cdk-deploy-preserves-existing-notification-arns-when-not-specified.integtest.ts +0 -51
  222. package/tests/cli-integ-tests/cdk-deploy-stack-with-docker-asset.integtest.ts +0 -11
  223. package/tests/cli-integ-tests/cdk-deploy-stack-with-lambda-asset-to-object-lock-enabled-asset-bucket.integtest.ts +0 -42
  224. package/tests/cli-integ-tests/cdk-deploy-stack-without-resource.integtest.ts +0 -32
  225. package/tests/cli-integ-tests/cdk-deploy-wildcard-with-outputs.integtest.ts +0 -28
  226. package/tests/cli-integ-tests/cdk-deploy-with-import-existing-resources-true.integtest.ts +0 -29
  227. package/tests/cli-integ-tests/cdk-deploy-with-method-direct-and-import-existing-resources-fails.integtest.ts +0 -17
  228. package/tests/cli-integ-tests/cdk-deploy-with-notification-arn-as-flag.integtest.ts +0 -36
  229. package/tests/cli-integ-tests/cdk-deploy-with-notification-arn-as-prop-and-flag.integtest.ts +0 -45
  230. package/tests/cli-integ-tests/cdk-deploy-with-notification-arn-as-prop.integtest.ts +0 -37
  231. package/tests/cli-integ-tests/cdk-deploy-with-parameters-multi.integtest.ts +0 -33
  232. package/tests/cli-integ-tests/cdk-deploy-with-parameters.integtest.ts +0 -26
  233. package/tests/cli-integ-tests/cdk-deploy-with-role.integtest.ts +0 -119
  234. package/tests/cli-integ-tests/cdk-deploy-with-wildcard-and-parameters.integtest.ts +0 -22
  235. package/tests/cli-integ-tests/cdk-deploy-without-execute-a-named-change-set.integtest.ts +0 -36
  236. package/tests/cli-integ-tests/cdk-deploy-without-import-existing-resources.integtest.ts +0 -28
  237. package/tests/cli-integ-tests/cdk-deploy.integtest.ts +0 -20
  238. package/tests/cli-integ-tests/cdk-destroy-interactive.integtest.ts +0 -36
  239. package/tests/cli-integ-tests/cdk-doubly-nested-stack.integtest.ts +0 -12
  240. package/tests/cli-integ-tests/cdk-enablediffnofail.integtest.ts +0 -44
  241. package/tests/cli-integ-tests/cdk-failed-deploy-does-not-hang.integtest.ts +0 -12
  242. package/tests/cli-integ-tests/cdk-fast-deploy.integtest.ts +0 -41
  243. package/tests/cli-integ-tests/cdk-gc-garbage-collection-deletes-unused-ecr-images.integtest.ts +0 -48
  244. package/tests/cli-integ-tests/cdk-gc-garbage-collection-deletes-unused-s3-objects.integtest.ts +0 -51
  245. package/tests/cli-integ-tests/cdk-gc-garbage-collection-keeps-in-use-ecr-images.integtest.ts +0 -48
  246. package/tests/cli-integ-tests/cdk-gc-garbage-collection-keeps-in-use-s3-objects.integtest.ts +0 -52
  247. package/tests/cli-integ-tests/cdk-gc-garbage-collection-tags-unused-ecr-images.integtest.ts +0 -47
  248. package/tests/cli-integ-tests/cdk-gc-garbage-collection-tags-unused-s3-objects.integtest.ts +0 -63
  249. package/tests/cli-integ-tests/cdk-gc-garbage-collection-untags-in-use-ecr-images.integtest.ts +0 -55
  250. package/tests/cli-integ-tests/cdk-gc-garbage-collection-untags-in-use-s3-objects.integtest.ts +0 -63
  251. package/tests/cli-integ-tests/cdk-generating-and-loading-assembly.integtest.ts +0 -52
  252. package/tests/cli-integ-tests/cdk-hotswap-deployment-for-ecs-service-detects-failed-deployment-and-errors.integtest.ts +0 -29
  253. package/tests/cli-integ-tests/cdk-hotswap-deployment-for-ecs-service-waits-for-deployment-to-complete.integtest.ts +0 -45
  254. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-appsync-apis-with-many-functions.integtest.ts +0 -36
  255. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-ecs-service.integtest.ts +0 -41
  256. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-fn::importvalue-intrinsic.integtest.ts +0 -53
  257. package/tests/cli-integ-tests/cdk-hotswap-deployment-supports-lambda-functions-description-and-environment-variables.integtest.ts +0 -43
  258. package/tests/cli-integ-tests/cdk-hotswap-ecs-deployment-respects-properties-override.integtest.ts +0 -59
  259. package/tests/cli-integ-tests/cdk-iam-diff.integtest.ts +0 -23
  260. package/tests/cli-integ-tests/cdk-import-interactive.integtest.ts +0 -57
  261. package/tests/cli-integ-tests/cdk-lib-cli-lib-deploy.integtest.ts +0 -32
  262. package/tests/cli-integ-tests/cdk-lib-cli-lib-list.integtest.ts +0 -12
  263. package/tests/cli-integ-tests/cdk-lib-cli-lib-synth.integtest.ts +0 -27
  264. package/tests/cli-integ-tests/cdk-lib-security-related-changes-without-a-cli-are-expected-to-fail-when-approval-is-required.integtest.ts +0 -32
  265. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-csharp.integtest.ts +0 -13
  266. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-java.integtest.ts +0 -14
  267. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-python.integtest.ts +0 -13
  268. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate--from-stack-creates-deployable-app-typescript.integtest.ts +0 -13
  269. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-csharp.integtest.ts +0 -15
  270. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-java.integtest.ts +0 -15
  271. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-python.integtest.ts +0 -15
  272. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-deploys-successfully-typescript.integtest.ts +0 -15
  273. package/tests/cli-integ-tests/cdk-migrate/cdk-migrate-generates-migrate.json.integtest.ts +0 -20
  274. package/tests/cli-integ-tests/cdk-migrate/testcase.ts +0 -69
  275. package/tests/cli-integ-tests/cdk-nested-stack-with-parameters.integtest.ts +0 -28
  276. package/tests/cli-integ-tests/cdk-requests-go-through-a-proxy-when-configured.integtest.ts +0 -39
  277. package/tests/cli-integ-tests/cdk-sam-can-locally-test-the-synthesized-cdk-application.integtest.ts +0 -25
  278. package/tests/cli-integ-tests/cdk-security-related-changes-without-a-cli-are-expected-to-fail.integtest.ts +0 -30
  279. package/tests/cli-integ-tests/cdk-skips-notice-refresh.integtest.ts +0 -26
  280. package/tests/cli-integ-tests/cdk-ssm-parameter-provider-error.integtest.ts +0 -18
  281. package/tests/cli-integ-tests/cdk-stack-in-update_rollback_complete-state-can-be-updated.integtest.ts +0 -59
  282. package/tests/cli-integ-tests/cdk-stage-with-bundled-lambda-function.integtest.ts +0 -13
  283. package/tests/cli-integ-tests/cdk-synth---quiet-can-be-specified-in-cdk.json.integtest.ts +0 -20
  284. package/tests/cli-integ-tests/cdk-synthing-a-stage-with-errors-can-be-suppressed.integtest.ts +0 -15
  285. package/tests/cli-integ-tests/cdk-synthing-a-stage-with-errors-leads-to-failure.integtest.ts +0 -18
  286. package/tests/cli-integ-tests/cdk-templates-on-disk-contain-metadata-resource.integtest.ts +0 -25
  287. package/tests/cli-integ-tests/cdk-termination-protection.integtest.ts +0 -19
  288. package/tests/cli-integ-tests/cdk-test-cdk-rollback---force.integtest.ts +0 -48
  289. package/tests/cli-integ-tests/cdk-test-cdk-rollback.integtest.ts +0 -38
  290. package/tests/cli-integ-tests/cdk-test-migrate-deployment-for-app-with-localfile-source-in-migrate.json.integtest.ts +0 -56
  291. package/tests/cli-integ-tests/cdk-test-resource-import-with-construct-that-requires-bundling.integtest.ts +0 -74
  292. package/tests/cli-integ-tests/cdk-test-resource-import.integtest.ts +0 -64
  293. package/tests/cli-integ-tests/cdk-two-ways-of-showing-the-version.integtest.ts +0 -14
  294. package/tests/cli-integ-tests/cdk-update-to-stack-in-rollback_complete-state-will-delete-stack-and-create-a-new-one.integtest.ts +0 -47
  295. package/tests/cli-integ-tests/cdk-vpc-lookup.integtest.ts +0 -26
  296. package/tests/cli-integ-tests/proxy.integtest.ts +0 -168
  297. package/tests/init-csharp/init-csharp.integtest.ts +0 -15
  298. package/tests/init-fsharp/init-fsharp.integtest.ts +0 -15
  299. package/tests/init-go/init-go.integtest.ts +0 -28
  300. package/tests/init-java/init-java.integtest.ts +0 -14
  301. package/tests/init-javascript/init-javascript.integtest.ts +0 -58
  302. package/tests/init-python/init-python.integtest.ts +0 -20
  303. package/tests/init-typescript-app/init-typescript-app.integtest.ts +0 -67
  304. package/tests/init-typescript-lib/init-typescript-lib.integtest.ts +0 -13
  305. package/tests/tool-integrations/amplify.integtest.ts +0 -117
  306. package/tests/tool-integrations/with-tool-context.ts +0 -14
  307. package/tests/uberpackage/uberpackage.integtest.ts +0 -11
@@ -1,74 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import * as path from 'path';
3
- import { DescribeStacksCommand, GetTemplateCommand } from '@aws-sdk/client-cloudformation';
4
- import { integTest, withDefaultFixture } from '../../lib';
5
-
6
- jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime
7
-
8
- integTest(
9
- 'test resource import with construct that requires bundling',
10
- withDefaultFixture(async (fixture) => {
11
- // GIVEN
12
- const outputsFile = path.join(fixture.integTestDir, 'outputs', 'outputs.json');
13
- await fs.mkdir(path.dirname(outputsFile), { recursive: true });
14
-
15
- // First, create a stack that includes a NodeJSFunction lambda and one bucket that will be removed from the stack but NOT deleted from AWS.
16
- await fixture.cdkDeploy('importable-stack', {
17
- modEnv: { INCLUDE_NODEJS_FUNCTION_LAMBDA: '1', INCLUDE_SINGLE_BUCKET: '1', RETAIN_SINGLE_BUCKET: '1' },
18
- options: ['--outputs-file', outputsFile],
19
- });
20
-
21
- try {
22
- // Second, now the bucket we will remove is in the stack and has a logicalId. We can now make the resource mapping file.
23
- // This resource mapping file will be used to tell the import operation what bucket to bring into the stack.
24
- const fullStackName = fixture.fullStackName('importable-stack');
25
- const outputs = JSON.parse((await fs.readFile(outputsFile, { encoding: 'utf-8' })).toString());
26
- const bucketLogicalId = outputs[fullStackName].BucketLogicalId;
27
- const bucketName = outputs[fullStackName].BucketName;
28
- const bucketResourceMap = {
29
- [bucketLogicalId]: {
30
- BucketName: bucketName,
31
- },
32
- };
33
- const mappingFile = path.join(fixture.integTestDir, 'outputs', 'mapping.json');
34
- await fs.writeFile(mappingFile, JSON.stringify(bucketResourceMap), { encoding: 'utf-8' });
35
-
36
- // Third, remove the bucket from the stack, but don't delete the bucket from AWS.
37
- await fixture.cdkDeploy('importable-stack', {
38
- modEnv: { INCLUDE_NODEJS_FUNCTION_LAMBDA: '1', INCLUDE_SINGLE_BUCKET: '0', RETAIN_SINGLE_BUCKET: '0' },
39
- });
40
- const cfnTemplateBeforeImport = await fixture.aws.cloudFormation.send(
41
- new GetTemplateCommand({ StackName: fullStackName }),
42
- );
43
- expect(cfnTemplateBeforeImport.TemplateBody).not.toContain(bucketLogicalId);
44
-
45
- // WHEN
46
- await fixture.cdk(['import', '--resource-mapping', mappingFile, fixture.fullStackName('importable-stack')], {
47
- modEnv: { INCLUDE_NODEJS_FUNCTION_LAMBDA: '1', INCLUDE_SINGLE_BUCKET: '1', RETAIN_SINGLE_BUCKET: '0' },
48
- });
49
-
50
- // THEN
51
- const describeStacksResponse = await fixture.aws.cloudFormation.send(
52
- new DescribeStacksCommand({ StackName: fullStackName }),
53
- );
54
- const cfnTemplateAfterImport = await fixture.aws.cloudFormation.send(
55
- new GetTemplateCommand({ StackName: fullStackName }),
56
- );
57
-
58
- // If bundling is skipped during import for NodeJSFunction lambda, then the operation should fail and exit
59
- expect(describeStacksResponse.Stacks![0].StackStatus).toEqual('IMPORT_COMPLETE');
60
-
61
- // If the import operation is successful, the template should contain the imported bucket
62
- expect(cfnTemplateAfterImport.TemplateBody).toContain(bucketLogicalId);
63
- } finally {
64
- // Clean up the resources we created
65
- await fixture.cdkDestroy('importable-stack');
66
- }
67
- }),
68
- );
69
-
70
- /**
71
- * Create a queue, orphan that queue, then import the queue.
72
- *
73
- * We want to test with a large template to make sure large templates can work with import.
74
- */
@@ -1,64 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import * as path from 'path';
3
- import { DescribeStacksCommand, GetTemplateCommand } from '@aws-sdk/client-cloudformation';
4
- import { integTest, withDefaultFixture, randomString } from '../../lib';
5
-
6
- jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime
7
-
8
- integTest(
9
- 'test resource import',
10
- withDefaultFixture(async (fixture) => {
11
- // GIVEN
12
- const randomPrefix = randomString();
13
- const uniqueOutputsFileName = `${randomPrefix}Outputs.json`; // other tests use the outputs file. Make sure we don't collide.
14
- const outputsFile = path.join(fixture.integTestDir, 'outputs', uniqueOutputsFileName);
15
- await fs.mkdir(path.dirname(outputsFile), { recursive: true });
16
-
17
- // First, create a stack that includes many queues, and one queue that will be removed from the stack but NOT deleted from AWS.
18
- await fixture.cdkDeploy('importable-stack', {
19
- modEnv: { LARGE_TEMPLATE: '1', INCLUDE_SINGLE_QUEUE: '1', RETAIN_SINGLE_QUEUE: '1' },
20
- options: ['--outputs-file', outputsFile],
21
- });
22
-
23
- try {
24
- // Second, now the queue we will remove is in the stack and has a logicalId. We can now make the resource mapping file.
25
- // This resource mapping file will be used to tell the import operation what queue to bring into the stack.
26
- const fullStackName = fixture.fullStackName('importable-stack');
27
- const outputs = JSON.parse((await fs.readFile(outputsFile, { encoding: 'utf-8' })).toString());
28
- const queueLogicalId = outputs[fullStackName].QueueLogicalId;
29
- const queueResourceMap = {
30
- [queueLogicalId]: { QueueUrl: outputs[fullStackName].QueueUrl },
31
- };
32
- const mappingFile = path.join(fixture.integTestDir, 'outputs', `${randomPrefix}Mapping.json`);
33
- await fs.writeFile(mappingFile, JSON.stringify(queueResourceMap), { encoding: 'utf-8' });
34
-
35
- // Third, remove the queue from the stack, but don't delete the queue from AWS.
36
- await fixture.cdkDeploy('importable-stack', {
37
- modEnv: { LARGE_TEMPLATE: '1', INCLUDE_SINGLE_QUEUE: '0', RETAIN_SINGLE_QUEUE: '0' },
38
- });
39
- const cfnTemplateBeforeImport = await fixture.aws.cloudFormation.send(
40
- new GetTemplateCommand({ StackName: fullStackName }),
41
- );
42
- expect(cfnTemplateBeforeImport.TemplateBody).not.toContain(queueLogicalId);
43
-
44
- // WHEN
45
- await fixture.cdk(['import', '--resource-mapping', mappingFile, fixture.fullStackName('importable-stack')], {
46
- modEnv: { LARGE_TEMPLATE: '1', INCLUDE_SINGLE_QUEUE: '1', RETAIN_SINGLE_QUEUE: '0' },
47
- });
48
-
49
- // THEN
50
- const describeStacksResponse = await fixture.aws.cloudFormation.send(
51
- new DescribeStacksCommand({ StackName: fullStackName }),
52
- );
53
- const cfnTemplateAfterImport = await fixture.aws.cloudFormation.send(
54
- new GetTemplateCommand({ StackName: fullStackName }),
55
- );
56
- expect(describeStacksResponse.Stacks![0].StackStatus).toEqual('IMPORT_COMPLETE');
57
- expect(cfnTemplateAfterImport.TemplateBody).toContain(queueLogicalId);
58
- } finally {
59
- // Clean up
60
- await fixture.cdkDestroy('importable-stack');
61
- }
62
- }),
63
- );
64
-
@@ -1,14 +0,0 @@
1
- import { integTest, withDefaultFixture } from '../../lib';
2
-
3
- jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime
4
-
5
- integTest(
6
- 'Two ways of showing the version',
7
- withDefaultFixture(async (fixture) => {
8
- const version1 = await fixture.cdk(['version'], { verbose: false });
9
- const version2 = await fixture.cdk(['--version'], { verbose: false });
10
-
11
- expect(version1).toEqual(version2);
12
- }),
13
- );
14
-
@@ -1,47 +0,0 @@
1
- import { DescribeStacksCommand } from '@aws-sdk/client-cloudformation';
2
- import { integTest, withDefaultFixture } from '../../lib';
3
-
4
- jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime
5
-
6
- integTest(
7
- 'update to stack in ROLLBACK_COMPLETE state will delete stack and create a new one',
8
- withDefaultFixture(async (fixture) => {
9
- // GIVEN
10
- await expect(
11
- fixture.cdkDeploy('param-test-1', {
12
- options: ['--parameters', `TopicNameParam=${fixture.stackNamePrefix}@aww`],
13
- captureStderr: false,
14
- }),
15
- ).rejects.toThrow('exited with error');
16
-
17
- const response = await fixture.aws.cloudFormation.send(
18
- new DescribeStacksCommand({
19
- StackName: fixture.fullStackName('param-test-1'),
20
- }),
21
- );
22
-
23
- const stackArn = response.Stacks?.[0].StackId;
24
- expect(response.Stacks?.[0].StackStatus).toEqual('ROLLBACK_COMPLETE');
25
-
26
- // WHEN
27
- const newStackArn = await fixture.cdkDeploy('param-test-1', {
28
- options: ['--parameters', `TopicNameParam=${fixture.stackNamePrefix}allgood`],
29
- captureStderr: false,
30
- });
31
-
32
- const newStackResponse = await fixture.aws.cloudFormation.send(
33
- new DescribeStacksCommand({
34
- StackName: newStackArn,
35
- }),
36
- );
37
-
38
- // THEN
39
- expect(stackArn).not.toEqual(newStackArn); // new stack was created
40
- expect(newStackResponse.Stacks?.[0].StackStatus).toEqual('CREATE_COMPLETE');
41
- expect(newStackResponse.Stacks?.[0].Parameters).toContainEqual({
42
- ParameterKey: 'TopicNameParam',
43
- ParameterValue: `${fixture.stackNamePrefix}allgood`,
44
- });
45
- }),
46
- );
47
-
@@ -1,26 +0,0 @@
1
- import { integTest, withDefaultFixture } from '../../lib';
2
-
3
- jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime
4
-
5
- integTest(
6
- 'VPC Lookup',
7
- withDefaultFixture(async (fixture) => {
8
- fixture.log('Making sure we are clean before starting.');
9
- await fixture.cdkDestroy('define-vpc', { modEnv: { ENABLE_VPC_TESTING: 'DEFINE' } });
10
-
11
- fixture.log('Setting up: creating a VPC with known tags');
12
- await fixture.cdkDeploy('define-vpc', { modEnv: { ENABLE_VPC_TESTING: 'DEFINE' } });
13
- fixture.log('Setup complete!');
14
-
15
- fixture.log('Verifying we can now import that VPC');
16
- await fixture.cdkDeploy('import-vpc', { modEnv: { ENABLE_VPC_TESTING: 'IMPORT' } });
17
- }),
18
- );
19
-
20
- // testing a construct with a builtin Nodejs Lambda Function.
21
- // In this case we are testing the s3.Bucket construct with the
22
- // autoDeleteObjects prop set to true, which creates a Lambda backed
23
- // CustomResource. Since the compiled Lambda code (e.g. __entrypoint__.js)
24
- // is bundled as part of the CDK package, we want to make sure we don't
25
- // introduce changes to the compiled code that could prevent the Lambda from
26
- // executing. If we do, this test will timeout and fail.
@@ -1,168 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import * as os from 'os';
3
- import * as path from 'path';
4
- import { integTest } from '../../lib/integ-test';
5
- import { startProxyServer } from '../../lib/proxy';
6
- import { TestFixture, withDefaultFixture } from '../../lib/with-cdk-app';
7
-
8
- const docker = process.env.CDK_DOCKER ?? 'docker';
9
-
10
- integTest(
11
- 'all calls from isolated container go through proxy',
12
- withDefaultFixture(async (fixture) => {
13
- // Find the 'cdk' command and make sure it is mounted into the container
14
- const cdkFullpath = (await fixture.shell(['which', 'cdk'])).trim();
15
- let cdkTop = findMountableParent(cdkFullpath);
16
-
17
- // Run a 'cdk deploy' inside the container
18
- const commands = [
19
- `env ${renderEnv(fixture.cdkShellEnv())} ${cdkFullpath} ${fixture.cdkDeployCommandLine('test-2').join(' ')} -v`,
20
- ];
21
-
22
- await runInIsolatedContainer(fixture, [cdkTop], commands);
23
- }),
24
- );
25
-
26
- async function runInIsolatedContainer(fixture: TestFixture, pathsToMount: string[], testCommands: string[]) {
27
- pathsToMount.push(
28
- `${process.env.HOME}`,
29
- fixture.integTestDir,
30
- );
31
-
32
- // Resolve credential provider to an access key that we can pass into the container
33
- const credentials = await fixture.aws.credentials();
34
-
35
- const proxy = await startProxyServer(fixture.integTestDir);
36
- try {
37
- const proxyPort = proxy.port;
38
-
39
- const setupCommands = [
40
- 'apt-get update -qq',
41
- 'apt-get install -qqy nodejs > /dev/null',
42
- ...isolatedDockerCommands(proxyPort, proxy.certPath),
43
- ];
44
-
45
- const scriptName = path.join(fixture.integTestDir, 'script.sh');
46
-
47
- // Write a script file
48
- await fs.writeFile(scriptName, [
49
- '#!/bin/bash',
50
- 'set -x',
51
- 'set -eu',
52
- ...setupCommands,
53
- ...testCommands,
54
- ].join('\n'), 'utf-8');
55
-
56
- await fs.chmod(scriptName, 0o755);
57
-
58
- await fixture.ecrPublicLogin();
59
-
60
- // Run commands in a Docker shell
61
- await fixture.shell([
62
- docker, 'run', '--net=bridge', '--rm',
63
- ...pathsToMount.flatMap(p => ['-v', `${p}:${p}`]),
64
- ...['HOME', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_SESSION_TOKEN'].flatMap(e => ['-e', e]),
65
- '-w', fixture.integTestDir,
66
- '--cap-add=NET_ADMIN',
67
- 'public.ecr.aws/ubuntu/ubuntu:24.04_stable',
68
- `${scriptName}`,
69
- ], {
70
- modEnv: {
71
- AWS_ACCESS_KEY_ID: credentials.accessKeyId,
72
- AWS_SECRET_ACCESS_KEY: credentials.secretAccessKey,
73
- AWS_SESSION_TOKEN: credentials.sessionToken,
74
- },
75
- });
76
- } finally {
77
- await proxy.stop();
78
- }
79
- }
80
-
81
- /**
82
- * Return the commands necessary to isolate the inside of the container from the internet,
83
- * except by going through the proxy
84
- */
85
- function isolatedDockerCommands(proxyPort: number, caBundlePath: string) {
86
- let defaultBridgeIp = '172.17.0.1';
87
-
88
- // The host's default IP is different on CodeBuild than it is on other Docker systems.
89
- if (process.env.CODEBUILD_BUILD_ARN) {
90
- defaultBridgeIp = '172.18.0.1';
91
- }
92
-
93
- return [
94
- 'echo Working...',
95
- 'apt-get install -qqy curl net-tools iputils-ping dnsutils iptables > /dev/null',
96
- '',
97
- // Looking up `host.docker.internal` is necessary on MacOS Finch and Docker Desktop
98
- // on Mac. The magic IP address is necessary on CodeBuild and GitHub Actions.
99
- //
100
- // I tried `--add-host=host.docker.internal:host-gateway` on the Linuxes but
101
- // it doesn't change anything on either GHA or CodeBuild, so we're left with this
102
- // backup solution.
103
- 'gateway=$(dig +short host.docker.internal)',
104
- 'if [[ -z "$gateway" ]]; then',
105
- ` gateway=${defaultBridgeIp}`,
106
- 'fi',
107
- '',
108
- '# Some iptables manipulation; there might be unnecessary commands in here, not an expert',
109
- 'iptables -F',
110
- 'iptables -X',
111
- 'iptables -P INPUT DROP',
112
- 'iptables -P OUTPUT DROP',
113
- 'iptables -P FORWARD DROP',
114
- 'iptables -A INPUT -i lo -j ACCEPT',
115
- 'iptables -A OUTPUT -o lo -j ACCEPT',
116
- 'iptables -A OUTPUT -d $gateway -j ACCEPT',
117
- 'iptables -A INPUT -s $gateway -j ACCEPT',
118
- '',
119
- '',
120
- `if [[ ! -f ${caBundlePath} ]]; then`,
121
- ` echo "Could not find ${caBundlePath}, this will probably not go well. Exiting." >&2`,
122
- ' exit 1',
123
- 'fi',
124
- '',
125
- '# Configure a bunch of tools to work with the proxy',
126
- 'echo "+-------------------------------------------------------------------------------------+"',
127
- 'echo "| Direct network traffic has been blocked, everything must go through the proxy. |"',
128
- 'echo "+-------------------------------------------------------------------------------------+"',
129
- `export HTTP_PROXY=http://$gateway:${proxyPort}/`,
130
- `export HTTPS_PROXY=http://$gateway:${proxyPort}/`,
131
- `export NODE_EXTRA_CA_CERTS=${caBundlePath}`,
132
- `export AWS_CA_BUNDLE=${caBundlePath}`,
133
- `export SSL_CERT_FILE=${caBundlePath}`,
134
- 'echo "Acquire::http::proxy \"$HTTP_PROXY\";" >> /etc/apt/apt.conf.d/95proxies',
135
- 'echo "Acquire::https::proxy \"$HTTPS_PROXY\";" >> /etc/apt/apt.conf.d/95proxies',
136
- ];
137
- }
138
-
139
- function renderEnv(env: Record<string, string | undefined>) {
140
- return Object.entries(env).filter(([_, v]) => v).map(([k, v]) => `${k}='${v}'`).join(' ');
141
- }
142
-
143
- /**
144
- * Find a broadly mountable parent of the given directory
145
- *
146
- * We don't want to just mount the top-level directory, because
147
- * it could end up being `/var` (top-level dir of tmpdir on Mac).
148
- */
149
- function findMountableParent(dir: string): string {
150
- const candidates = [
151
- os.tmpdir(),
152
- process.env.TMPDIR,
153
- process.env.HOME,
154
- ];
155
- for (const cand of candidates) {
156
- if (cand === undefined) {
157
- continue;
158
- }
159
-
160
- if (dir.startsWith(cand)) {
161
- const suffix = dir.substring(cand.length);
162
- const firstChildDir = suffix.split('/')[0];
163
-
164
- return path.join(cand, firstChildDir);
165
- }
166
- }
167
- return dir;
168
- }
@@ -1,15 +0,0 @@
1
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';
2
-
3
- ['app', 'sample-app'].forEach(template => {
4
- integTest(`init C♯ ${template}`, withTemporaryDirectory(withPackages(async (context) => {
5
- context.packages.assertJsiiPackagesAvailable();
6
-
7
- const shell = ShellHelper.fromContext(context);
8
- await context.packages.makeCliAvailable();
9
-
10
- await shell.shell(['cdk', 'init', '-l', 'csharp', template]);
11
- await context.packages.initializeDotnetPackages(context.integTestDir);
12
- await shell.shell(['cdk', 'synth']);
13
- })));
14
- });
15
-
@@ -1,15 +0,0 @@
1
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';
2
-
3
- ['app', 'sample-app'].forEach(template => {
4
- integTest(`init F♯ ${template}`, withTemporaryDirectory(withPackages(async (context) => {
5
- context.packages.assertJsiiPackagesAvailable();
6
-
7
- const shell = ShellHelper.fromContext(context);
8
- await context.packages.makeCliAvailable();
9
-
10
- await shell.shell(['cdk', 'init', '-l', 'fsharp', template]);
11
- await context.packages.initializeDotnetPackages(context.integTestDir);
12
- await shell.shell(['cdk', 'synth']);
13
- })));
14
- });
15
-
@@ -1,28 +0,0 @@
1
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';
2
-
3
- ['app', 'sample-app'].forEach(template => {
4
- integTest(`init go ${template}`, withTemporaryDirectory(withPackages(async (context) => {
5
- const isCanary = !!process.env.IS_CANARY;
6
- context.packages.assertJsiiPackagesAvailable();
7
-
8
- const shell = ShellHelper.fromContext(context);
9
- await context.packages.makeCliAvailable();
10
-
11
- await shell.shell(['cdk', 'init', '-l', 'go', template]);
12
-
13
- // Canaries will use the generated go.mod as is
14
- // For pipeline tests we replace the source with the locally build one
15
- if (!isCanary) {
16
- const dir = process.env.CODEBUILD_SRC_DIR ?? process.env.GITHUB_WORKSPACE;
17
- if (!dir) {
18
- throw new Error('Cannot figure out CI system root directory');
19
- }
20
-
21
- await shell.shell(['go', 'mod', 'edit', '-replace', `github.com/aws/aws-cdk-go/awscdk/v2=${dir}/go/awscdk`]);
22
- }
23
-
24
- await shell.shell(['go', 'mod', 'tidy']);
25
- await shell.shell(['go', 'test']);
26
- await shell.shell(['cdk', 'synth']);
27
- })));
28
- });
@@ -1,14 +0,0 @@
1
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';
2
-
3
- ['app', 'sample-app'].forEach(template => {
4
- integTest(`init java ${template}`, withTemporaryDirectory(withPackages(async (context) => {
5
- context.packages.assertJsiiPackagesAvailable();
6
-
7
- const shell = ShellHelper.fromContext(context);
8
- await context.packages.makeCliAvailable();
9
-
10
- await shell.shell(['cdk', 'init', '-l', 'java', template]);
11
- await shell.shell(['mvn', 'package']);
12
- await shell.shell(['cdk', 'synth']);
13
- })));
14
- });
@@ -1,58 +0,0 @@
1
- import * as path from 'path';
2
- import * as fs from 'fs-extra';
3
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';
4
-
5
- ['app', 'sample-app'].forEach(template => {
6
- integTest(`init javascript ${template}`, withTemporaryDirectory(withPackages(async (context) => {
7
- const shell = ShellHelper.fromContext(context);
8
- await context.packages.makeCliAvailable();
9
-
10
- await shell.shell(['cdk', 'init', '-l', 'javascript', template]);
11
- await shell.shell(['npm', 'prune']);
12
- await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
13
- await shell.shell(['npm', 'run', 'test']);
14
-
15
- await shell.shell(['cdk', 'synth']);
16
- })));
17
- });
18
-
19
- integTest('Test importing CDK from ESM', withTemporaryDirectory(withPackages(async (context) => {
20
- // Use 'cdk init -l=javascript' to get set up, but use a different file
21
- const shell = ShellHelper.fromContext(context);
22
- await context.packages.makeCliAvailable();
23
-
24
- await shell.shell(['cdk', 'init', '-l', 'javascript', 'app']);
25
-
26
- // Rewrite some files
27
- await fs.writeFile(path.join(context.integTestDir, 'new-entrypoint.mjs'), `
28
- // Test multiple styles of imports
29
- import { Stack, aws_sns as sns } from 'aws-cdk-lib';
30
- import { SqsSubscription } from 'aws-cdk-lib/aws-sns-subscriptions';
31
- import * as sqs from 'aws-cdk-lib/aws-sqs';
32
- import * as cdk from 'aws-cdk-lib';
33
-
34
- class TestjsStack extends Stack {
35
- constructor(scope, id, props) {
36
- super(scope, id, props);
37
-
38
- const queue = new sqs.Queue(this, 'TestjsQueue', {
39
- visibilityTimeout: cdk.Duration.seconds(300)
40
- });
41
-
42
- const topic = new sns.Topic(this, 'TestjsTopic');
43
-
44
- topic.addSubscription(new SqsSubscription(queue));
45
- }
46
- }
47
-
48
- const app = new cdk.App();
49
- new TestjsStack(app, 'TestjsStack');
50
- `, { encoding: 'utf-8' });
51
-
52
- // Rewrite 'cdk.json' to use new entrypoint
53
- const cdkJson = await fs.readJson(path.join(context.integTestDir, 'cdk.json'));
54
- cdkJson.app = 'node new-entrypoint.mjs';
55
- await fs.writeJson(path.join(context.integTestDir, 'cdk.json'), cdkJson);
56
-
57
- await shell.shell(['cdk', 'synth']);
58
- })));
@@ -1,20 +0,0 @@
1
- import * as path from 'path';
2
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';
3
-
4
- ['app', 'sample-app'].forEach(template => {
5
- integTest(`init python ${template}`, withTemporaryDirectory(withPackages(async (context) => {
6
- context.packages.assertJsiiPackagesAvailable();
7
-
8
- const shell = ShellHelper.fromContext(context);
9
- await context.packages.makeCliAvailable();
10
-
11
- await shell.shell(['cdk', 'init', '-l', 'python', template]);
12
- const venvPath = path.resolve(context.integTestDir, '.venv');
13
- const venv = { PATH: `${venvPath}/bin:${process.env.PATH}`, VIRTUAL_ENV: venvPath };
14
-
15
- await shell.shell([`${venvPath}/bin/pip`, 'install', '-r', 'requirements.txt'], { modEnv: venv });
16
- await shell.shell([`${venvPath}/bin/pip`, 'install', '-r', 'requirements-dev.txt'], { modEnv: venv });
17
- await shell.shell([`${venvPath}/bin/pytest`], { modEnv: venv });
18
- await shell.shell(['cdk', 'synth'], { modEnv: venv });
19
- })));
20
- });
@@ -1,67 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import * as path from 'path';
3
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages, TemporaryDirectoryContext } from '../../lib';
4
- import { typescriptVersionsSync, typescriptVersionsYoungerThanDaysSync } from '../../lib/npm';
5
-
6
- ['app', 'sample-app'].forEach(template => {
7
- integTest(`typescript init ${template}`, withTemporaryDirectory(withPackages(async (context) => {
8
- const shell = ShellHelper.fromContext(context);
9
- await context.packages.makeCliAvailable();
10
-
11
- await shell.shell(['cdk', 'init', '-l', 'typescript', template]);
12
-
13
- await shell.shell(['npm', 'prune']);
14
- await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
15
- await shell.shell(['npm', 'run', 'build']);
16
- await shell.shell(['npm', 'run', 'test']);
17
-
18
- await shell.shell(['cdk', 'synth']);
19
- })));
20
- });
21
-
22
- // Same as https://github.com/DefinitelyTyped/DefinitelyTyped?tab=readme-ov-file#support-window
23
- const TYPESCRIPT_VERSION_AGE_DAYS = 2 * 365;
24
-
25
- const TYPESCRIPT_VERSIONS = typescriptVersionsYoungerThanDaysSync(TYPESCRIPT_VERSION_AGE_DAYS, typescriptVersionsSync());
26
-
27
- /**
28
- * Test our generated code with various versions of TypeScript
29
- */
30
- TYPESCRIPT_VERSIONS.forEach(tsVersion => {
31
- integTest(`typescript ${tsVersion} init app`, withTemporaryDirectory(withPackages(async (context) => {
32
- const shell = ShellHelper.fromContext(context);
33
- await context.packages.makeCliAvailable();
34
-
35
- await shell.shell(['node', '--version']);
36
- await shell.shell(['npm', '--version']);
37
-
38
- await shell.shell(['cdk', 'init', '-l', 'typescript', 'app', '--generate-only']);
39
-
40
- // Necessary because recent versions of ts-jest require TypeScript>=4.3 but we
41
- // still want to test with older versions as well.
42
- await removeDevDependencies(context);
43
-
44
- await shell.shell(['npm', 'install', '--save-dev', `typescript@${tsVersion}`]);
45
-
46
- // After we've removed devDependencies we need to re-install ts-node because it's necessary for `cdk synth`
47
- await shell.shell(['npm', 'install', '--save-dev', 'ts-node@^10']);
48
-
49
- await shell.shell(['npm', 'install']); // Older versions of npm require this to be a separate step from the one above
50
- await shell.shell(['npx', 'tsc', '--version']);
51
- await shell.shell(['npm', 'prune']);
52
- await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
53
-
54
- // We just removed the 'jest' dependency so remove the tests as well because they won't compile
55
- await shell.shell(['rm', '-rf', 'test/']);
56
-
57
- await shell.shell(['npm', 'run', 'build']);
58
- await shell.shell(['cdk', 'synth']);
59
- })));
60
- });
61
-
62
- async function removeDevDependencies(context: TemporaryDirectoryContext) {
63
- const filename = path.join(context.integTestDir, 'package.json');
64
- const pj = JSON.parse(await fs.readFile(filename, { encoding: 'utf-8' }));
65
- delete pj.devDependencies;
66
- await fs.writeFile(filename, JSON.stringify(pj, undefined, 2), { encoding: 'utf-8' });
67
- }
@@ -1,13 +0,0 @@
1
- import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '../../lib';
2
-
3
- integTest('typescript init lib', withTemporaryDirectory(withPackages(async (context) => {
4
- const shell = ShellHelper.fromContext(context);
5
- await context.packages.makeCliAvailable();
6
-
7
- await shell.shell(['cdk', 'init', '-l', 'typescript', 'lib']);
8
-
9
- await shell.shell(['npm', 'prune']);
10
- await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
11
- await shell.shell(['npm', 'run', 'build']);
12
- await shell.shell(['npm', 'run', 'test']);
13
- })));