@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,698 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const fs_1 = __importDefault(require("fs"));
|
|
39
|
+
const fixtures_1 = require("../../../helpers/__tests__/fixtures");
|
|
40
|
+
const ciUtils = __importStar(require("../../../helpers/utils"));
|
|
41
|
+
const api = __importStar(require("../api"));
|
|
42
|
+
const batchUtils = __importStar(require("../batch"));
|
|
43
|
+
const errors_1 = require("../errors");
|
|
44
|
+
const interfaces_1 = require("../interfaces");
|
|
45
|
+
const default_1 = require("../reporters/default");
|
|
46
|
+
const junit_1 = require("../reporters/junit");
|
|
47
|
+
const appUploadReporterModule = __importStar(require("../reporters/mobile/app-upload"));
|
|
48
|
+
const runTests = __importStar(require("../run-tests-lib"));
|
|
49
|
+
const testUtils = __importStar(require("../test"));
|
|
50
|
+
const tunnel_1 = require("../tunnel");
|
|
51
|
+
const internalUtils = __importStar(require("../utils/internal"));
|
|
52
|
+
const utils = __importStar(require("../utils/public"));
|
|
53
|
+
const fixtures_2 = require("./fixtures");
|
|
54
|
+
describe('run-test', () => {
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
jest.restoreAllMocks();
|
|
57
|
+
jest.spyOn(ciUtils, 'getConfig').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({}); }));
|
|
58
|
+
process.env = {};
|
|
59
|
+
});
|
|
60
|
+
describe('executeTests', () => {
|
|
61
|
+
test('should apply config override for tests triggered by public id', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
63
|
+
initialSummary: utils.createInitialSummary(),
|
|
64
|
+
overriddenTestsToTrigger: [],
|
|
65
|
+
tests: [],
|
|
66
|
+
}));
|
|
67
|
+
jest.spyOn(batchUtils, 'runTests').mockImplementation();
|
|
68
|
+
const startUrl = '{{PROTOCOL}}//myhost{{PATHNAME}}{{PARAMS}}';
|
|
69
|
+
const locations = ['location1', 'location2'];
|
|
70
|
+
const userConfigOverride = { locations, startUrl };
|
|
71
|
+
const apiHelper = {};
|
|
72
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({}));
|
|
73
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: userConfigOverride, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'] }))).rejects.toThrow();
|
|
74
|
+
expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
|
|
75
|
+
expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: userConfigOverride }),
|
|
76
|
+
expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: userConfigOverride }),
|
|
77
|
+
]), expect.anything(), false, false, false);
|
|
78
|
+
}));
|
|
79
|
+
test('Use appropriate list of locations for tests triggered by public id', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
81
|
+
initialSummary: utils.createInitialSummary(),
|
|
82
|
+
overriddenTestsToTrigger: [],
|
|
83
|
+
tests: [],
|
|
84
|
+
}));
|
|
85
|
+
const apiHelper = {};
|
|
86
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({}));
|
|
87
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: { locations: ['defaultTestOverrides-location-1'] }, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'] }))).rejects.toThrow(new errors_1.CiError('NO_TESTS_TO_RUN'));
|
|
88
|
+
expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
|
|
89
|
+
expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: { locations: ['defaultTestOverrides-location-1'] } }),
|
|
90
|
+
expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: { locations: ['defaultTestOverrides-location-1'] } }),
|
|
91
|
+
]), expect.anything(), false, false, false);
|
|
92
|
+
}));
|
|
93
|
+
test('should not wait for `skipped` only tests batch results', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
+
const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
95
|
+
initialSummary: utils.createInitialSummary(),
|
|
96
|
+
overriddenTestsToTrigger: [],
|
|
97
|
+
tests: [],
|
|
98
|
+
}));
|
|
99
|
+
const apiHelper = {};
|
|
100
|
+
const configOverride = { executionRule: interfaces_1.ExecutionRule.SKIPPED };
|
|
101
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({}));
|
|
102
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: configOverride, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'] }))).rejects.toThrow(new errors_1.CiError('NO_TESTS_TO_RUN'));
|
|
103
|
+
expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
|
|
104
|
+
expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: configOverride }),
|
|
105
|
+
expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: configOverride }),
|
|
106
|
+
]), expect.anything(), false, false, false);
|
|
107
|
+
}));
|
|
108
|
+
test('should not open tunnel if no test to run', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
|
+
const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
110
|
+
initialSummary: utils.createInitialSummary(),
|
|
111
|
+
overriddenTestsToTrigger: [],
|
|
112
|
+
tests: [],
|
|
113
|
+
}));
|
|
114
|
+
const apiHelper = {
|
|
115
|
+
getTunnelPresignedURL: jest.fn(),
|
|
116
|
+
};
|
|
117
|
+
const configOverride = { executionRule: interfaces_1.ExecutionRule.SKIPPED };
|
|
118
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
119
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: configOverride, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CiError('NO_TESTS_TO_RUN'));
|
|
120
|
+
expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
|
|
121
|
+
expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: configOverride }),
|
|
122
|
+
expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: configOverride }),
|
|
123
|
+
]), expect.anything(), false, false, true);
|
|
124
|
+
expect(apiHelper.getTunnelPresignedURL).not.toHaveBeenCalled();
|
|
125
|
+
}));
|
|
126
|
+
test('open and close tunnel for successful runs', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
127
|
+
jest.spyOn(internalUtils, 'wait').mockImplementation(() => new Promise((res) => setTimeout(res, 10)));
|
|
128
|
+
const startTunnelSpy = jest
|
|
129
|
+
.spyOn(tunnel_1.Tunnel.prototype, 'start')
|
|
130
|
+
.mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({ host: 'host', id: 'id', privateKey: 'key' }); }));
|
|
131
|
+
const stopTunnelSpy = jest.spyOn(tunnel_1.Tunnel.prototype, 'stop');
|
|
132
|
+
jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
133
|
+
initialSummary: utils.createInitialSummary(),
|
|
134
|
+
overriddenTestsToTrigger: [],
|
|
135
|
+
tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: '123-456-789' }],
|
|
136
|
+
}));
|
|
137
|
+
jest.spyOn(batchUtils, 'runTests').mockResolvedValue(fixtures_2.mockTestTriggerResponse);
|
|
138
|
+
const apiHelper = {
|
|
139
|
+
getBatch: () => ({ results: [] }),
|
|
140
|
+
getTunnelPresignedURL: () => ({ url: 'url' }),
|
|
141
|
+
pollResults: () => [(0, fixtures_2.getApiResult)('1', (0, fixtures_2.getApiTest)())],
|
|
142
|
+
triggerTests: () => fixtures_2.mockTestTriggerResponse,
|
|
143
|
+
};
|
|
144
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
145
|
+
yield runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { failOnCriticalErrors: true, publicIds: ['123-456-789'], tunnel: true }));
|
|
146
|
+
expect(startTunnelSpy).toHaveBeenCalledTimes(1);
|
|
147
|
+
expect(stopTunnelSpy).toHaveBeenCalledTimes(1);
|
|
148
|
+
}));
|
|
149
|
+
const cases = [
|
|
150
|
+
[403, 'AUTHORIZATION_ERROR'],
|
|
151
|
+
[502, 'UNAVAILABLE_TEST_CONFIG'],
|
|
152
|
+
];
|
|
153
|
+
describe.each(cases)('%s triggers %s', (status, error) => {
|
|
154
|
+
test(`getTestsList throws - ${status}`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
155
|
+
const apiHelper = {
|
|
156
|
+
searchTests: jest.fn(() => {
|
|
157
|
+
throw (0, fixtures_1.getAxiosError)(status, { message: 'Server Error' });
|
|
158
|
+
}),
|
|
159
|
+
};
|
|
160
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
161
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { testSearchQuery: 'a-search-query', tunnel: true }))).rejects.toThrow(new errors_1.CriticalError(error, 'Server Error'));
|
|
162
|
+
}));
|
|
163
|
+
test(`getTestsToTrigger throws - ${status}`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
164
|
+
const apiHelper = {
|
|
165
|
+
getTest: jest.fn(() => {
|
|
166
|
+
throw (0, fixtures_1.getAxiosError)(status, { errors: ['Bad Gateway'] });
|
|
167
|
+
}),
|
|
168
|
+
};
|
|
169
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
170
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError(error, 'Failed to get test: query on https://app.datadoghq.com/example returned: "Bad Gateway"\n'));
|
|
171
|
+
}));
|
|
172
|
+
});
|
|
173
|
+
test('getTunnelPresignedURL throws', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
174
|
+
jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
175
|
+
initialSummary: utils.createInitialSummary(),
|
|
176
|
+
overriddenTestsToTrigger: [],
|
|
177
|
+
tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'publicId' }],
|
|
178
|
+
}));
|
|
179
|
+
const apiHelper = {
|
|
180
|
+
getTunnelPresignedURL: jest.fn(() => {
|
|
181
|
+
throw (0, fixtures_1.getAxiosError)(502, { message: 'Server Error' });
|
|
182
|
+
}),
|
|
183
|
+
};
|
|
184
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
185
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError('UNAVAILABLE_TUNNEL_CONFIG', 'Server Error'));
|
|
186
|
+
}));
|
|
187
|
+
test('getMobileApplicationPresignedURLs throws', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
188
|
+
const mobileTest = (0, fixtures_2.getMobileTest)();
|
|
189
|
+
jest.spyOn(testUtils, 'getTestAndOverrideConfig').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
190
|
+
return Promise.resolve({
|
|
191
|
+
overriddenConfig: { executionRule: interfaces_1.ExecutionRule.NON_BLOCKING, public_id: mobileTest.public_id },
|
|
192
|
+
test: mobileTest,
|
|
193
|
+
});
|
|
194
|
+
}));
|
|
195
|
+
// use /dev/null to create a valid empty fs.ReadStream
|
|
196
|
+
const testStream = fs_1.default.createReadStream('/dev/null');
|
|
197
|
+
jest.spyOn(fs_1.default, 'createReadStream').mockReturnValue(testStream);
|
|
198
|
+
const { AppUploadReporter } = jest.requireActual('../reporters/mobile/app-upload');
|
|
199
|
+
jest
|
|
200
|
+
.spyOn(appUploadReporterModule, 'AppUploadReporter')
|
|
201
|
+
.mockImplementation(() => new AppUploadReporter({ stdout: { write: jest.fn() } }));
|
|
202
|
+
const apiHelper = {
|
|
203
|
+
getMobileApplicationPresignedURLs: jest.fn(() => {
|
|
204
|
+
throw (0, fixtures_1.getAxiosError)(502, { message: 'Server Error' });
|
|
205
|
+
}),
|
|
206
|
+
};
|
|
207
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
208
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: { mobileApplicationVersionFilePath: 'filePath' }, publicIds: [mobileTest.public_id] }))).rejects.toThrow('Failed to get presigned URL: could not query https://app.datadoghq.com/example');
|
|
209
|
+
}));
|
|
210
|
+
test('uploadMobileApplicationPart throws', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
211
|
+
const mobileTest = (0, fixtures_2.getMobileTest)();
|
|
212
|
+
jest.spyOn(testUtils, 'getTestAndOverrideConfig').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
213
|
+
return Promise.resolve({
|
|
214
|
+
overriddenConfig: { executionRule: interfaces_1.ExecutionRule.NON_BLOCKING, public_id: mobileTest.public_id },
|
|
215
|
+
test: mobileTest,
|
|
216
|
+
});
|
|
217
|
+
}));
|
|
218
|
+
// use /dev/null to create a valid empty fs.ReadStream
|
|
219
|
+
const testStream = fs_1.default.createReadStream('/dev/null');
|
|
220
|
+
jest.spyOn(fs_1.default, 'createReadStream').mockReturnValue(testStream);
|
|
221
|
+
const { AppUploadReporter } = jest.requireActual('../reporters/mobile/app-upload');
|
|
222
|
+
jest
|
|
223
|
+
.spyOn(appUploadReporterModule, 'AppUploadReporter')
|
|
224
|
+
.mockImplementation(() => new AppUploadReporter({ stdout: { write: jest.fn() } }));
|
|
225
|
+
jest.spyOn(fs_1.default.promises, 'readFile').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return Buffer.from('aa'); }));
|
|
226
|
+
const apiHelper = {
|
|
227
|
+
getMobileApplicationPresignedURLs: jest.fn(() => fixtures_2.MOBILE_PRESIGNED_URLS_PAYLOAD),
|
|
228
|
+
uploadMobileApplicationPart: jest.fn(() => {
|
|
229
|
+
throw (0, fixtures_1.getAxiosError)(502, { message: 'Server Error' });
|
|
230
|
+
}),
|
|
231
|
+
};
|
|
232
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
233
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: { mobileApplicationVersionFilePath: 'filePath' }, publicIds: [mobileTest.public_id] }))).rejects.toThrow('Failed to upload mobile application: could not query https://app.datadoghq.com/example');
|
|
234
|
+
}));
|
|
235
|
+
test('runTests throws', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
236
|
+
jest
|
|
237
|
+
.spyOn(tunnel_1.Tunnel.prototype, 'start')
|
|
238
|
+
.mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({ host: 'host', id: 'id', privateKey: 'key' }); }));
|
|
239
|
+
const stopTunnelSpy = jest.spyOn(tunnel_1.Tunnel.prototype, 'stop');
|
|
240
|
+
jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
241
|
+
initialSummary: utils.createInitialSummary(),
|
|
242
|
+
overriddenTestsToTrigger: [],
|
|
243
|
+
tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'publicId' }],
|
|
244
|
+
}));
|
|
245
|
+
const apiHelper = {
|
|
246
|
+
getTunnelPresignedURL: () => ({ url: 'url' }),
|
|
247
|
+
triggerTests: jest.fn(() => {
|
|
248
|
+
throw (0, fixtures_1.getAxiosError)(502, { errors: ['Bad Gateway'] });
|
|
249
|
+
}),
|
|
250
|
+
};
|
|
251
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
252
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError('TRIGGER_TESTS_FAILED', '[] Failed to trigger tests: query on https://app.datadoghq.com/example returned: "Bad Gateway"\n'));
|
|
253
|
+
expect(stopTunnelSpy).toHaveBeenCalledTimes(1);
|
|
254
|
+
}));
|
|
255
|
+
test('waitForResults throws', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
256
|
+
const location = {
|
|
257
|
+
display_name: 'us1',
|
|
258
|
+
id: 1,
|
|
259
|
+
is_active: true,
|
|
260
|
+
name: 'us1',
|
|
261
|
+
region: 'us1',
|
|
262
|
+
};
|
|
263
|
+
jest
|
|
264
|
+
.spyOn(tunnel_1.Tunnel.prototype, 'start')
|
|
265
|
+
.mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({ host: 'host', id: 'id', privateKey: 'key' }); }));
|
|
266
|
+
const stopTunnelSpy = jest.spyOn(tunnel_1.Tunnel.prototype, 'stop');
|
|
267
|
+
jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
268
|
+
initialSummary: utils.createInitialSummary(),
|
|
269
|
+
overriddenTestsToTrigger: [],
|
|
270
|
+
tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'publicId' }],
|
|
271
|
+
}));
|
|
272
|
+
jest.spyOn(batchUtils, 'runTests').mockReturnValue(Promise.resolve({
|
|
273
|
+
batch_id: 'bid',
|
|
274
|
+
locations: [location],
|
|
275
|
+
}));
|
|
276
|
+
const apiHelper = {
|
|
277
|
+
getBatch: () => ({ results: [] }),
|
|
278
|
+
getTunnelPresignedURL: () => ({ url: 'url' }),
|
|
279
|
+
pollResults: jest.fn(() => {
|
|
280
|
+
throw (0, fixtures_1.getAxiosError)(502, { errors: ['Bad Gateway'] });
|
|
281
|
+
}),
|
|
282
|
+
};
|
|
283
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
284
|
+
yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { failOnCriticalErrors: true, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError('POLL_RESULTS_FAILED', 'Failed to poll results: query on https://app.datadoghq.com/example returned: "Bad Gateway"\n'));
|
|
285
|
+
expect(stopTunnelSpy).toHaveBeenCalledTimes(1);
|
|
286
|
+
}));
|
|
287
|
+
test('log when selective rerun is rate-limited', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
288
|
+
jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
289
|
+
initialSummary: utils.createInitialSummary(),
|
|
290
|
+
overriddenTestsToTrigger: [],
|
|
291
|
+
tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'aaa-aaa-aaa' }],
|
|
292
|
+
}));
|
|
293
|
+
jest.spyOn(batchUtils, 'runTests').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
294
|
+
return ({
|
|
295
|
+
batch_id: 'bid',
|
|
296
|
+
locations: [],
|
|
297
|
+
selective_rerun_rate_limited: true,
|
|
298
|
+
});
|
|
299
|
+
}));
|
|
300
|
+
const apiHelper = {
|
|
301
|
+
getBatch: () => ({ results: [] }),
|
|
302
|
+
getTunnelPresignedURL: () => ({ url: 'url' }),
|
|
303
|
+
pollResults: () => [(0, fixtures_2.getApiResult)('1', (0, fixtures_2.getApiTest)())],
|
|
304
|
+
triggerTests: () => fixtures_2.mockTestTriggerResponse,
|
|
305
|
+
};
|
|
306
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
307
|
+
yield runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa'], selectiveRerun: true }));
|
|
308
|
+
expect(fixtures_2.mockReporter.error).toHaveBeenCalledWith('The selective rerun feature was rate-limited. All tests will be re-run.\n\n');
|
|
309
|
+
}));
|
|
310
|
+
test('selective rerun defaults to undefined', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
311
|
+
jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
|
|
312
|
+
initialSummary: utils.createInitialSummary(),
|
|
313
|
+
overriddenTestsToTrigger: [],
|
|
314
|
+
tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'aaa-aaa-aaa' }],
|
|
315
|
+
}));
|
|
316
|
+
const triggerTestsSpy = jest.fn(() => fixtures_2.mockTestTriggerResponse);
|
|
317
|
+
const apiHelper = {
|
|
318
|
+
getBatch: () => ({ results: [] }),
|
|
319
|
+
getTunnelPresignedURL: () => ({ url: 'url' }),
|
|
320
|
+
pollResults: () => [(0, fixtures_2.getApiResult)('1', (0, fixtures_2.getApiTest)())],
|
|
321
|
+
triggerTests: triggerTestsSpy,
|
|
322
|
+
};
|
|
323
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
|
|
324
|
+
yield runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa'] }));
|
|
325
|
+
expect(triggerTestsSpy).toHaveBeenCalledWith({
|
|
326
|
+
tests: [],
|
|
327
|
+
options: {
|
|
328
|
+
batch_timeout: fixtures_2.ciConfig.batchTimeout,
|
|
329
|
+
selective_rerun: undefined,
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
}));
|
|
333
|
+
});
|
|
334
|
+
describe('executeWithDetails', () => {
|
|
335
|
+
beforeEach(() => {
|
|
336
|
+
jest.restoreAllMocks();
|
|
337
|
+
jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({
|
|
338
|
+
getSyntheticsOrgSettings: () => ({
|
|
339
|
+
onDemandConcurrencyCap: 1,
|
|
340
|
+
}),
|
|
341
|
+
}));
|
|
342
|
+
jest.spyOn(runTests, 'executeTests').mockReturnValue(Promise.resolve({ results: [], summary: {} }));
|
|
343
|
+
jest.spyOn(utils, 'renderResults').mockImplementation(jest.fn());
|
|
344
|
+
});
|
|
345
|
+
test('should call executeTests and renderResults', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
346
|
+
yield runTests.executeWithDetails({}, {});
|
|
347
|
+
expect(runTests.executeTests).toHaveBeenCalled();
|
|
348
|
+
expect(utils.renderResults).toHaveBeenCalled();
|
|
349
|
+
}));
|
|
350
|
+
test('should extend config', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
351
|
+
const runConfig = { apiKey: 'apiKey', appKey: 'appKey' };
|
|
352
|
+
yield runTests.executeWithDetails(runConfig, {});
|
|
353
|
+
expect(runTests.executeTests).toHaveBeenCalledWith(expect.anything(), expect.objectContaining(runConfig), undefined);
|
|
354
|
+
}));
|
|
355
|
+
test('should bypass files if suite is passed', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
356
|
+
const suites = [{ content: { tests: [] } }];
|
|
357
|
+
yield runTests.executeWithDetails({}, { suites });
|
|
358
|
+
expect(runTests.executeTests).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({ files: [] }), suites);
|
|
359
|
+
}));
|
|
360
|
+
test('should return values returned by executeTests, and an exitCode', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
361
|
+
const returnValue = yield runTests.executeWithDetails({}, {});
|
|
362
|
+
expect(returnValue.results).toBeDefined();
|
|
363
|
+
expect(returnValue.summary).toBeDefined();
|
|
364
|
+
expect(returnValue.exitCode).toBeDefined();
|
|
365
|
+
}));
|
|
366
|
+
describe('reporters', () => {
|
|
367
|
+
beforeEach(() => {
|
|
368
|
+
jest.spyOn(utils, 'getReporter').mockImplementation(jest.fn());
|
|
369
|
+
});
|
|
370
|
+
test('should use default reporter with empty config', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
371
|
+
yield runTests.executeWithDetails({}, {});
|
|
372
|
+
expect(utils.getReporter).toHaveBeenCalledWith(expect.arrayContaining([expect.any(default_1.DefaultReporter)]));
|
|
373
|
+
}));
|
|
374
|
+
test('should use custom reporters', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
375
|
+
const CustomReporter = {};
|
|
376
|
+
yield runTests.executeWithDetails({}, { reporters: ['junit', CustomReporter] });
|
|
377
|
+
expect(utils.getReporter).toHaveBeenCalledWith(expect.arrayContaining([expect.any(junit_1.JUnitReporter), CustomReporter]));
|
|
378
|
+
}));
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
describe('execute', () => {
|
|
382
|
+
beforeEach(() => {
|
|
383
|
+
jest.restoreAllMocks();
|
|
384
|
+
jest
|
|
385
|
+
.spyOn(runTests, 'executeWithDetails')
|
|
386
|
+
.mockReturnValue(Promise.resolve({ results: [], summary: {}, exitCode: 0 }));
|
|
387
|
+
});
|
|
388
|
+
test('should call executeWithDetails', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
389
|
+
yield runTests.execute({}, {});
|
|
390
|
+
expect(runTests.executeWithDetails).toHaveBeenCalled();
|
|
391
|
+
}));
|
|
392
|
+
test('should return the exitCode returned by executeWithDetails', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
393
|
+
const returnValue = yield runTests.execute({}, {});
|
|
394
|
+
expect(returnValue).toBe(0);
|
|
395
|
+
}));
|
|
396
|
+
});
|
|
397
|
+
describe('getTriggerConfigs', () => {
|
|
398
|
+
beforeEach(() => {
|
|
399
|
+
jest.restoreAllMocks();
|
|
400
|
+
});
|
|
401
|
+
const startUrl = 'fakeUrl';
|
|
402
|
+
const locations = ['aws:ap-northeast-1'];
|
|
403
|
+
const conf1 = {
|
|
404
|
+
tests: [{ testOverrides: { deviceIds: ['chrome.laptop_large'] }, id: 'abc-def-ghi' }],
|
|
405
|
+
};
|
|
406
|
+
const conf2 = {
|
|
407
|
+
tests: [{ testOverrides: { startUrl: 'someOtherFakeUrl' }, id: 'jkl-mno-pqr' }],
|
|
408
|
+
};
|
|
409
|
+
const fakeSuites = [
|
|
410
|
+
{
|
|
411
|
+
content: conf1,
|
|
412
|
+
name: 'Suite 1',
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
content: conf2,
|
|
416
|
+
name: 'Suite 2',
|
|
417
|
+
},
|
|
418
|
+
];
|
|
419
|
+
const fakeApi = {
|
|
420
|
+
searchTests: () => ({
|
|
421
|
+
tests: [
|
|
422
|
+
{
|
|
423
|
+
public_id: 'stu-vwx-yza',
|
|
424
|
+
},
|
|
425
|
+
],
|
|
426
|
+
}),
|
|
427
|
+
};
|
|
428
|
+
test('should extend global config and execute all tests from test config files when no clue what to run', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
429
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
|
|
430
|
+
const defaultTestOverrides = { locations, startUrl };
|
|
431
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
432
|
+
{
|
|
433
|
+
testOverrides: { deviceIds: ['chrome.laptop_large'], startUrl, locations },
|
|
434
|
+
id: 'abc-def-ghi',
|
|
435
|
+
suite: 'Suite 1',
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
testOverrides: { startUrl: 'someOtherFakeUrl', locations },
|
|
439
|
+
id: 'jkl-mno-pqr',
|
|
440
|
+
suite: 'Suite 2',
|
|
441
|
+
},
|
|
442
|
+
]);
|
|
443
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(1);
|
|
444
|
+
expect(getSuitesMock).toHaveBeenCalledWith('{,!(node_modules)/**/}*.synthetics.json', fixtures_2.mockReporter);
|
|
445
|
+
}));
|
|
446
|
+
test('should override and execute only publicIds that were defined in the global config', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
447
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites');
|
|
448
|
+
const defaultTestOverrides = { locations, startUrl };
|
|
449
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, publicIds: ['abc-def-ghi', '123-456-789'] }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
450
|
+
{
|
|
451
|
+
testOverrides: { startUrl, locations },
|
|
452
|
+
id: 'abc-def-ghi',
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
testOverrides: { startUrl, locations },
|
|
456
|
+
id: '123-456-789',
|
|
457
|
+
},
|
|
458
|
+
]);
|
|
459
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(0);
|
|
460
|
+
}));
|
|
461
|
+
test('should override and execute only publicIds that were defined in the global config and use given globs', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
462
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
|
|
463
|
+
const defaultTestOverrides = { locations, startUrl };
|
|
464
|
+
const files = ['glob'];
|
|
465
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides,
|
|
466
|
+
files, publicIds: ['abc-def-ghi'] }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
467
|
+
{
|
|
468
|
+
testOverrides: { startUrl, locations, deviceIds: ['chrome.laptop_large'] },
|
|
469
|
+
id: 'abc-def-ghi',
|
|
470
|
+
suite: 'Suite 1',
|
|
471
|
+
},
|
|
472
|
+
]);
|
|
473
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(1);
|
|
474
|
+
expect(getSuitesMock).toHaveBeenCalledWith('glob', fixtures_2.mockReporter);
|
|
475
|
+
}));
|
|
476
|
+
test('should search tests and extend global config', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
477
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites');
|
|
478
|
+
const defaultTestOverrides = { locations, startUrl };
|
|
479
|
+
const searchQuery = 'fake search';
|
|
480
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, testSearchQuery: searchQuery }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
481
|
+
{
|
|
482
|
+
testOverrides: { locations, startUrl },
|
|
483
|
+
id: 'stu-vwx-yza',
|
|
484
|
+
suite: 'Query: fake search',
|
|
485
|
+
},
|
|
486
|
+
]);
|
|
487
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(0);
|
|
488
|
+
}));
|
|
489
|
+
test('should not use testSearchQuery if global config has defined publicIds', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
490
|
+
const defaultTestOverrides = { startUrl };
|
|
491
|
+
const searchQuery = 'fake search';
|
|
492
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, publicIds: ['abc-def-ghi'], testSearchQuery: searchQuery }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
493
|
+
{
|
|
494
|
+
testOverrides: { startUrl },
|
|
495
|
+
id: 'abc-def-ghi',
|
|
496
|
+
},
|
|
497
|
+
]);
|
|
498
|
+
}));
|
|
499
|
+
test('should search tests with testSearchQuery and use given globs', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
500
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
|
|
501
|
+
const defaultTestOverrides = { startUrl };
|
|
502
|
+
const searchQuery = 'fake search';
|
|
503
|
+
const files = ['glob'];
|
|
504
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides,
|
|
505
|
+
files, testSearchQuery: searchQuery }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
506
|
+
{
|
|
507
|
+
testOverrides: { startUrl },
|
|
508
|
+
id: 'stu-vwx-yza',
|
|
509
|
+
suite: 'Query: fake search',
|
|
510
|
+
},
|
|
511
|
+
]);
|
|
512
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(1);
|
|
513
|
+
expect(getSuitesMock).toHaveBeenCalledWith('glob', fixtures_2.mockReporter);
|
|
514
|
+
}));
|
|
515
|
+
test('should use given globs to get tests list', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
516
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
|
|
517
|
+
const defaultTestOverrides = { startUrl };
|
|
518
|
+
const files = ['new glob', 'another one'];
|
|
519
|
+
yield runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, files }), fixtures_2.mockReporter);
|
|
520
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(2);
|
|
521
|
+
expect(getSuitesMock).toHaveBeenCalledWith('new glob', fixtures_2.mockReporter);
|
|
522
|
+
expect(getSuitesMock).toHaveBeenCalledWith('another one', fixtures_2.mockReporter);
|
|
523
|
+
}));
|
|
524
|
+
test('should return tests from provided suites with overrides', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
525
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites');
|
|
526
|
+
const defaultTestOverrides = { startUrl };
|
|
527
|
+
const files = [];
|
|
528
|
+
const tests = yield runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, files }), fixtures_2.mockReporter, fakeSuites);
|
|
529
|
+
expect(tests).toEqual([
|
|
530
|
+
{
|
|
531
|
+
testOverrides: { deviceIds: ['chrome.laptop_large'], startUrl },
|
|
532
|
+
id: conf1.tests[0].id,
|
|
533
|
+
suite: fakeSuites[0].name,
|
|
534
|
+
},
|
|
535
|
+
{ testOverrides: { startUrl: 'someOtherFakeUrl' }, id: conf2.tests[0].id, suite: fakeSuites[1].name },
|
|
536
|
+
]);
|
|
537
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(0);
|
|
538
|
+
}));
|
|
539
|
+
test('should merge getSuites and user provided suites', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
540
|
+
const userSuites = [fakeSuites[0]];
|
|
541
|
+
const globSuites = [fakeSuites[1]];
|
|
542
|
+
const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(globSuites);
|
|
543
|
+
const defaultTestOverrides = { startUrl };
|
|
544
|
+
const files = ['glob'];
|
|
545
|
+
const tests = yield runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, files }), fixtures_2.mockReporter, userSuites);
|
|
546
|
+
expect(tests).toEqual([
|
|
547
|
+
{
|
|
548
|
+
testOverrides: { deviceIds: ['chrome.laptop_large'], startUrl },
|
|
549
|
+
id: conf1.tests[0].id,
|
|
550
|
+
suite: fakeSuites[0].name,
|
|
551
|
+
},
|
|
552
|
+
{ testOverrides: { startUrl: 'someOtherFakeUrl' }, id: conf2.tests[0].id, suite: fakeSuites[1].name },
|
|
553
|
+
]);
|
|
554
|
+
expect(getSuitesMock).toHaveBeenCalledTimes(1);
|
|
555
|
+
expect(getSuitesMock).toHaveBeenCalledWith('glob', fixtures_2.mockReporter);
|
|
556
|
+
}));
|
|
557
|
+
test('should handle test configurations with the same test ID correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
558
|
+
const suite = {
|
|
559
|
+
name: 'Suite with duplicate IDs',
|
|
560
|
+
content: {
|
|
561
|
+
tests: [
|
|
562
|
+
{
|
|
563
|
+
id: 'abc-abc-abc',
|
|
564
|
+
testOverrides: {
|
|
565
|
+
allowInsecureCertificates: true,
|
|
566
|
+
basicAuth: { username: 'test', password: 'test' },
|
|
567
|
+
body: '{"fakeContent":true}',
|
|
568
|
+
bodyType: 'application/json',
|
|
569
|
+
cookies: 'name1=value1;name2=value2;',
|
|
570
|
+
setCookies: 'name1=value1 \n name2=value2; Secure',
|
|
571
|
+
defaultStepTimeout: 15,
|
|
572
|
+
deviceIds: ['chrome.laptop_large'],
|
|
573
|
+
executionRule: interfaces_1.ExecutionRule.NON_BLOCKING,
|
|
574
|
+
followRedirects: true,
|
|
575
|
+
headers: { NEW_HEADER: 'NEW VALUE' },
|
|
576
|
+
locations: ['aws:us-east-1'],
|
|
577
|
+
mobileApplicationVersion: '01234567-8888-9999-abcd-efffffffffff',
|
|
578
|
+
mobileApplicationVersionFilePath: 'path/to/application.apk',
|
|
579
|
+
retry: { count: 2, interval: 300 },
|
|
580
|
+
testTimeout: 300,
|
|
581
|
+
variables: { MY_VARIABLE: 'new title' },
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
id: 'abc-abc-abc',
|
|
586
|
+
testOverrides: {
|
|
587
|
+
executionRule: interfaces_1.ExecutionRule.SKIPPED,
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
],
|
|
591
|
+
},
|
|
592
|
+
};
|
|
593
|
+
jest.spyOn(utils, 'getSuites').mockResolvedValue([suite]);
|
|
594
|
+
const defaultTestOverrides = { locations: ['aws:us-east-1'], startUrl: 'fakeUrl' };
|
|
595
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
596
|
+
{
|
|
597
|
+
testOverrides: {
|
|
598
|
+
allowInsecureCertificates: true,
|
|
599
|
+
basicAuth: { username: 'test', password: 'test' },
|
|
600
|
+
body: '{"fakeContent":true}',
|
|
601
|
+
bodyType: 'application/json',
|
|
602
|
+
cookies: 'name1=value1;name2=value2;',
|
|
603
|
+
setCookies: 'name1=value1 \n name2=value2; Secure',
|
|
604
|
+
defaultStepTimeout: 15,
|
|
605
|
+
deviceIds: ['chrome.laptop_large'],
|
|
606
|
+
executionRule: 'non_blocking',
|
|
607
|
+
followRedirects: true,
|
|
608
|
+
headers: { NEW_HEADER: 'NEW VALUE' },
|
|
609
|
+
locations: ['aws:us-east-1'],
|
|
610
|
+
mobileApplicationVersion: '01234567-8888-9999-abcd-efffffffffff',
|
|
611
|
+
mobileApplicationVersionFilePath: 'path/to/application.apk',
|
|
612
|
+
retry: { count: 2, interval: 300 },
|
|
613
|
+
testTimeout: 300,
|
|
614
|
+
variables: { MY_VARIABLE: 'new title' },
|
|
615
|
+
startUrl: 'fakeUrl',
|
|
616
|
+
},
|
|
617
|
+
id: 'abc-abc-abc',
|
|
618
|
+
suite: 'Suite with duplicate IDs',
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
testOverrides: {
|
|
622
|
+
executionRule: 'skipped',
|
|
623
|
+
startUrl: 'fakeUrl',
|
|
624
|
+
locations: ['aws:us-east-1'],
|
|
625
|
+
},
|
|
626
|
+
id: 'abc-abc-abc',
|
|
627
|
+
suite: 'Suite with duplicate IDs',
|
|
628
|
+
},
|
|
629
|
+
]);
|
|
630
|
+
}));
|
|
631
|
+
test('should handle local test definitions', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
632
|
+
const localTestDefinition = (0, fixtures_2.getApiTest)('bbb-bbb-bbb');
|
|
633
|
+
const suite = {
|
|
634
|
+
name: 'Suite with local test definitions',
|
|
635
|
+
content: {
|
|
636
|
+
tests: [
|
|
637
|
+
{
|
|
638
|
+
id: 'aaa-aaa-aaa',
|
|
639
|
+
testOverrides: {
|
|
640
|
+
startUrl: 'fakeUrl',
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
localTestDefinition,
|
|
645
|
+
testOverrides: {
|
|
646
|
+
startUrl: 'fakeUrl',
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
],
|
|
650
|
+
},
|
|
651
|
+
};
|
|
652
|
+
jest.spyOn(utils, 'getSuites').mockResolvedValue([suite]);
|
|
653
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, fixtures_2.ciConfig, fixtures_2.mockReporter)).resolves.toEqual([
|
|
654
|
+
{
|
|
655
|
+
id: 'aaa-aaa-aaa',
|
|
656
|
+
suite: 'Suite with local test definitions',
|
|
657
|
+
testOverrides: { startUrl: 'fakeUrl' },
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
localTestDefinition,
|
|
661
|
+
suite: 'Suite with local test definitions',
|
|
662
|
+
testOverrides: { startUrl: 'fakeUrl' },
|
|
663
|
+
},
|
|
664
|
+
]);
|
|
665
|
+
}));
|
|
666
|
+
test('should handle local test definitions selected with publicIds', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
667
|
+
const localTestDefinition = (0, fixtures_2.getApiTest)('bbb-bbb-bbb');
|
|
668
|
+
const suite = {
|
|
669
|
+
name: 'Suite with local test definitions',
|
|
670
|
+
content: {
|
|
671
|
+
tests: [
|
|
672
|
+
{
|
|
673
|
+
id: 'aaa-aaa-aaa',
|
|
674
|
+
testOverrides: {
|
|
675
|
+
startUrl: 'fakeUrl',
|
|
676
|
+
},
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
localTestDefinition,
|
|
680
|
+
testOverrides: {
|
|
681
|
+
startUrl: 'fakeUrl',
|
|
682
|
+
},
|
|
683
|
+
},
|
|
684
|
+
],
|
|
685
|
+
},
|
|
686
|
+
};
|
|
687
|
+
jest.spyOn(utils, 'getSuites').mockResolvedValue([suite]);
|
|
688
|
+
yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { files: ['glob'], publicIds: ['bbb-bbb-bbb'] }), fixtures_2.mockReporter)).resolves.toEqual([
|
|
689
|
+
{
|
|
690
|
+
localTestDefinition,
|
|
691
|
+
suite: 'Suite with local test definitions',
|
|
692
|
+
testOverrides: { startUrl: 'fakeUrl' },
|
|
693
|
+
},
|
|
694
|
+
]);
|
|
695
|
+
}));
|
|
696
|
+
});
|
|
697
|
+
});
|
|
698
|
+
//# sourceMappingURL=run-tests-lib.test.js.map
|