@datadog/datadog-ci 2.48.0 → 3.0.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/README.md +9 -2
- package/dist/__tests__/cli.test.d.ts +1 -0
- package/dist/__tests__/cli.test.js +92 -0
- package/dist/__tests__/cli.test.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/cloud-run/__tests__/fixtures.d.ts +2 -0
- package/dist/commands/cloud-run/__tests__/fixtures.js +12 -0
- package/dist/commands/cloud-run/__tests__/fixtures.js.map +1 -0
- package/dist/commands/cloud-run/__tests__/flare.test.d.ts +1 -0
- package/dist/commands/cloud-run/__tests__/flare.test.js +557 -0
- package/dist/commands/cloud-run/__tests__/flare.test.js.map +1 -0
- package/dist/commands/coverage/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/coverage/__tests__/upload.test.js +323 -0
- package/dist/commands/coverage/__tests__/upload.test.js.map +1 -0
- package/dist/commands/coverage/__tests__/utils.test.d.ts +1 -0
- package/dist/commands/coverage/__tests__/utils.test.js +57 -0
- package/dist/commands/coverage/__tests__/utils.test.js.map +1 -0
- package/dist/commands/coverage/api.d.ts +9 -0
- package/dist/commands/coverage/api.js +52 -0
- package/dist/commands/coverage/api.js.map +1 -0
- package/dist/commands/coverage/cli.d.ts +1 -0
- package/dist/commands/coverage/cli.js +5 -0
- package/dist/commands/coverage/cli.js.map +1 -0
- package/dist/commands/coverage/interfaces.d.ts +13 -0
- package/dist/commands/coverage/interfaces.js +3 -0
- package/dist/commands/coverage/interfaces.js.map +1 -0
- package/dist/commands/coverage/renderer.d.ts +12 -0
- package/dist/commands/coverage/renderer.js +83 -0
- package/dist/commands/coverage/renderer.js.map +1 -0
- package/dist/commands/coverage/upload.d.ts +27 -0
- package/dist/commands/coverage/upload.js +329 -0
- package/dist/commands/coverage/upload.js.map +1 -0
- package/dist/commands/coverage/utils.d.ts +3 -0
- package/dist/commands/coverage/utils.js +83 -0
- package/dist/commands/coverage/utils.js.map +1 -0
- package/dist/commands/deployment/__tests__/correlate.test.d.ts +1 -0
- package/dist/commands/deployment/__tests__/correlate.test.js +106 -0
- package/dist/commands/deployment/__tests__/correlate.test.js.map +1 -0
- package/dist/commands/deployment/__tests__/mark.test.d.ts +1 -0
- package/dist/commands/deployment/__tests__/mark.test.js +97 -0
- package/dist/commands/deployment/__tests__/mark.test.js.map +1 -0
- package/dist/commands/dora/__tests__/deployment.test.d.ts +1 -0
- package/dist/commands/dora/__tests__/deployment.test.js +201 -0
- package/dist/commands/dora/__tests__/deployment.test.js.map +1 -0
- package/dist/commands/dsyms/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/dsyms/__tests__/upload.test.js +346 -0
- package/dist/commands/dsyms/__tests__/upload.test.js.map +1 -0
- package/dist/commands/dsyms/__tests__/utils.test.d.ts +1 -0
- package/dist/commands/dsyms/__tests__/utils.test.js +100 -0
- package/dist/commands/dsyms/__tests__/utils.test.js.map +1 -0
- package/dist/commands/dsyms/upload.js +3 -3
- package/dist/commands/dsyms/upload.js.map +1 -1
- package/dist/commands/dsyms/utils.js +7 -6
- package/dist/commands/dsyms/utils.js.map +1 -1
- package/dist/commands/elf-symbols/__tests__/elf.test.d.ts +1 -0
- package/dist/commands/elf-symbols/__tests__/elf.test.js +819 -0
- package/dist/commands/elf-symbols/__tests__/elf.test.js.map +1 -0
- package/dist/commands/elf-symbols/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/elf-symbols/__tests__/upload.test.js +224 -0
- package/dist/commands/elf-symbols/__tests__/upload.test.js.map +1 -0
- package/dist/commands/elf-symbols/elf.d.ts +1 -0
- package/dist/commands/elf-symbols/upload.js +2 -3
- package/dist/commands/elf-symbols/upload.js.map +1 -1
- package/dist/commands/flutter-symbols/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/flutter-symbols/__tests__/upload.test.js +617 -0
- package/dist/commands/flutter-symbols/__tests__/upload.test.js.map +1 -0
- package/dist/commands/flutter-symbols/upload.js +2 -2
- package/dist/commands/flutter-symbols/upload.js.map +1 -1
- package/dist/commands/gate/__tests__/evaluate.test.d.ts +1 -0
- package/dist/commands/gate/__tests__/evaluate.test.js +398 -0
- package/dist/commands/gate/__tests__/evaluate.test.js.map +1 -0
- package/dist/commands/gate/__tests__/scope.test.d.ts +1 -0
- package/dist/commands/gate/__tests__/scope.test.js +29 -0
- package/dist/commands/gate/__tests__/scope.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/git.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/git.test.js +132 -0
- package/dist/commands/git-metadata/__tests__/git.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/gitdb.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/gitdb.test.js +1386 -0
- package/dist/commands/git-metadata/__tests__/gitdb.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/library.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/library.test.js +118 -0
- package/dist/commands/git-metadata/__tests__/library.test.js.map +1 -0
- package/dist/commands/git-metadata/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/git-metadata/__tests__/upload.test.js +52 -0
- package/dist/commands/git-metadata/__tests__/upload.test.js.map +1 -0
- package/dist/commands/git-metadata/upload.d.ts +0 -1
- package/dist/commands/git-metadata/upload.js +0 -6
- package/dist/commands/git-metadata/upload.js.map +1 -1
- package/dist/commands/junit/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/junit/__tests__/upload.test.js +446 -0
- package/dist/commands/junit/__tests__/upload.test.js.map +1 -0
- package/dist/commands/junit/renderer.d.ts +0 -1
- package/dist/commands/junit/renderer.js +1 -5
- package/dist/commands/junit/renderer.js.map +1 -1
- package/dist/commands/junit/upload.d.ts +0 -2
- package/dist/commands/junit/upload.js +8 -21
- package/dist/commands/junit/upload.js.map +1 -1
- package/dist/commands/lambda/__tests__/fixtures.d.ts +51 -0
- package/dist/commands/lambda/__tests__/fixtures.js +146 -0
- package/dist/commands/lambda/__tests__/fixtures.js.map +1 -0
- package/dist/commands/lambda/__tests__/flare.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/flare.test.js +730 -0
- package/dist/commands/lambda/__tests__/flare.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/commons.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/commons.test.js +791 -0
- package/dist/commands/lambda/__tests__/functions/commons.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js +386 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js +721 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.js +513 -0
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/functions/versionChecker.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/functions/versionChecker.test.js +33 -0
- package/dist/commands/lambda/__tests__/functions/versionChecker.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/instrument.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/instrument.test.js +1537 -0
- package/dist/commands/lambda/__tests__/instrument.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/loggroup.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/loggroup.test.js +340 -0
- package/dist/commands/lambda/__tests__/loggroup.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/prompt.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/prompt.test.js +206 -0
- package/dist/commands/lambda/__tests__/prompt.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/tags.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/tags.test.js +305 -0
- package/dist/commands/lambda/__tests__/tags.test.js.map +1 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.d.ts +1 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.js +722 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.js.map +1 -0
- package/dist/commands/lambda/constants.d.ts +2 -0
- package/dist/commands/lambda/constants.js +4 -0
- package/dist/commands/lambda/constants.js.map +1 -1
- package/dist/commands/lambda/functions/commons.d.ts +1 -1
- package/dist/commands/measure/__tests__/measure.test.d.ts +1 -0
- package/dist/commands/measure/__tests__/measure.test.js +102 -0
- package/dist/commands/measure/__tests__/measure.test.js.map +1 -0
- package/dist/commands/measure/measure.d.ts +0 -1
- package/dist/commands/measure/measure.js +2 -9
- package/dist/commands/measure/measure.js.map +1 -1
- package/dist/commands/react-native/__tests__/codepush.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/codepush.test.js +161 -0
- package/dist/commands/react-native/__tests__/codepush.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/interfaces.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/interfaces.test.js +33 -0
- package/dist/commands/react-native/__tests__/interfaces.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/upload.test.js +238 -0
- package/dist/commands/react-native/__tests__/upload.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/utils.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/utils.test.js +27 -0
- package/dist/commands/react-native/__tests__/utils.test.js.map +1 -0
- package/dist/commands/react-native/__tests__/xcode.test.d.ts +1 -0
- package/dist/commands/react-native/__tests__/xcode.test.js +465 -0
- package/dist/commands/react-native/__tests__/xcode.test.js.map +1 -0
- package/dist/commands/sarif/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/sarif/__tests__/upload.test.js +218 -0
- package/dist/commands/sarif/__tests__/upload.test.js.map +1 -0
- package/dist/commands/sarif/__tests__/validation.test.d.ts +1 -0
- package/dist/commands/sarif/__tests__/validation.test.js +19 -0
- package/dist/commands/sarif/__tests__/validation.test.js.map +1 -0
- package/dist/commands/sarif/api.js +1 -1
- package/dist/commands/sarif/api.js.map +1 -1
- package/dist/commands/sarif/interfaces.d.ts +0 -1
- package/dist/commands/sarif/renderer.d.ts +2 -2
- package/dist/commands/sarif/renderer.js +5 -5
- package/dist/commands/sarif/renderer.js.map +1 -1
- package/dist/commands/sarif/upload.d.ts +1 -1
- package/dist/commands/sarif/upload.js +15 -10
- package/dist/commands/sarif/upload.js.map +1 -1
- package/dist/commands/sbom/__tests__/payload.test.d.ts +1 -0
- package/dist/commands/sbom/__tests__/payload.test.js +306 -0
- package/dist/commands/sbom/__tests__/payload.test.js.map +1 -0
- package/dist/commands/sbom/__tests__/validation.test.d.ts +1 -0
- package/dist/commands/sbom/__tests__/validation.test.js +141 -0
- package/dist/commands/sbom/__tests__/validation.test.js.map +1 -0
- package/dist/commands/sbom/upload.d.ts +1 -1
- package/dist/commands/sbom/upload.js +9 -3
- package/dist/commands/sbom/upload.js.map +1 -1
- package/dist/commands/sourcemaps/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/sourcemaps/__tests__/upload.test.js +270 -0
- package/dist/commands/sourcemaps/__tests__/upload.test.js.map +1 -0
- package/dist/commands/sourcemaps/__tests__/utils.test.d.ts +1 -0
- package/dist/commands/sourcemaps/__tests__/utils.test.js +31 -0
- package/dist/commands/sourcemaps/__tests__/utils.test.js.map +1 -0
- package/dist/commands/sourcemaps/upload.d.ts +1 -0
- package/dist/commands/sourcemaps/upload.js +6 -2
- package/dist/commands/sourcemaps/upload.js.map +1 -1
- package/dist/commands/stepfunctions/__tests__/awsCommands.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/awsCommands.test.js +210 -0
- package/dist/commands/stepfunctions/__tests__/awsCommands.test.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.d.ts +6 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js +45 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/cli.d.ts +5 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/cli.js +19 -0
- package/dist/commands/stepfunctions/__tests__/fixtures/cli.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/helpers.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/helpers.test.js +501 -0
- package/dist/commands/stepfunctions/__tests__/helpers.test.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/instrument.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/instrument.test.js +431 -0
- package/dist/commands/stepfunctions/__tests__/instrument.test.js.map +1 -0
- package/dist/commands/stepfunctions/__tests__/uninstrument.test.d.ts +1 -0
- package/dist/commands/stepfunctions/__tests__/uninstrument.test.js +166 -0
- package/dist/commands/stepfunctions/__tests__/uninstrument.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/api.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/api.test.js +416 -0
- package/dist/commands/synthetics/__tests__/api.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/batch.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/batch.test.js +906 -0
- package/dist/commands/synthetics/__tests__/batch.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/cli.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/cli.test.js +1371 -0
- package/dist/commands/synthetics/__tests__/cli.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/deploy-tests-lib.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/deploy-tests-lib.test.js +112 -0
- package/dist/commands/synthetics/__tests__/deploy-tests-lib.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/fixtures.d.ts +123 -0
- package/dist/commands/synthetics/__tests__/fixtures.js +493 -0
- package/dist/commands/synthetics/__tests__/fixtures.js.map +1 -0
- package/dist/commands/synthetics/__tests__/import-tests-lib.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/import-tests-lib.test.js +186 -0
- package/dist/commands/synthetics/__tests__/import-tests-lib.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/mobile.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/mobile.test.js +376 -0
- package/dist/commands/synthetics/__tests__/mobile.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/multilocator.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/multilocator.test.js +132 -0
- package/dist/commands/synthetics/__tests__/multilocator.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/reporters/default.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/reporters/default.test.js +410 -0
- package/dist/commands/synthetics/__tests__/reporters/default.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/reporters/junit.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/reporters/junit.test.js +354 -0
- package/dist/commands/synthetics/__tests__/reporters/junit.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js +232 -0
- package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/run-tests-lib.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/run-tests-lib.test.js +698 -0
- package/dist/commands/synthetics/__tests__/run-tests-lib.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/test.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/test.test.js +269 -0
- package/dist/commands/synthetics/__tests__/test.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/crypto.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js +21 -0
- package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js +80 -0
- package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/websocket.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js +109 -0
- package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/utils/internal.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/utils/internal.test.js +161 -0
- package/dist/commands/synthetics/__tests__/utils/internal.test.js.map +1 -0
- package/dist/commands/synthetics/__tests__/utils/public.test.d.ts +1 -0
- package/dist/commands/synthetics/__tests__/utils/public.test.js +575 -0
- package/dist/commands/synthetics/__tests__/utils/public.test.js.map +1 -0
- package/dist/commands/synthetics/api.d.ts +4 -2
- package/dist/commands/synthetics/api.js +20 -1
- package/dist/commands/synthetics/api.js.map +1 -1
- package/dist/commands/synthetics/batch.d.ts +4 -2
- package/dist/commands/synthetics/batch.js +65 -7
- package/dist/commands/synthetics/batch.js.map +1 -1
- package/dist/commands/synthetics/cli.js +3 -1
- package/dist/commands/synthetics/cli.js.map +1 -1
- package/dist/commands/synthetics/deploy-tests-command.d.ts +22 -0
- package/dist/commands/synthetics/deploy-tests-command.js +150 -0
- package/dist/commands/synthetics/deploy-tests-command.js.map +1 -0
- package/dist/commands/synthetics/deploy-tests-lib.d.ts +2 -0
- package/dist/commands/synthetics/deploy-tests-lib.js +72 -0
- package/dist/commands/synthetics/deploy-tests-lib.js.map +1 -0
- package/dist/commands/synthetics/errors.d.ts +1 -1
- package/dist/commands/synthetics/errors.js +1 -0
- package/dist/commands/synthetics/errors.js.map +1 -1
- package/dist/commands/synthetics/import-tests-command.d.ts +22 -0
- package/dist/commands/synthetics/import-tests-command.js +142 -0
- package/dist/commands/synthetics/import-tests-command.js.map +1 -0
- package/dist/commands/synthetics/import-tests-lib.d.ts +2 -0
- package/dist/commands/synthetics/import-tests-lib.js +71 -0
- package/dist/commands/synthetics/import-tests-lib.js.map +1 -0
- package/dist/commands/synthetics/interfaces.d.ts +74 -28
- package/dist/commands/synthetics/interfaces.js.map +1 -1
- package/dist/commands/synthetics/local-test-definition.d.ts +2 -0
- package/dist/commands/synthetics/local-test-definition.js +16 -0
- package/dist/commands/synthetics/local-test-definition.js.map +1 -0
- package/dist/commands/synthetics/mobile.js +2 -2
- package/dist/commands/synthetics/mobile.js.map +1 -1
- package/dist/commands/synthetics/multilocator.d.ts +3 -0
- package/dist/commands/synthetics/multilocator.js +98 -0
- package/dist/commands/synthetics/multilocator.js.map +1 -0
- package/dist/commands/synthetics/reporters/junit.d.ts +1 -2
- package/dist/commands/synthetics/reporters/junit.js +5 -6
- package/dist/commands/synthetics/reporters/junit.js.map +1 -1
- package/dist/commands/synthetics/run-tests-command.d.ts +0 -9
- package/dist/commands/synthetics/run-tests-command.js +22 -64
- package/dist/commands/synthetics/run-tests-command.js.map +1 -1
- package/dist/commands/synthetics/run-tests-lib.js +15 -12
- package/dist/commands/synthetics/run-tests-lib.js.map +1 -1
- package/dist/commands/synthetics/test.d.ts +10 -19
- package/dist/commands/synthetics/test.js +93 -13
- package/dist/commands/synthetics/test.js.map +1 -1
- package/dist/commands/synthetics/tunnel/tunnel.js +2 -2
- package/dist/commands/synthetics/tunnel/tunnel.js.map +1 -1
- package/dist/commands/synthetics/utils/internal.d.ts +3 -1
- package/dist/commands/synthetics/utils/internal.js +18 -8
- package/dist/commands/synthetics/utils/internal.js.map +1 -1
- package/dist/commands/synthetics/utils/public.d.ts +5 -26
- package/dist/commands/synthetics/utils/public.js +13 -248
- package/dist/commands/synthetics/utils/public.js.map +1 -1
- package/dist/commands/tag/__tests__/tag.test.d.ts +1 -0
- package/dist/commands/tag/__tests__/tag.test.js +85 -0
- package/dist/commands/tag/__tests__/tag.test.js.map +1 -0
- package/dist/commands/trace/__tests__/trace.test.d.ts +1 -0
- package/dist/commands/trace/__tests__/trace.test.js +145 -0
- package/dist/commands/trace/__tests__/trace.test.js.map +1 -0
- package/dist/commands/unity-symbols/__tests__/upload.test.d.ts +1 -0
- package/dist/commands/unity-symbols/__tests__/upload.test.js +369 -0
- package/dist/commands/unity-symbols/__tests__/upload.test.js.map +1 -0
- package/dist/commands/unity-symbols/upload.js +2 -2
- package/dist/commands/unity-symbols/upload.js.map +1 -1
- package/dist/helpers/__tests__/app.test.d.ts +1 -0
- package/dist/helpers/__tests__/app.test.js +31 -0
- package/dist/helpers/__tests__/app.test.js.map +1 -0
- package/dist/helpers/__tests__/ci.test.d.ts +1 -0
- package/dist/helpers/__tests__/ci.test.js +295 -0
- package/dist/helpers/__tests__/ci.test.js.map +1 -0
- package/dist/helpers/__tests__/env.test.d.ts +1 -0
- package/dist/helpers/__tests__/env.test.js +74 -0
- package/dist/helpers/__tests__/env.test.js.map +1 -0
- package/dist/helpers/__tests__/fips.test.d.ts +1 -0
- package/dist/helpers/__tests__/fips.test.js +30 -0
- package/dist/helpers/__tests__/fips.test.js.map +1 -0
- package/dist/helpers/__tests__/fixtures.d.ts +41 -0
- package/dist/helpers/__tests__/fixtures.js +80 -0
- package/dist/helpers/__tests__/fixtures.js.map +1 -0
- package/dist/helpers/__tests__/flare.test.d.ts +1 -0
- package/dist/helpers/__tests__/flare.test.js +226 -0
- package/dist/helpers/__tests__/flare.test.js.map +1 -0
- package/dist/helpers/__tests__/fs.test.d.ts +1 -0
- package/dist/helpers/__tests__/fs.test.js +189 -0
- package/dist/helpers/__tests__/fs.test.js.map +1 -0
- package/dist/helpers/__tests__/id.test.d.ts +1 -0
- package/dist/helpers/__tests__/id.test.js +24 -0
- package/dist/helpers/__tests__/id.test.js.map +1 -0
- package/dist/helpers/__tests__/plist.test.d.ts +1 -0
- package/dist/helpers/__tests__/plist.test.js +43 -0
- package/dist/helpers/__tests__/plist.test.js.map +1 -0
- package/dist/helpers/__tests__/prompt.test.d.ts +1 -0
- package/dist/helpers/__tests__/prompt.test.js +71 -0
- package/dist/helpers/__tests__/prompt.test.js.map +1 -0
- package/dist/helpers/__tests__/retry.test.d.ts +1 -0
- package/dist/helpers/__tests__/retry.test.js +99 -0
- package/dist/helpers/__tests__/retry.test.js.map +1 -0
- package/dist/helpers/__tests__/tags.test.d.ts +1 -0
- package/dist/helpers/__tests__/tags.test.js +303 -0
- package/dist/helpers/__tests__/tags.test.js.map +1 -0
- package/dist/helpers/__tests__/upload.test.d.ts +1 -0
- package/dist/helpers/__tests__/upload.test.js +231 -0
- package/dist/helpers/__tests__/upload.test.js.map +1 -0
- package/dist/helpers/__tests__/user-provided-git.test.d.ts +1 -0
- package/dist/helpers/__tests__/user-provided-git.test.js +119 -0
- package/dist/helpers/__tests__/user-provided-git.test.js.map +1 -0
- package/dist/helpers/__tests__/utils.test.d.ts +1 -0
- package/dist/helpers/__tests__/utils.test.js +429 -0
- package/dist/helpers/__tests__/utils.test.js.map +1 -0
- package/dist/helpers/__tests__/validation.test.d.ts +1 -0
- package/dist/helpers/__tests__/validation.test.js +25 -0
- package/dist/helpers/__tests__/validation.test.js.map +1 -0
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.d.ts +1 -0
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js +103 -0
- package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js.map +1 -0
- package/dist/helpers/git/__tests__/format-git-span-data.test.d.ts +1 -0
- package/dist/helpers/git/__tests__/format-git-span-data.test.js +121 -0
- package/dist/helpers/git/__tests__/format-git-span-data.test.js.map +1 -0
- package/dist/helpers/git/__tests__/get-git-data.test.d.ts +1 -0
- package/dist/helpers/git/__tests__/get-git-data.test.js +72 -0
- package/dist/helpers/git/__tests__/get-git-data.test.js.map +1 -0
- package/dist/helpers/id.js.map +1 -0
- package/dist/helpers/tags.d.ts +1 -4
- package/dist/helpers/tags.js +2 -6
- package/dist/helpers/tags.js.map +1 -1
- package/dist/helpers/utils.d.ts +0 -4
- package/dist/helpers/utils.js +1 -21
- package/dist/helpers/utils.js.map +1 -1
- package/package.json +16 -17
- package/dist/commands/junit/id.js.map +0 -1
- package/dist/commands/synthetics/compatibility.d.ts +0 -7
- package/dist/commands/synthetics/compatibility.js +0 -83
- package/dist/commands/synthetics/compatibility.js.map +0 -1
- /package/dist/{commands/junit → helpers}/id.d.ts +0 -0
- /package/dist/{commands/junit → helpers}/id.js +0 -0
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
jest.mock('../../loggroup');
|
|
13
|
+
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
14
|
+
const aws_sdk_client_mock_1 = require("aws-sdk-client-mock");
|
|
15
|
+
const constants_1 = require("../../../../constants");
|
|
16
|
+
const fixtures_1 = require("../../../../helpers/__tests__/fixtures");
|
|
17
|
+
const constants_2 = require("../../constants");
|
|
18
|
+
const instrument_1 = require("../../functions/instrument");
|
|
19
|
+
const fixtures_2 = require("../fixtures");
|
|
20
|
+
describe('instrument', () => {
|
|
21
|
+
describe('calculateUpdateRequest', () => {
|
|
22
|
+
const OLD_ENV = process.env;
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
jest.resetModules();
|
|
25
|
+
process.env = {};
|
|
26
|
+
});
|
|
27
|
+
afterAll(() => {
|
|
28
|
+
process.env = OLD_ENV;
|
|
29
|
+
});
|
|
30
|
+
test('calculates an update request with just lambda library layers', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const runtime = client_lambda_1.Runtime.nodejs20x;
|
|
32
|
+
const config = {
|
|
33
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
34
|
+
Handler: 'index.handler',
|
|
35
|
+
Layers: [],
|
|
36
|
+
Runtime: runtime,
|
|
37
|
+
};
|
|
38
|
+
const settings = {
|
|
39
|
+
flushMetricsToLogs: false,
|
|
40
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
41
|
+
layerVersion: 5,
|
|
42
|
+
mergeXrayTraces: false,
|
|
43
|
+
tracingEnabled: false,
|
|
44
|
+
};
|
|
45
|
+
const region = 'sa-east-1';
|
|
46
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
47
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
48
|
+
{
|
|
49
|
+
"Environment": {
|
|
50
|
+
"Variables": {
|
|
51
|
+
"DD_FLUSH_TO_LOG": "false",
|
|
52
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
53
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
54
|
+
"DD_SITE": "datadoghq.com",
|
|
55
|
+
"DD_TRACE_ENABLED": "false",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
59
|
+
"Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler",
|
|
60
|
+
"Layers": [
|
|
61
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Node20-x:5",
|
|
62
|
+
],
|
|
63
|
+
}
|
|
64
|
+
`);
|
|
65
|
+
}));
|
|
66
|
+
test.each([
|
|
67
|
+
[client_lambda_1.Runtime.python310, 'Datadog-Python310'],
|
|
68
|
+
[client_lambda_1.Runtime.python311, 'Datadog-Python311'],
|
|
69
|
+
[client_lambda_1.Runtime.python312, 'Datadog-Python312'],
|
|
70
|
+
])('calculates an update request for %s', (runtime, layer) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
const config = {
|
|
72
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
73
|
+
Handler: 'index.handler',
|
|
74
|
+
Layers: [],
|
|
75
|
+
Runtime: runtime,
|
|
76
|
+
};
|
|
77
|
+
const settings = {
|
|
78
|
+
flushMetricsToLogs: false,
|
|
79
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
80
|
+
layerVersion: 71,
|
|
81
|
+
mergeXrayTraces: false,
|
|
82
|
+
tracingEnabled: false,
|
|
83
|
+
};
|
|
84
|
+
const region = 'sa-east-1';
|
|
85
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
86
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
87
|
+
{
|
|
88
|
+
"Environment": {
|
|
89
|
+
"Variables": {
|
|
90
|
+
"DD_FLUSH_TO_LOG": "false",
|
|
91
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
92
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
93
|
+
"DD_SITE": "datadoghq.com",
|
|
94
|
+
"DD_TRACE_ENABLED": "false",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
98
|
+
"Handler": "datadog_lambda.handler.handler",
|
|
99
|
+
"Layers": [
|
|
100
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:${layer}:71",
|
|
101
|
+
],
|
|
102
|
+
}
|
|
103
|
+
`);
|
|
104
|
+
}));
|
|
105
|
+
test('calculates an update request with just lambda library layers in arm architecture', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
|
+
const runtime = client_lambda_1.Runtime.python39;
|
|
107
|
+
const config = {
|
|
108
|
+
Architectures: [client_lambda_1.Architecture.arm64],
|
|
109
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
110
|
+
Handler: 'handler.hello',
|
|
111
|
+
Layers: [],
|
|
112
|
+
Runtime: runtime,
|
|
113
|
+
};
|
|
114
|
+
const settings = {
|
|
115
|
+
flushMetricsToLogs: false,
|
|
116
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
117
|
+
layerVersion: 11,
|
|
118
|
+
mergeXrayTraces: false,
|
|
119
|
+
tracingEnabled: false,
|
|
120
|
+
};
|
|
121
|
+
const region = 'sa-east-1';
|
|
122
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
123
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
124
|
+
{
|
|
125
|
+
"Environment": {
|
|
126
|
+
"Variables": {
|
|
127
|
+
"DD_FLUSH_TO_LOG": "false",
|
|
128
|
+
"DD_LAMBDA_HANDLER": "handler.hello",
|
|
129
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
130
|
+
"DD_SITE": "datadoghq.com",
|
|
131
|
+
"DD_TRACE_ENABLED": "false",
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
135
|
+
"Handler": "datadog_lambda.handler.handler",
|
|
136
|
+
"Layers": [
|
|
137
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Python39-ARM:11",
|
|
138
|
+
],
|
|
139
|
+
}
|
|
140
|
+
`);
|
|
141
|
+
}));
|
|
142
|
+
test('calculates an update request with a lambda library, extension, and DATADOG_API_KEY', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
143
|
+
process.env[constants_1.CI_API_KEY_ENV_VAR] = fixtures_1.MOCK_DATADOG_API_KEY;
|
|
144
|
+
const runtime = client_lambda_1.Runtime.nodejs20x;
|
|
145
|
+
const config = {
|
|
146
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
147
|
+
Handler: 'index.handler',
|
|
148
|
+
Layers: [],
|
|
149
|
+
Runtime: runtime,
|
|
150
|
+
};
|
|
151
|
+
const settings = {
|
|
152
|
+
extensionVersion: 6,
|
|
153
|
+
flushMetricsToLogs: false,
|
|
154
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
155
|
+
layerVersion: 5,
|
|
156
|
+
mergeXrayTraces: false,
|
|
157
|
+
tracingEnabled: false,
|
|
158
|
+
};
|
|
159
|
+
const region = 'sa-east-1';
|
|
160
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
161
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
162
|
+
{
|
|
163
|
+
"Environment": {
|
|
164
|
+
"Variables": {
|
|
165
|
+
"DD_API_KEY": "02aeb762fff59ac0d5ad1536cd9633bd",
|
|
166
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
167
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
168
|
+
"DD_SITE": "datadoghq.com",
|
|
169
|
+
"DD_TRACE_ENABLED": "false",
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
173
|
+
"Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler",
|
|
174
|
+
"Layers": [
|
|
175
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Extension:6",
|
|
176
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Node20-x:5",
|
|
177
|
+
],
|
|
178
|
+
}
|
|
179
|
+
`);
|
|
180
|
+
}));
|
|
181
|
+
test('calculates an update request with a lambda library, extension, and DD_API_KEY', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
182
|
+
process.env[constants_1.API_KEY_ENV_VAR] = 'SOME-DD-API-KEY';
|
|
183
|
+
const runtime = client_lambda_1.Runtime.nodejs20x;
|
|
184
|
+
const config = {
|
|
185
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
186
|
+
Handler: 'index.handler',
|
|
187
|
+
Layers: [],
|
|
188
|
+
Runtime: runtime,
|
|
189
|
+
};
|
|
190
|
+
const settings = {
|
|
191
|
+
extensionVersion: 6,
|
|
192
|
+
flushMetricsToLogs: false,
|
|
193
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
194
|
+
layerVersion: 5,
|
|
195
|
+
mergeXrayTraces: false,
|
|
196
|
+
tracingEnabled: false,
|
|
197
|
+
};
|
|
198
|
+
const region = 'sa-east-1';
|
|
199
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
200
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
201
|
+
{
|
|
202
|
+
"Environment": {
|
|
203
|
+
"Variables": {
|
|
204
|
+
"DD_API_KEY": "SOME-DD-API-KEY",
|
|
205
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
206
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
207
|
+
"DD_SITE": "datadoghq.com",
|
|
208
|
+
"DD_TRACE_ENABLED": "false",
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
212
|
+
"Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler",
|
|
213
|
+
"Layers": [
|
|
214
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Extension:6",
|
|
215
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Node20-x:5",
|
|
216
|
+
],
|
|
217
|
+
}
|
|
218
|
+
`);
|
|
219
|
+
}));
|
|
220
|
+
test('calculates an update request with a lambda library, extension, and DATADOG_API_KEY_SECRET_ARN', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
221
|
+
process.env[constants_2.CI_API_KEY_SECRET_ARN_ENV_VAR] = 'some-secret:arn:from:aws';
|
|
222
|
+
const runtime = client_lambda_1.Runtime.python39;
|
|
223
|
+
const config = {
|
|
224
|
+
FunctionArn: 'arn:aws:lambda:sa-east-1:123456789012:function:lambda-hello-world',
|
|
225
|
+
Handler: 'index.handler',
|
|
226
|
+
Layers: [],
|
|
227
|
+
Runtime: runtime,
|
|
228
|
+
};
|
|
229
|
+
const settings = {
|
|
230
|
+
extensionVersion: 11,
|
|
231
|
+
flushMetricsToLogs: false,
|
|
232
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
233
|
+
layerVersion: 49,
|
|
234
|
+
mergeXrayTraces: false,
|
|
235
|
+
tracingEnabled: false,
|
|
236
|
+
};
|
|
237
|
+
const region = 'sa-east-1';
|
|
238
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
239
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
240
|
+
{
|
|
241
|
+
"Environment": {
|
|
242
|
+
"Variables": {
|
|
243
|
+
"DD_API_KEY_SECRET_ARN": "some-secret:arn:from:aws",
|
|
244
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
245
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
246
|
+
"DD_SITE": "datadoghq.com",
|
|
247
|
+
"DD_TRACE_ENABLED": "false",
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
"FunctionName": "arn:aws:lambda:sa-east-1:123456789012:function:lambda-hello-world",
|
|
251
|
+
"Handler": "datadog_lambda.handler.handler",
|
|
252
|
+
"Layers": [
|
|
253
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Extension:11",
|
|
254
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Python39:49",
|
|
255
|
+
],
|
|
256
|
+
}
|
|
257
|
+
`);
|
|
258
|
+
}));
|
|
259
|
+
test('calculates an update request with a lambda library, extension, and DATADOG_KMS_API_KEY', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
260
|
+
process.env[constants_2.CI_KMS_API_KEY_ENV_VAR] = '5678';
|
|
261
|
+
const runtime = client_lambda_1.Runtime.python39;
|
|
262
|
+
const config = {
|
|
263
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
264
|
+
Handler: 'index.handler',
|
|
265
|
+
Layers: [],
|
|
266
|
+
Runtime: runtime,
|
|
267
|
+
};
|
|
268
|
+
const settings = {
|
|
269
|
+
extensionVersion: 6,
|
|
270
|
+
flushMetricsToLogs: false,
|
|
271
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
272
|
+
layerVersion: 5,
|
|
273
|
+
mergeXrayTraces: false,
|
|
274
|
+
tracingEnabled: false,
|
|
275
|
+
};
|
|
276
|
+
const region = 'sa-east-1';
|
|
277
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
278
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
279
|
+
{
|
|
280
|
+
"Environment": {
|
|
281
|
+
"Variables": {
|
|
282
|
+
"DD_KMS_API_KEY": "5678",
|
|
283
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
284
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
285
|
+
"DD_SITE": "datadoghq.com",
|
|
286
|
+
"DD_TRACE_ENABLED": "false",
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
290
|
+
"Handler": "datadog_lambda.handler.handler",
|
|
291
|
+
"Layers": [
|
|
292
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Extension:6",
|
|
293
|
+
"arn:aws:lambda:sa-east-1:123456789012:layer:Datadog-Python39:5",
|
|
294
|
+
],
|
|
295
|
+
}
|
|
296
|
+
`);
|
|
297
|
+
}));
|
|
298
|
+
test('prioritizes the KMS API KEY when all of them are exported', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
299
|
+
process.env = {
|
|
300
|
+
[constants_1.CI_API_KEY_ENV_VAR]: fixtures_1.MOCK_DATADOG_API_KEY,
|
|
301
|
+
[constants_2.CI_API_KEY_SECRET_ARN_ENV_VAR]: '5678',
|
|
302
|
+
[constants_2.CI_KMS_API_KEY_ENV_VAR]: 'should-be-selected',
|
|
303
|
+
};
|
|
304
|
+
const config = {
|
|
305
|
+
FunctionArn: 'arn:aws:lambda:sa-east-1:123456789012:function:lambda-hello-world',
|
|
306
|
+
Handler: 'index.handler',
|
|
307
|
+
Layers: [],
|
|
308
|
+
};
|
|
309
|
+
const runtime = 'python3.9';
|
|
310
|
+
const region = 'sa-east-1';
|
|
311
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, {}, region, runtime);
|
|
312
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
313
|
+
{
|
|
314
|
+
"Environment": {
|
|
315
|
+
"Variables": {
|
|
316
|
+
"DD_KMS_API_KEY": "should-be-selected",
|
|
317
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
318
|
+
"DD_SITE": "datadoghq.com",
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
"FunctionName": "arn:aws:lambda:sa-east-1:123456789012:function:lambda-hello-world",
|
|
322
|
+
}
|
|
323
|
+
`);
|
|
324
|
+
}));
|
|
325
|
+
test("doesn't set DD_FLUSH_TO_LOGS when extension is being used", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
326
|
+
process.env[constants_1.CI_API_KEY_ENV_VAR] = fixtures_1.MOCK_DATADOG_API_KEY;
|
|
327
|
+
const config = {
|
|
328
|
+
FunctionArn: 'arn:aws:lambda:sa-east-1:123456789012:function:lambda-hello-world',
|
|
329
|
+
Handler: 'index.handler',
|
|
330
|
+
Layers: [],
|
|
331
|
+
};
|
|
332
|
+
const runtime = 'python3.9';
|
|
333
|
+
const region = 'sa-east-1';
|
|
334
|
+
const settings = {
|
|
335
|
+
extensionVersion: 13,
|
|
336
|
+
flushMetricsToLogs: true,
|
|
337
|
+
mergeXrayTraces: false,
|
|
338
|
+
tracingEnabled: false,
|
|
339
|
+
};
|
|
340
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
341
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
342
|
+
{
|
|
343
|
+
"Environment": {
|
|
344
|
+
"Variables": {
|
|
345
|
+
"DD_API_KEY": "02aeb762fff59ac0d5ad1536cd9633bd",
|
|
346
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
347
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
348
|
+
"DD_SITE": "datadoghq.com",
|
|
349
|
+
"DD_TRACE_ENABLED": "false",
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
"FunctionName": "arn:aws:lambda:sa-east-1:123456789012:function:lambda-hello-world",
|
|
353
|
+
"Layers": [
|
|
354
|
+
"arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:13",
|
|
355
|
+
],
|
|
356
|
+
}
|
|
357
|
+
`);
|
|
358
|
+
}));
|
|
359
|
+
test('by default calculates an update request with DATADOG_SITE being set to datadoghq.com', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
360
|
+
const runtime = client_lambda_1.Runtime.python39;
|
|
361
|
+
const config = {
|
|
362
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
363
|
+
Handler: 'index.handler',
|
|
364
|
+
Layers: [],
|
|
365
|
+
Runtime: runtime,
|
|
366
|
+
};
|
|
367
|
+
const settings = {
|
|
368
|
+
flushMetricsToLogs: false,
|
|
369
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
370
|
+
mergeXrayTraces: false,
|
|
371
|
+
tracingEnabled: false,
|
|
372
|
+
};
|
|
373
|
+
const region = 'sa-east-1';
|
|
374
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
375
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
376
|
+
{
|
|
377
|
+
"Environment": {
|
|
378
|
+
"Variables": {
|
|
379
|
+
"DD_FLUSH_TO_LOG": "false",
|
|
380
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
381
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
382
|
+
"DD_SITE": "datadoghq.com",
|
|
383
|
+
"DD_TRACE_ENABLED": "false",
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
387
|
+
}
|
|
388
|
+
`);
|
|
389
|
+
}));
|
|
390
|
+
test('calculates an update request with DATADOG_SITE being set to datadoghq.eu', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
391
|
+
process.env.DATADOG_SITE = 'datadoghq.eu';
|
|
392
|
+
const config = {
|
|
393
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
394
|
+
Handler: 'index.handler',
|
|
395
|
+
Layers: [],
|
|
396
|
+
};
|
|
397
|
+
const settings = {
|
|
398
|
+
flushMetricsToLogs: false,
|
|
399
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
400
|
+
mergeXrayTraces: false,
|
|
401
|
+
tracingEnabled: false,
|
|
402
|
+
};
|
|
403
|
+
const region = 'sa-east-1';
|
|
404
|
+
const runtime = 'python3.9';
|
|
405
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
406
|
+
expect(updateRequest).toMatchInlineSnapshot(`
|
|
407
|
+
{
|
|
408
|
+
"Environment": {
|
|
409
|
+
"Variables": {
|
|
410
|
+
"DD_FLUSH_TO_LOG": "false",
|
|
411
|
+
"DD_LAMBDA_HANDLER": "index.handler",
|
|
412
|
+
"DD_MERGE_XRAY_TRACES": "false",
|
|
413
|
+
"DD_SITE": "datadoghq.eu",
|
|
414
|
+
"DD_TRACE_ENABLED": "false",
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
"FunctionName": "arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world",
|
|
418
|
+
}
|
|
419
|
+
`);
|
|
420
|
+
}));
|
|
421
|
+
test('throws an error when an invalid DATADOG_SITE url is given', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
422
|
+
process.env.DATADOG_SITE = 'datacathq.eu';
|
|
423
|
+
const config = {
|
|
424
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
425
|
+
Handler: 'index.handler',
|
|
426
|
+
Layers: [],
|
|
427
|
+
};
|
|
428
|
+
const settings = {
|
|
429
|
+
flushMetricsToLogs: false,
|
|
430
|
+
interactive: false,
|
|
431
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
432
|
+
layerVersion: 5,
|
|
433
|
+
mergeXrayTraces: false,
|
|
434
|
+
tracingEnabled: false,
|
|
435
|
+
};
|
|
436
|
+
const region = 'us-east-1';
|
|
437
|
+
const runtime = 'python3.9';
|
|
438
|
+
let error;
|
|
439
|
+
try {
|
|
440
|
+
yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
441
|
+
}
|
|
442
|
+
catch (e) {
|
|
443
|
+
if (e instanceof Error) {
|
|
444
|
+
error = e;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
expect(error === null || error === void 0 ? void 0 : error.message).toBe('Warning: Invalid site URL. Must be either datadoghq.com, datadoghq.eu, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, or ddog-gov.com.');
|
|
448
|
+
}));
|
|
449
|
+
test('throws an error when neither DATADOG_API_KEY nor DATADOG_KMS_API_KEY are given through the environment while using extensionVersion', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
450
|
+
const config = {
|
|
451
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
452
|
+
Handler: 'index.handler',
|
|
453
|
+
Layers: [],
|
|
454
|
+
};
|
|
455
|
+
const settings = {
|
|
456
|
+
extensionVersion: 6,
|
|
457
|
+
flushMetricsToLogs: false,
|
|
458
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
459
|
+
layerVersion: 5,
|
|
460
|
+
mergeXrayTraces: false,
|
|
461
|
+
tracingEnabled: false,
|
|
462
|
+
};
|
|
463
|
+
const region = 'us-east-1';
|
|
464
|
+
const runtime = 'python3.9';
|
|
465
|
+
let error;
|
|
466
|
+
try {
|
|
467
|
+
yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
468
|
+
}
|
|
469
|
+
catch (e) {
|
|
470
|
+
if (e instanceof Error) {
|
|
471
|
+
error = e;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
expect(error === null || error === void 0 ? void 0 : error.message).toBe("When 'extensionLayer' is set, DATADOG_API_KEY, DATADOG_KMS_API_KEY, or DATADOG_API_KEY_SECRET_ARN must also be set");
|
|
475
|
+
}));
|
|
476
|
+
test('throws error when trying to add `DD_API_KEY_SECRET_ARN` while using sync metrics in a node runtime', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
477
|
+
process.env[constants_2.CI_API_KEY_SECRET_ARN_ENV_VAR] = 'some-secret:arn:from:aws';
|
|
478
|
+
const runtime = client_lambda_1.Runtime.nodejs20x;
|
|
479
|
+
const region = 'us-east-1';
|
|
480
|
+
const config = {
|
|
481
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
482
|
+
Handler: 'index.handler',
|
|
483
|
+
Layers: [],
|
|
484
|
+
Runtime: runtime,
|
|
485
|
+
};
|
|
486
|
+
const settings = {
|
|
487
|
+
flushMetricsToLogs: false,
|
|
488
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
489
|
+
layerVersion: 13,
|
|
490
|
+
mergeXrayTraces: false,
|
|
491
|
+
tracingEnabled: false,
|
|
492
|
+
};
|
|
493
|
+
let error;
|
|
494
|
+
try {
|
|
495
|
+
yield (0, instrument_1.calculateUpdateRequest)(config, settings, region, runtime);
|
|
496
|
+
}
|
|
497
|
+
catch (e) {
|
|
498
|
+
if (e instanceof Error) {
|
|
499
|
+
error = e;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
expect(error === null || error === void 0 ? void 0 : error.message).toBe('`apiKeySecretArn` is not supported for Node runtimes when using Synchronous Metrics. Use either `apiKey` or `apiKmsKey`.');
|
|
503
|
+
}));
|
|
504
|
+
describe('test universal instrumentation workflow for Java and .Net', () => {
|
|
505
|
+
const region = 'us-east-1';
|
|
506
|
+
const config = {
|
|
507
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
508
|
+
Handler: 'index.handler',
|
|
509
|
+
Layers: [],
|
|
510
|
+
Runtime: 'runtime',
|
|
511
|
+
};
|
|
512
|
+
const settings = {
|
|
513
|
+
flushMetricsToLogs: false,
|
|
514
|
+
layerAWSAccount: fixtures_2.mockAwsAccount,
|
|
515
|
+
layerVersion: 13,
|
|
516
|
+
mergeXrayTraces: false,
|
|
517
|
+
tracingEnabled: false,
|
|
518
|
+
};
|
|
519
|
+
const dotnetRuntime = client_lambda_1.Runtime.dotnet6;
|
|
520
|
+
const javaRuntime = client_lambda_1.Runtime.java11;
|
|
521
|
+
describe(`test for runtime ${dotnetRuntime}`, () => {
|
|
522
|
+
const dotNetConfig = Object.assign(Object.assign({}, config), { Runtime: dotnetRuntime });
|
|
523
|
+
const dotNetConfigOnArm86 = Object.assign(Object.assign({}, config), { Runtime: dotnetRuntime, Architectures: [client_lambda_1.Architecture.arm64] });
|
|
524
|
+
test('should throw error when the extension version and trace version are not compatible', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
525
|
+
process.env[constants_2.CI_KMS_API_KEY_ENV_VAR] = '5678';
|
|
526
|
+
const badSettings = Object.assign(Object.assign({}, settings), { extensionVersion: 24, layerVersion: 3 });
|
|
527
|
+
let error;
|
|
528
|
+
try {
|
|
529
|
+
yield (0, instrument_1.calculateUpdateRequest)(dotNetConfig, badSettings, region, dotnetRuntime);
|
|
530
|
+
}
|
|
531
|
+
catch (e) {
|
|
532
|
+
if (e instanceof Error) {
|
|
533
|
+
error = e;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
expect(error === null || error === void 0 ? void 0 : error.message).toBe(`For the ${dotnetRuntime} runtime, the dd-trace version 3 is not compatible with the dd-extension version 24`);
|
|
537
|
+
}));
|
|
538
|
+
test('should throw error if it is running on arm64 with an old dd-extension version', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
539
|
+
process.env[constants_2.CI_KMS_API_KEY_ENV_VAR] = '5678';
|
|
540
|
+
const curSettings = Object.assign(Object.assign({}, settings), { extensionVersion: 23 });
|
|
541
|
+
let error;
|
|
542
|
+
try {
|
|
543
|
+
yield (0, instrument_1.calculateUpdateRequest)(dotNetConfigOnArm86, curSettings, region, dotnetRuntime);
|
|
544
|
+
}
|
|
545
|
+
catch (e) {
|
|
546
|
+
if (e instanceof Error) {
|
|
547
|
+
error = e;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
expect(error === null || error === void 0 ? void 0 : error.message).toBe('Instrumenting arm64 architecture is not supported for the given dd-extension version. Please choose the latest dd-extension version or use x86_64 architecture.');
|
|
551
|
+
}));
|
|
552
|
+
const baseVariables = {
|
|
553
|
+
DD_KMS_API_KEY: '5678',
|
|
554
|
+
DD_MERGE_XRAY_TRACES: 'false',
|
|
555
|
+
DD_SITE: 'datadoghq.com',
|
|
556
|
+
DD_TRACE_ENABLED: 'false',
|
|
557
|
+
};
|
|
558
|
+
const compatibleTracerAndExtension = {
|
|
559
|
+
Environment: {
|
|
560
|
+
Variables: Object.assign(Object.assign({}, baseVariables), { AWS_LAMBDA_EXEC_WRAPPER: '/opt/datadog_wrapper' }),
|
|
561
|
+
},
|
|
562
|
+
FunctionName: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
563
|
+
Layers: [
|
|
564
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:Datadog-Extension:25',
|
|
565
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:dd-trace-dotnet:4',
|
|
566
|
+
],
|
|
567
|
+
};
|
|
568
|
+
const oldExtensionVersion = {
|
|
569
|
+
Environment: {
|
|
570
|
+
Variables: Object.assign(Object.assign({}, baseVariables), { CORECLR_ENABLE_PROFILING: '1', CORECLR_PROFILER: '{846F5F1C-F9AE-4B07-969E-05C26BC060D8}', CORECLR_PROFILER_PATH: '/opt/datadog/Datadog.Trace.ClrProfiler.Native.so', DD_DOTNET_TRACER_HOME: '/opt/datadog' }),
|
|
571
|
+
},
|
|
572
|
+
FunctionName: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
573
|
+
Layers: [
|
|
574
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:Datadog-Extension:23',
|
|
575
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:dd-trace-dotnet:2',
|
|
576
|
+
],
|
|
577
|
+
};
|
|
578
|
+
const traceUndefined = {
|
|
579
|
+
Environment: {
|
|
580
|
+
Variables: Object.assign(Object.assign({}, baseVariables), { CORECLR_ENABLE_PROFILING: '1', CORECLR_PROFILER: '{846F5F1C-F9AE-4B07-969E-05C26BC060D8}', CORECLR_PROFILER_PATH: '/opt/datadog/Datadog.Trace.ClrProfiler.Native.so', DD_DOTNET_TRACER_HOME: '/opt/datadog' }),
|
|
581
|
+
},
|
|
582
|
+
FunctionName: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
583
|
+
Layers: ['arn:aws:lambda:us-east-1:123456789012:layer:Datadog-Extension:15'],
|
|
584
|
+
};
|
|
585
|
+
test.each `
|
|
586
|
+
extensionVersion | traceVersion | outputResult
|
|
587
|
+
${25} | ${4} | ${compatibleTracerAndExtension}
|
|
588
|
+
${23} | ${2} | ${oldExtensionVersion}
|
|
589
|
+
${15} | ${undefined} | ${traceUndefined}
|
|
590
|
+
`('should the output match the expected if extensionVersion=$extensionVersion and traceVersion=$traceVersion', ({ extensionVersion, traceVersion, outputResult }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
591
|
+
const curSettings = Object.assign(Object.assign({}, settings), { extensionVersion, layerVersion: traceVersion });
|
|
592
|
+
process.env[constants_2.CI_KMS_API_KEY_ENV_VAR] = '5678';
|
|
593
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(dotNetConfig, curSettings, region, dotnetRuntime);
|
|
594
|
+
expect(updateRequest).toEqual(outputResult);
|
|
595
|
+
}));
|
|
596
|
+
});
|
|
597
|
+
describe(`test for runtime ${javaRuntime}`, () => {
|
|
598
|
+
const javaConfig = Object.assign(Object.assign({}, config), { Runtime: javaRuntime });
|
|
599
|
+
test('should throw error when the extension version and trace version are not compatible', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
600
|
+
process.env[constants_2.CI_KMS_API_KEY_ENV_VAR] = '5678';
|
|
601
|
+
const badSettings = Object.assign(Object.assign({}, settings), { extensionVersion: 24, layerVersion: 4 });
|
|
602
|
+
let error;
|
|
603
|
+
try {
|
|
604
|
+
yield (0, instrument_1.calculateUpdateRequest)(javaConfig, badSettings, region, javaRuntime);
|
|
605
|
+
}
|
|
606
|
+
catch (e) {
|
|
607
|
+
if (e instanceof Error) {
|
|
608
|
+
error = e;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
expect(error === null || error === void 0 ? void 0 : error.message).toBe(`For the ${javaRuntime} runtime, the dd-trace version 4 is not compatible with the dd-extension version 24`);
|
|
612
|
+
}));
|
|
613
|
+
const baseVariables = {
|
|
614
|
+
DD_KMS_API_KEY: '5678',
|
|
615
|
+
DD_MERGE_XRAY_TRACES: 'false',
|
|
616
|
+
DD_SITE: 'datadoghq.com',
|
|
617
|
+
DD_TRACE_ENABLED: 'false',
|
|
618
|
+
};
|
|
619
|
+
const compatibleTracerAndExtension = {
|
|
620
|
+
Environment: {
|
|
621
|
+
Variables: Object.assign(Object.assign({}, baseVariables), { AWS_LAMBDA_EXEC_WRAPPER: '/opt/datadog_wrapper' }),
|
|
622
|
+
},
|
|
623
|
+
FunctionName: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
624
|
+
Layers: [
|
|
625
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:Datadog-Extension:25',
|
|
626
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:dd-trace-java:5',
|
|
627
|
+
],
|
|
628
|
+
};
|
|
629
|
+
const oldExtensionVersion = {
|
|
630
|
+
Environment: {
|
|
631
|
+
Variables: Object.assign({}, baseVariables),
|
|
632
|
+
},
|
|
633
|
+
FunctionName: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
634
|
+
Layers: [
|
|
635
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:Datadog-Extension:23',
|
|
636
|
+
'arn:aws:lambda:us-east-1:123456789012:layer:dd-trace-java:2',
|
|
637
|
+
],
|
|
638
|
+
};
|
|
639
|
+
const traceUndefined = {
|
|
640
|
+
Environment: {
|
|
641
|
+
Variables: Object.assign({}, baseVariables),
|
|
642
|
+
},
|
|
643
|
+
FunctionName: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
644
|
+
Layers: ['arn:aws:lambda:us-east-1:123456789012:layer:Datadog-Extension:15'],
|
|
645
|
+
};
|
|
646
|
+
test.each `
|
|
647
|
+
extensionVersion | traceVersion | outputResult
|
|
648
|
+
${25} | ${5} | ${compatibleTracerAndExtension}
|
|
649
|
+
${23} | ${2} | ${oldExtensionVersion}
|
|
650
|
+
${15} | ${undefined} | ${traceUndefined}
|
|
651
|
+
`('should the output match the expected if extensionVersion=$extensionVersion and traceVersion=$traceVersion', ({ extensionVersion, traceVersion, outputResult }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
652
|
+
const curSettings = Object.assign(Object.assign({}, settings), { extensionVersion, layerVersion: traceVersion });
|
|
653
|
+
process.env[constants_2.CI_KMS_API_KEY_ENV_VAR] = '5678';
|
|
654
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(javaConfig, curSettings, region, javaRuntime);
|
|
655
|
+
expect(updateRequest).toEqual(outputResult);
|
|
656
|
+
}));
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
describe('sets handlers correctly', () => {
|
|
660
|
+
const lambdaClientMock = (0, aws_sdk_client_mock_1.mockClient)(client_lambda_1.LambdaClient);
|
|
661
|
+
describe('interactive mode', () => {
|
|
662
|
+
const extensionLayer = `arn:aws:lambda:us-east-1:${constants_2.DEFAULT_LAYER_AWS_ACCOUNT}:layer:Datadog-Extension`;
|
|
663
|
+
beforeAll(() => {
|
|
664
|
+
lambdaClientMock.reset();
|
|
665
|
+
process.env = {};
|
|
666
|
+
(0, fixtures_2.mockLambdaClientCommands)(lambdaClientMock);
|
|
667
|
+
});
|
|
668
|
+
afterAll(() => {
|
|
669
|
+
process.env = OLD_ENV;
|
|
670
|
+
});
|
|
671
|
+
it.each([
|
|
672
|
+
[
|
|
673
|
+
'python',
|
|
674
|
+
{
|
|
675
|
+
runtime: client_lambda_1.Runtime.python311,
|
|
676
|
+
layer: 'Datadog-Python311',
|
|
677
|
+
},
|
|
678
|
+
'datadog_lambda.handler.handler',
|
|
679
|
+
],
|
|
680
|
+
[
|
|
681
|
+
'node',
|
|
682
|
+
{
|
|
683
|
+
runtime: client_lambda_1.Runtime.nodejs16x,
|
|
684
|
+
layer: 'Datadog-Node16-x',
|
|
685
|
+
},
|
|
686
|
+
'/opt/nodejs/node_modules/datadog-lambda-js/handler.handler',
|
|
687
|
+
],
|
|
688
|
+
])('%s', (_, test, expected) => __awaiter(void 0, void 0, void 0, function* () {
|
|
689
|
+
process.env[constants_1.CI_API_KEY_ENV_VAR] = fixtures_1.MOCK_DATADOG_API_KEY;
|
|
690
|
+
const libraryLayer = `arn:aws:lambda:us-east-1:${constants_2.DEFAULT_LAYER_AWS_ACCOUNT}:layer:${test.layer}`;
|
|
691
|
+
// Mock Layers for interactive mode.
|
|
692
|
+
(0, fixtures_2.mockLambdaLayers)(lambdaClientMock, {
|
|
693
|
+
[`${libraryLayer}:1`]: {
|
|
694
|
+
LayerName: `${libraryLayer}`,
|
|
695
|
+
VersionNumber: 1,
|
|
696
|
+
},
|
|
697
|
+
[`${extensionLayer}:1`]: {
|
|
698
|
+
LayerName: `${extensionLayer}`,
|
|
699
|
+
VersionNumber: 1,
|
|
700
|
+
},
|
|
701
|
+
});
|
|
702
|
+
const config = {
|
|
703
|
+
FunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:lambda-hello-world',
|
|
704
|
+
Handler: 'index.handler',
|
|
705
|
+
Layers: [],
|
|
706
|
+
Runtime: test.runtime,
|
|
707
|
+
};
|
|
708
|
+
const settings = {
|
|
709
|
+
flushMetricsToLogs: false,
|
|
710
|
+
interactive: true,
|
|
711
|
+
mergeXrayTraces: false,
|
|
712
|
+
tracingEnabled: false,
|
|
713
|
+
};
|
|
714
|
+
const updateRequest = yield (0, instrument_1.calculateUpdateRequest)(config, settings, 'us-east-1', test.runtime);
|
|
715
|
+
expect(updateRequest === null || updateRequest === void 0 ? void 0 : updateRequest.Handler).toBe(expected);
|
|
716
|
+
}));
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
});
|
|
720
|
+
});
|
|
721
|
+
//# sourceMappingURL=instrument.part2.test.js.map
|