dd-trace 6.16.0 → 6.18.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/ci/diagnose.js +0 -23
- package/ci/test-optimization-validation/approval-artifacts.js +0 -3
- package/ci/test-optimization-validation/approval.js +0 -6
- package/ci/test-optimization-validation/artifact-id.js +0 -1
- package/ci/test-optimization-validation/bounded-json.js +0 -1
- package/ci/test-optimization-validation/cli.js +0 -12
- package/ci/test-optimization-validation/command-output-policy.js +0 -1
- package/ci/test-optimization-validation/command-runner.js +0 -3
- package/ci/test-optimization-validation/environment.js +0 -4
- package/ci/test-optimization-validation/executable-approval.js +0 -1
- package/ci/test-optimization-validation/executable.js +0 -5
- package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -3
- package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -6
- package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -4
- package/ci/test-optimization-validation/generated-test-contract.js +0 -5
- package/ci/test-optimization-validation/generated-verifier.js +0 -1
- package/ci/test-optimization-validation/literal-environment.js +0 -1
- package/ci/test-optimization-validation/manifest-scaffold.js +0 -17
- package/ci/test-optimization-validation/manifest-schema.js +0 -21
- package/ci/test-optimization-validation/offline-fixtures.js +0 -4
- package/ci/test-optimization-validation/plan-writer.js +0 -11
- package/ci/test-optimization-validation/preflight-runner.js +0 -1
- package/ci/test-optimization-validation/redaction.js +0 -4
- package/ci/test-optimization-validation/report-writer.js +0 -16
- package/ci/test-optimization-validation/runner-command.js +0 -3
- package/ci/test-optimization-validation/runner-contract.js +0 -4
- package/ci/test-optimization-validation/safe-files.js +0 -1
- package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -1
- package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -1
- package/ci/test-optimization-validation/source-text.js +0 -3
- package/ci/vitest-no-worker-init-setup.mjs +41 -16
- package/index.d.ts +208 -0
- package/package.json +17 -16
- package/packages/datadog-esbuild/src/utils.js +0 -2
- package/packages/datadog-instrumentations/src/aerospike.js +28 -6
- package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -2
- package/packages/datadog-instrumentations/src/aws-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +0 -2
- package/packages/datadog-instrumentations/src/console.js +97 -0
- package/packages/datadog-instrumentations/src/cucumber.js +77 -12
- package/packages/datadog-instrumentations/src/cypress-config.js +27 -38
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +6 -0
- package/packages/datadog-instrumentations/src/helpers/channel.js +0 -2
- package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +2 -1
- package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/hooks.js +8 -6
- package/packages/datadog-instrumentations/src/helpers/instrumentation-utils.js +0 -3
- package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +0 -6
- package/packages/datadog-instrumentations/src/helpers/register.js +24 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +111 -26
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +41 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +3 -17
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +55 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +36 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/supabase.js +128 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +13 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.js +28 -3
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +20 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +388 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +0 -5
- package/packages/datadog-instrumentations/src/helpers/router-helper.js +0 -1
- package/packages/datadog-instrumentations/src/jest.js +165 -51
- package/packages/datadog-instrumentations/src/knex.js +0 -1
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +0 -24
- package/packages/datadog-instrumentations/src/mariadb.js +0 -2
- package/packages/datadog-instrumentations/src/mocha/common.js +0 -1
- package/packages/datadog-instrumentations/src/mocha/main.js +25 -26
- package/packages/datadog-instrumentations/src/mocha/utils.js +119 -49
- package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +0 -6
- package/packages/datadog-instrumentations/src/mocha/worker.js +14 -17
- package/packages/datadog-instrumentations/src/mysql2.js +0 -2
- package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +241 -0
- package/packages/datadog-instrumentations/src/openai-realtime/events.js +76 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +301 -0
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +998 -0
- package/packages/datadog-instrumentations/src/openai-realtime/turns.js +211 -0
- package/packages/datadog-instrumentations/src/openai.js +51 -12
- package/packages/datadog-instrumentations/src/oracledb.js +9 -3
- package/packages/datadog-instrumentations/src/playwright-reporter.js +6 -20
- package/packages/datadog-instrumentations/src/playwright.js +280 -56
- package/packages/datadog-instrumentations/src/{azure-cosmos.js → postgres.js} +1 -1
- package/packages/datadog-instrumentations/src/router.js +0 -2
- package/packages/datadog-instrumentations/src/rum-browser-scripts.js +0 -2
- package/packages/datadog-instrumentations/src/sequelize.js +0 -1
- package/packages/datadog-instrumentations/src/supabase.js +15 -0
- package/packages/datadog-instrumentations/src/undici.js +7 -3
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +18 -18
- package/packages/datadog-instrumentations/src/vitest-main.js +121 -30
- package/packages/datadog-instrumentations/src/vitest-util.js +7 -1
- package/packages/datadog-instrumentations/src/vitest-worker.js +49 -13
- package/packages/datadog-instrumentations/src/webdriverio.js +44 -47
- package/packages/datadog-instrumentations/src/ws.js +41 -2
- package/packages/datadog-plugin-ai/src/utils.js +0 -2
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +0 -1
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +0 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +0 -1
- package/packages/datadog-plugin-aws-sdk/src/util.js +0 -1
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +0 -1
- package/packages/datadog-plugin-cucumber/src/index.js +9 -0
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +211 -85
- package/packages/datadog-plugin-cypress/src/finalization.js +0 -3
- package/packages/datadog-plugin-cypress/src/index.js +3 -1
- package/packages/datadog-plugin-cypress/src/source-map-utils.js +0 -4
- package/packages/datadog-plugin-cypress/src/support.js +52 -7
- package/packages/datadog-plugin-graphql/src/resolve-error.js +1 -2
- package/packages/datadog-plugin-graphql/src/utils.js +0 -5
- package/packages/datadog-plugin-jest/src/index.js +12 -0
- package/packages/datadog-plugin-kafkajs/src/producer.js +0 -1
- package/packages/datadog-plugin-mocha/src/index.js +38 -11
- package/packages/datadog-plugin-mongodb-core/src/query.js +0 -1
- package/packages/datadog-plugin-openai/src/index.js +16 -1
- package/packages/datadog-plugin-openai/src/realtime.js +144 -0
- package/packages/datadog-plugin-openai-agents/src/integration.js +0 -4
- package/packages/datadog-plugin-openai-agents/src/util.js +0 -1
- package/packages/datadog-plugin-playwright/src/index.js +81 -9
- package/packages/datadog-plugin-postgres/src/index.js +167 -0
- package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +0 -1
- package/packages/datadog-plugin-redis/src/index.js +15 -1
- package/packages/datadog-plugin-supabase/src/error.js +18 -0
- package/packages/datadog-plugin-supabase/src/index.js +21 -0
- package/packages/datadog-plugin-supabase/src/supabase-auth-js-gotrueclient-getuser.js +69 -0
- package/packages/datadog-plugin-supabase/src/supabase-functions-js-functionsclient-invoke.js +70 -0
- package/packages/datadog-plugin-supabase/src/supabase-postgrest-js-postgrestbuilder-then.js +122 -0
- package/packages/datadog-plugin-supabase/src/supabase-realtime-js-realtimechannel-send.js +66 -0
- package/packages/datadog-plugin-supabase/src/supabase-storage-js-handle-request.js +93 -0
- package/packages/datadog-plugin-supabase/src/url.js +17 -0
- package/packages/datadog-plugin-vitest/src/index.js +9 -0
- package/packages/datadog-plugin-ws/src/producer.js +1 -1
- package/packages/datadog-plugin-ws/src/util.js +0 -4
- package/packages/datadog-shimmer/src/shimmer.js +14 -10
- package/packages/datadog-turbopack/index.js +4 -7
- package/packages/datadog-turbopack/src/loader.js +6 -18
- package/packages/datadog-webpack/src/loader.js +0 -1
- package/packages/dd-trace/src/agent/info.js +5 -4
- package/packages/dd-trace/src/aiguard/client.js +2 -3
- package/packages/dd-trace/src/aiguard/evaluation.js +6 -12
- package/packages/dd-trace/src/aiguard/index.js +2 -2
- package/packages/dd-trace/src/aiguard/integrations/index.js +1 -1
- package/packages/dd-trace/src/aiguard/integrations/openai.js +81 -7
- package/packages/dd-trace/src/aiguard/messages/anthropic.js +0 -2
- package/packages/dd-trace/src/aiguard/messages/openai.js +64 -1
- package/packages/dd-trace/src/aiguard/messages/utils.js +0 -1
- package/packages/dd-trace/src/aiguard/redaction.js +0 -1
- package/packages/dd-trace/src/aiguard/sdk.js +1 -1
- package/packages/dd-trace/src/appsec/activation.js +1 -1
- package/packages/dd-trace/src/appsec/api_security/normalized-route.js +0 -5
- package/packages/dd-trace/src/appsec/api_security/sampler.js +0 -4
- package/packages/dd-trace/src/appsec/blocking/index.js +3 -3
- package/packages/dd-trace/src/appsec/downstream_requests.js +1 -4
- package/packages/dd-trace/src/appsec/iast/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/overhead-controller.js +5 -5
- package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +3 -3
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +8 -10
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -2
- package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +4 -1
- package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +7 -7
- package/packages/dd-trace/src/appsec/index.js +2 -2
- package/packages/dd-trace/src/appsec/lambda.js +71 -2
- package/packages/dd-trace/src/appsec/rasp/utils.js +5 -1
- package/packages/dd-trace/src/appsec/remote_config.js +8 -6
- package/packages/dd-trace/src/appsec/reporter.js +10 -6
- package/packages/dd-trace/src/appsec/rule_manager.js +3 -3
- package/packages/dd-trace/src/appsec/sdk/track_event.js +0 -2
- package/packages/dd-trace/src/appsec/waf/index.js +2 -2
- package/packages/dd-trace/src/appsec/waf/waf_manager.js +8 -5
- package/packages/dd-trace/src/carrier.js +0 -5
- package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +104 -0
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +0 -2
- package/packages/dd-trace/src/ci-visibility/efd-retry-policy.js +34 -3
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -4
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -2
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +37 -15
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +0 -3
- package/packages/dd-trace/src/ci-visibility/exporters/request.js +0 -11
- package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +0 -1
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +0 -6
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +2 -2
- package/packages/dd-trace/src/ci-visibility/requests/rate-limit.js +0 -1
- package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +0 -5
- package/packages/dd-trace/src/ci-visibility/requests/video-request.js +0 -1
- package/packages/dd-trace/src/ci-visibility/telemetry.js +13 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +0 -1
- package/packages/dd-trace/src/ci-visibility/test-screenshot.js +0 -2
- package/packages/dd-trace/src/ci-visibility/test-video.js +0 -1
- package/packages/dd-trace/src/config/defaults.js +3 -2
- package/packages/dd-trace/src/config/generated-config-types.d.ts +88 -82
- package/packages/dd-trace/src/config/helper.js +0 -1
- package/packages/dd-trace/src/config/index.js +31 -30
- package/packages/dd-trace/src/config/parsers.js +34 -6
- package/packages/dd-trace/src/config/remote_config.js +25 -109
- package/packages/dd-trace/src/config/supported-configurations.json +150 -10
- package/packages/dd-trace/src/datastreams/encoding.js +0 -1
- package/packages/dd-trace/src/datastreams/pathway.js +0 -1
- package/packages/dd-trace/src/debugger/constants.js +10 -0
- package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +62 -10
- package/packages/dd-trace/src/debugger/devtools_client/config.js +4 -1
- package/packages/dd-trace/src/debugger/devtools_client/guardrail-metrics.js +15 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +103 -27
- package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +50 -7
- package/packages/dd-trace/src/debugger/devtools_client/log.js +3 -1
- package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +21 -8
- package/packages/dd-trace/src/debugger/devtools_client/send.js +41 -15
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +53 -13
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +118 -71
- package/packages/dd-trace/src/debugger/devtools_client/snapshot/redaction.js +5 -3
- package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +0 -3
- package/packages/dd-trace/src/debugger/devtools_client/status.js +21 -7
- package/packages/dd-trace/src/debugger/guardrail-metrics.js +167 -0
- package/packages/dd-trace/src/debugger/index.js +51 -3
- package/packages/dd-trace/src/debugger/inspect-segment.js +0 -3
- package/packages/dd-trace/src/debugger/probe_sampler.js +133 -9
- package/packages/dd-trace/src/debugger/probe_sampler_constants.js +31 -1
- package/packages/dd-trace/src/dogstatsd.js +0 -23
- package/packages/dd-trace/src/encode/0.4-cross-payload.js +0 -3
- package/packages/dd-trace/src/encode/0.4.js +0 -7
- package/packages/dd-trace/src/encode/0.5.js +0 -2
- package/packages/dd-trace/src/encode/tags-processors.js +0 -1
- package/packages/dd-trace/src/evp_proxy/constants.js +2 -0
- package/packages/dd-trace/src/evp_proxy/direct.js +17 -13
- package/packages/dd-trace/src/evp_proxy/discovery.js +14 -11
- package/packages/dd-trace/src/evp_proxy/path.js +21 -9
- package/packages/dd-trace/src/exporters/agent/writer.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/index.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/intake.js +0 -1
- package/packages/dd-trace/src/exporters/agentless/writer.js +0 -3
- package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +0 -6
- package/packages/dd-trace/src/exporters/common/request.js +1 -0
- package/packages/dd-trace/src/exporters/common/url.js +33 -4
- package/packages/dd-trace/src/exporters/common/writer.js +0 -2
- package/packages/dd-trace/src/id.js +0 -11
- package/packages/dd-trace/src/llmobs/audio-codec.js +192 -0
- package/packages/dd-trace/src/llmobs/audio-utils.js +121 -0
- package/packages/dd-trace/src/llmobs/constants/audio.js +35 -0
- package/packages/dd-trace/src/llmobs/constants/prompts.js +14 -0
- package/packages/dd-trace/src/llmobs/constants/tags.js +17 -0
- package/packages/dd-trace/src/llmobs/eval-metric.js +0 -6
- package/packages/dd-trace/src/llmobs/experiments/dataset.js +0 -4
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +0 -3
- package/packages/dd-trace/src/llmobs/experiments/index.js +7 -6
- package/packages/dd-trace/src/llmobs/experiments/util.js +1 -11
- package/packages/dd-trace/src/llmobs/index.js +1 -3
- package/packages/dd-trace/src/llmobs/noop.js +10 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +0 -1
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +0 -4
- package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +0 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +4 -6
- package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +285 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +16 -3
- package/packages/dd-trace/src/llmobs/prompts/cache.js +272 -0
- package/packages/dd-trace/src/llmobs/prompts/manager.js +647 -0
- package/packages/dd-trace/src/llmobs/prompts/noop.js +29 -0
- package/packages/dd-trace/src/llmobs/prompts/prompt.js +158 -0
- package/packages/dd-trace/src/llmobs/sdk.js +21 -6
- package/packages/dd-trace/src/llmobs/span_processor.js +81 -2
- package/packages/dd-trace/src/llmobs/tagger.js +39 -11
- package/packages/dd-trace/src/llmobs/telemetry.js +36 -4
- package/packages/dd-trace/src/llmobs/util.js +0 -34
- package/packages/dd-trace/src/llmobs/writers/base.js +0 -1
- package/packages/dd-trace/src/llmobs/writers/util.js +1 -2
- package/packages/dd-trace/src/log/channels.js +3 -0
- package/packages/dd-trace/src/log/index.js +23 -5
- package/packages/dd-trace/src/log-submission/log-submission-plugin.js +74 -6
- package/packages/dd-trace/src/msgpack/chunk.js +0 -1
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +0 -12
- package/packages/dd-trace/src/openfeature/configuration_source.js +4 -1
- package/packages/dd-trace/src/openfeature/encoding.js +0 -2
- package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/flagging_provider.js +3 -3
- package/packages/dd-trace/src/openfeature/index.js +6 -6
- package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +0 -1
- package/packages/dd-trace/src/openfeature/span-enrichment.js +0 -4
- package/packages/dd-trace/src/openfeature/writers/base.js +90 -23
- package/packages/dd-trace/src/openfeature/writers/exposures.js +4 -5
- package/packages/dd-trace/src/openfeature/writers/util.js +104 -37
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +0 -2
- package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +0 -1
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -14
- package/packages/dd-trace/src/opentelemetry/metrics/time.js +0 -1
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +30 -13
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +0 -1
- package/packages/dd-trace/src/opentelemetry/span-helpers.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +0 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +0 -3
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +0 -6
- package/packages/dd-trace/src/opentracing/span_context.js +0 -1
- package/packages/dd-trace/src/opentracing/tracer.js +3 -3
- package/packages/dd-trace/src/otel-thread-ctx.js +38 -11
- package/packages/dd-trace/src/payload-tagging/tagging.js +15 -3
- package/packages/dd-trace/src/plugin_manager.js +27 -8
- package/packages/dd-trace/src/plugins/ci_plugin.js +1 -2
- package/packages/dd-trace/src/plugins/database.js +2 -6
- package/packages/dd-trace/src/plugins/index.js +7 -0
- package/packages/dd-trace/src/plugins/plugin.js +0 -4
- package/packages/dd-trace/src/plugins/tracing.js +1 -1
- package/packages/dd-trace/src/plugins/util/git.js +1 -3
- package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +0 -1
- package/packages/dd-trace/src/plugins/util/llm.js +0 -2
- package/packages/dd-trace/src/plugins/util/status-validator.js +0 -1
- package/packages/dd-trace/src/plugins/util/test.js +26 -20
- package/packages/dd-trace/src/plugins/util/url.js +0 -5
- package/packages/dd-trace/src/priority_sampler.js +0 -6
- package/packages/dd-trace/src/process-tags/index.js +0 -1
- package/packages/dd-trace/src/profiler.js +132 -35
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +0 -1
- package/packages/dd-trace/src/profiling/profiler.js +101 -41
- package/packages/dd-trace/src/profiling/ssi-heuristics.js +29 -15
- package/packages/dd-trace/src/propagation-hash/index.js +0 -1
- package/packages/dd-trace/src/proxy.js +23 -47
- package/packages/dd-trace/src/random_sampler.js +0 -4
- package/packages/dd-trace/src/rate_limiter.js +0 -4
- package/packages/dd-trace/src/remote_config/capabilities.js +1 -9
- package/packages/dd-trace/src/remote_config/index.js +0 -1
- package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +0 -3
- package/packages/dd-trace/src/sampler.js +0 -4
- package/packages/dd-trace/src/sampling_rule.js +0 -7
- package/packages/dd-trace/src/serverless/vercel.js +0 -1
- package/packages/dd-trace/src/serverless.js +0 -1
- package/packages/dd-trace/src/service-naming/index.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/util.js +0 -1
- package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +7 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +5 -0
- package/packages/dd-trace/src/span_processor.js +2 -2
- package/packages/dd-trace/src/span_sampler.js +0 -1
- package/packages/dd-trace/src/standalone/product.js +2 -2
- package/packages/dd-trace/src/standalone/tracesource.js +0 -1
- package/packages/dd-trace/src/startup-log.js +1 -1
- package/packages/dd-trace/src/telemetry/endpoints.js +0 -8
- package/packages/dd-trace/src/telemetry/logs/index.js +16 -5
- package/packages/dd-trace/src/telemetry/logs/log-collector.js +16 -6
- package/packages/dd-trace/src/telemetry/metrics.js +0 -2
- package/packages/dd-trace/src/telemetry/send-data.js +2 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +4 -1
- package/packages/dd-trace/src/tracer.js +5 -4
- package/packages/dd-trace/src/util.js +13 -1
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/packages/datadog-instrumentations/src/bullmq.js +0 -11
- package/packages/datadog-instrumentations/src/langchain.js +0 -7
- package/packages/datadog-instrumentations/src/langgraph.js +0 -7
- package/packages/datadog-instrumentations/src/mercurius.js +0 -11
|
@@ -18,6 +18,9 @@ const {
|
|
|
18
18
|
getEfdRetryCountForDuration,
|
|
19
19
|
hasEfdRetries,
|
|
20
20
|
} = require('../../dd-trace/src/ci-visibility/efd-retry-policy')
|
|
21
|
+
const {
|
|
22
|
+
getDynamicAtrRetryCount,
|
|
23
|
+
} = require('../../dd-trace/src/ci-visibility/dynamic-atr-retries')
|
|
21
24
|
const { FINAL_FLUSH_FALLBACK_DELAY, FINAL_FLUSH_TIMEOUT } =
|
|
22
25
|
require('../../dd-trace/src/ci-visibility/final-flush')
|
|
23
26
|
const {
|
|
@@ -85,6 +88,8 @@ const testFinishCh = channel('ci:jest:test:finish')
|
|
|
85
88
|
const testErrCh = channel('ci:jest:test:err')
|
|
86
89
|
const testFnCh = channel('ci:jest:test:fn')
|
|
87
90
|
const testSuiteHookFnCh = channel('ci:jest:test-suite:hook:fn')
|
|
91
|
+
const consoleLogSubmissionCh = channel('ci:log-submission:console')
|
|
92
|
+
const logSubmissionFlushCh = channel('ci:log-submission:flush')
|
|
88
93
|
|
|
89
94
|
const skippableSuitesCh = channel('ci:jest:test-suite:skippable')
|
|
90
95
|
const libraryConfigurationCh = channel('ci:jest:library-configuration')
|
|
@@ -104,6 +109,10 @@ const CHILD_MESSAGE_CALL = 1
|
|
|
104
109
|
const FLUSH_TIMEOUT = FINAL_FLUSH_TIMEOUT + FINAL_FLUSH_FALLBACK_DELAY + 5000
|
|
105
110
|
const JEST_SESSION_STATE = Symbol.for('dd-trace:jest:session')
|
|
106
111
|
const JEST_BAIL_REPORTER_PATH = require.resolve('./jest/bail-reporter')
|
|
112
|
+
const JEST_CIRCUS_TEST_RUNNER_PATH = /(?:^|[\\/])jest-circus(?:[\\/]|$)/
|
|
113
|
+
const UNSUPPORTED_JEST_TEST_RUNNER_WARNING =
|
|
114
|
+
'dd-trace Test Optimization supports jest-circus; another test runner was detected; ' +
|
|
115
|
+
'suite and test events may be incomplete.'
|
|
107
116
|
const DD_JEST_HANDLE_TEST_EVENT_WRAPPED = Symbol('dd-trace:jest:handle-test-event-wrapped')
|
|
108
117
|
const DD_JEST_HANDLE_TEST_EVENT_DATADOG = Symbol('dd-trace:jest:handle-test-event-datadog')
|
|
109
118
|
const DD_JEST_CONCURRENT_TEST_ORIGINAL = Symbol('dd-trace:jest:concurrent-test-original')
|
|
@@ -171,6 +180,14 @@ const efdExpectedExecutions = new Map()
|
|
|
171
180
|
const efdSlowAbortedTests = new Set()
|
|
172
181
|
// Tests whose first execution determines the duration-based EFD retry count.
|
|
173
182
|
const efdCandidates = new Set()
|
|
183
|
+
// Per-declaration dynamic ATR retry count, retained across attempts of the same Jest test object.
|
|
184
|
+
const dynamicAtrRetryCountByTest = new Map()
|
|
185
|
+
// Jest only accepts a suite-wide retry ceiling. Terminal dynamic failures are
|
|
186
|
+
// temporarily cleared to keep that ceiling from scheduling another retry, then
|
|
187
|
+
// restored before Jest reports the suite result.
|
|
188
|
+
const dynamicAtrFinalErrorsByTest = new Map()
|
|
189
|
+
// Custom environments may prevent extensions after their base constructor runs.
|
|
190
|
+
const dynamicAtrResultHandlerRegistrations = new WeakMap()
|
|
174
191
|
// Tests that are genuinely new (not in known tests list).
|
|
175
192
|
const newTests = new Set()
|
|
176
193
|
const testSuiteJestObjects = new Map()
|
|
@@ -235,6 +252,7 @@ const MINIMUM_JEST_TEST_SCHEDULER_VERSION = DD_MAJOR >= 6 ? '>=28.0.0' : '>=27.0
|
|
|
235
252
|
const MINIMUM_JEST_COVERAGE_BACKFILL_VERSION = '>=28.0.0'
|
|
236
253
|
const atrSuppressedErrors = new Map()
|
|
237
254
|
let hasWarnedDeprecatedJestVersion = false
|
|
255
|
+
let hasWarnedUnsupportedJestTestRunner = false
|
|
238
256
|
let isJestCoverageBackfillSupported = false
|
|
239
257
|
let hasFinishedTestSession = false
|
|
240
258
|
let jestEachBind
|
|
@@ -256,7 +274,6 @@ function getJestRepositoryRoot (readConfigsResult) {
|
|
|
256
274
|
* Returns true if the data was sent (worker mode), false if in main process (runInBand).
|
|
257
275
|
*
|
|
258
276
|
* @param {string[]} testNames
|
|
259
|
-
* @returns {boolean}
|
|
260
277
|
*/
|
|
261
278
|
function sendQuarantineInfoToMainProcess (testNames) {
|
|
262
279
|
const payload = [JEST_WORKER_QUARANTINE_PAYLOAD_CODE, JSON.stringify(testNames)]
|
|
@@ -310,6 +327,20 @@ function warnDeprecatedJestVersion (frameworkVersion) {
|
|
|
310
327
|
)
|
|
311
328
|
}
|
|
312
329
|
|
|
330
|
+
/** @param {object[]} configs resolved Jest project configurations */
|
|
331
|
+
function warnIfUnsupportedJestTestRunner (configs) {
|
|
332
|
+
if (hasWarnedUnsupportedJestTestRunner || !testSessionConfigurationCh.hasSubscribers) return
|
|
333
|
+
|
|
334
|
+
const usesUnsupportedTestRunner = getEnvironmentVariable('JEST_JASMINE') === '1' ||
|
|
335
|
+
configs.some(config => !JEST_CIRCUS_TEST_RUNNER_PATH.test(config.testRunner))
|
|
336
|
+
|
|
337
|
+
if (usesUnsupportedTestRunner) {
|
|
338
|
+
hasWarnedUnsupportedJestTestRunner = true
|
|
339
|
+
// eslint-disable-next-line no-console
|
|
340
|
+
console.warn(UNSUPPORTED_JEST_TEST_RUNNER_WARNING)
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
313
344
|
function getTestEnvironmentOptions (config) {
|
|
314
345
|
if (config.projectConfig && config.projectConfig.testEnvironmentOptions) { // newer versions
|
|
315
346
|
return config.projectConfig.testEnvironmentOptions
|
|
@@ -342,7 +373,6 @@ function getTestStats (testStatuses) {
|
|
|
342
373
|
* totalCount: number,
|
|
343
374
|
* efdFailureCount: number
|
|
344
375
|
* } | undefined} ignoredFailures
|
|
345
|
-
* @returns {string}
|
|
346
376
|
*/
|
|
347
377
|
function formatIgnoredFailuresSummary (ignoredFailures) {
|
|
348
378
|
if (!ignoredFailures?.efdFailureCount) return ''
|
|
@@ -515,7 +545,6 @@ function getOriginalConcurrentTest (concurrentTest) {
|
|
|
515
545
|
*
|
|
516
546
|
* @param {(...args: unknown[]) => unknown} wrappedConcurrentTest
|
|
517
547
|
* @param {(...args: unknown[]) => unknown} originalConcurrentTest
|
|
518
|
-
* @returns {void}
|
|
519
548
|
*/
|
|
520
549
|
function setOriginalConcurrentTest (wrappedConcurrentTest, originalConcurrentTest) {
|
|
521
550
|
Object.defineProperty(wrappedConcurrentTest, DD_JEST_CONCURRENT_TEST_ORIGINAL, {
|
|
@@ -524,6 +553,31 @@ function setOriginalConcurrentTest (wrappedConcurrentTest, originalConcurrentTes
|
|
|
524
553
|
})
|
|
525
554
|
}
|
|
526
555
|
|
|
556
|
+
/**
|
|
557
|
+
* Stops further retries only after Jest's test-result handlers have observed the failure.
|
|
558
|
+
*
|
|
559
|
+
* @param {{ name: string, test?: { errors: unknown[] } }} event
|
|
560
|
+
*/
|
|
561
|
+
function suppressDynamicAtrErrors (event) {
|
|
562
|
+
if (event.name === 'test_done' && dynamicAtrFinalErrorsByTest.has(event.test)) {
|
|
563
|
+
event.test.errors = []
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Restores terminal failures before custom environments inspect the completed describe block.
|
|
569
|
+
*
|
|
570
|
+
* @param {{ name: string }} event
|
|
571
|
+
*/
|
|
572
|
+
function restoreDynamicAtrErrors (event) {
|
|
573
|
+
if (event.name !== 'run_describe_finish' || dynamicAtrFinalErrorsByTest.size === 0) return
|
|
574
|
+
|
|
575
|
+
for (const [test, errors] of dynamicAtrFinalErrorsByTest) {
|
|
576
|
+
test.errors = errors
|
|
577
|
+
}
|
|
578
|
+
dynamicAtrFinalErrorsByTest.clear()
|
|
579
|
+
}
|
|
580
|
+
|
|
527
581
|
/**
|
|
528
582
|
* Wraps a custom Jest environment handler so Datadog still observes events even
|
|
529
583
|
* when the custom environment does not call `super.handleTestEvent`.
|
|
@@ -542,6 +596,7 @@ function getWrappedCustomHandleTestEvent (handleTestEvent, datadogHandleTestEven
|
|
|
542
596
|
}
|
|
543
597
|
|
|
544
598
|
const wrappedHandleTestEvent = function (event, state) {
|
|
599
|
+
restoreDynamicAtrErrors(event)
|
|
545
600
|
const result = handleTestEvent.call(this, event, state)
|
|
546
601
|
const runDatadogHandler = value => {
|
|
547
602
|
if (isDatadogJestEventHandled(event)) return value
|
|
@@ -573,7 +628,6 @@ function getWrappedCustomHandleTestEvent (handleTestEvent, datadogHandleTestEven
|
|
|
573
628
|
* @param {object} test
|
|
574
629
|
* @param {boolean} hasFocusedTests
|
|
575
630
|
* @param {RegExp|undefined} testNamePattern
|
|
576
|
-
* @returns {boolean}
|
|
577
631
|
*/
|
|
578
632
|
function isJestTestSkipped (test, hasFocusedTests, testNamePattern) {
|
|
579
633
|
if (
|
|
@@ -642,11 +696,14 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
642
696
|
this.isEarlyFlakeDetectionEnabled = this.testEnvironmentOptions._ddIsEarlyFlakeDetectionEnabled
|
|
643
697
|
this.isFlakyTestRetriesEnabled = this.testEnvironmentOptions._ddIsFlakyTestRetriesEnabled
|
|
644
698
|
this.flakyTestRetriesCount = this.testEnvironmentOptions._ddFlakyTestRetriesCount
|
|
699
|
+
this.isDynamicAtrEnabled = this.testEnvironmentOptions._ddIsDynamicAtrEnabled
|
|
700
|
+
this.dynamicAtrBuckets = this.testEnvironmentOptions._ddDynamicAtrBuckets
|
|
645
701
|
this.isDiEnabled = this.testEnvironmentOptions._ddIsDiEnabled
|
|
646
702
|
this.isKnownTestsEnabled = this.testEnvironmentOptions._ddIsKnownTestsEnabled
|
|
647
703
|
this.isTestManagementTestsEnabled = this.testEnvironmentOptions._ddIsTestManagementTestsEnabled
|
|
648
704
|
this.isImpactedTestsEnabled = this.testEnvironmentOptions._ddIsImpactedTestsEnabled
|
|
649
705
|
this.hasConcurrentTests = false
|
|
706
|
+
this.concurrentTestState = undefined
|
|
650
707
|
this.concurrentTestContexts = new Map()
|
|
651
708
|
this.concurrentTestStates = new WeakMap()
|
|
652
709
|
this.concurrentTestSourceFns = new WeakMap()
|
|
@@ -678,7 +735,18 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
678
735
|
if (this.isFlakyTestRetriesEnabled) {
|
|
679
736
|
const currentNumRetries = this.global[RETRY_TIMES]
|
|
680
737
|
if (!currentNumRetries) {
|
|
681
|
-
|
|
738
|
+
// When dynamic ATR is enabled, use the max bucket value as the initial count.
|
|
739
|
+
// The actual duration-based count is computed per test after the first attempt.
|
|
740
|
+
if (this.isDynamicAtrEnabled) {
|
|
741
|
+
this.global[RETRY_TIMES] = Math.max(
|
|
742
|
+
1,
|
|
743
|
+
this.dynamicAtrBuckets
|
|
744
|
+
? Math.max(...this.dynamicAtrBuckets)
|
|
745
|
+
: this.#earlyFlakeDetectionRetryPolicy.schedulingRetryCount
|
|
746
|
+
)
|
|
747
|
+
} else {
|
|
748
|
+
this.global[RETRY_TIMES] = this.flakyTestRetriesCount
|
|
749
|
+
}
|
|
682
750
|
}
|
|
683
751
|
}
|
|
684
752
|
|
|
@@ -733,7 +801,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
733
801
|
* Rebuilds serial `test.each` so every generated row function keeps its parameters.
|
|
734
802
|
*
|
|
735
803
|
* @param {Function|undefined} test
|
|
736
|
-
* @returns {void}
|
|
737
804
|
*/
|
|
738
805
|
bindTestEach (test) {
|
|
739
806
|
if (typeof test?.each !== 'function') return
|
|
@@ -782,7 +849,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
782
849
|
* in older Jest versions execute inside their test span context.
|
|
783
850
|
*
|
|
784
851
|
* @param {object} state
|
|
785
|
-
* @returns {void}
|
|
786
852
|
*/
|
|
787
853
|
wrapConcurrentTest (state) {
|
|
788
854
|
this.concurrentTestState = state
|
|
@@ -794,7 +860,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
794
860
|
*
|
|
795
861
|
* @param {Function|undefined} test
|
|
796
862
|
* @param {object} state
|
|
797
|
-
* @returns {void}
|
|
798
863
|
*/
|
|
799
864
|
wrapConcurrentTestGlobals (test, state) {
|
|
800
865
|
if (!state) return
|
|
@@ -814,7 +879,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
814
879
|
* @param {object} target
|
|
815
880
|
* @param {string} methodName
|
|
816
881
|
* @param {object} state
|
|
817
|
-
* @returns {void}
|
|
818
882
|
*/
|
|
819
883
|
wrapConcurrentTestFunction (target, methodName, state) {
|
|
820
884
|
let concurrentTest = target?.[methodName]
|
|
@@ -860,7 +924,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
860
924
|
*
|
|
861
925
|
* @param {Function} concurrentTest
|
|
862
926
|
* @param {boolean} needsEachError
|
|
863
|
-
* @returns {void}
|
|
864
927
|
*/
|
|
865
928
|
bindConcurrentEach (concurrentTest, needsEachError) {
|
|
866
929
|
if (typeof concurrentTest?.each !== 'function') return
|
|
@@ -1000,7 +1063,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1000
1063
|
*
|
|
1001
1064
|
* @param {Error|undefined} asyncError
|
|
1002
1065
|
* @param {Function|undefined} testFn
|
|
1003
|
-
* @returns {boolean}
|
|
1004
1066
|
*/
|
|
1005
1067
|
isTestModified (asyncError, testFn) {
|
|
1006
1068
|
if (!this.isImpactedTestsEnabled || !asyncError || typeof testFn !== 'function') return false
|
|
@@ -1038,7 +1100,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1038
1100
|
*
|
|
1039
1101
|
* @param {string} testName
|
|
1040
1102
|
* @param {object} ctx
|
|
1041
|
-
* @returns {void}
|
|
1042
1103
|
*/
|
|
1043
1104
|
removeConcurrentTestContext (testName, ctx) {
|
|
1044
1105
|
const contexts = this.concurrentTestContexts.get(testName)
|
|
@@ -1058,7 +1119,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1058
1119
|
*
|
|
1059
1120
|
* @param {string} name
|
|
1060
1121
|
* @param {unknown[]} params
|
|
1061
|
-
* @returns {void}
|
|
1062
1122
|
*/
|
|
1063
1123
|
setNameToParams (name, params) {
|
|
1064
1124
|
this.nameToParams[name] = [...params]
|
|
@@ -1069,7 +1129,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1069
1129
|
*
|
|
1070
1130
|
* @param {string} name
|
|
1071
1131
|
* @param {unknown[]|object} params
|
|
1072
|
-
* @returns {void}
|
|
1073
1132
|
*/
|
|
1074
1133
|
appendNameToParams (name, params) {
|
|
1075
1134
|
if (this.nameToParams[name]) {
|
|
@@ -1082,7 +1141,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1082
1141
|
/**
|
|
1083
1142
|
* @param {object} concurrentTestState
|
|
1084
1143
|
* @param {number|undefined} startedAt
|
|
1085
|
-
* @returns {void}
|
|
1086
1144
|
*/
|
|
1087
1145
|
completePre30ConcurrentTest (concurrentTestState, startedAt) {
|
|
1088
1146
|
if (!concurrentTestState.trackEfdCompletion) return
|
|
@@ -1123,12 +1181,10 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1123
1181
|
enqueueDetachedEfdRetry (retryGate, ctx, run) {
|
|
1124
1182
|
/**
|
|
1125
1183
|
* @param {() => void} resolve
|
|
1126
|
-
* @returns {void}
|
|
1127
1184
|
*/
|
|
1128
1185
|
const enqueue = (resolve) => {
|
|
1129
1186
|
/**
|
|
1130
1187
|
* @param {boolean} shouldRun
|
|
1131
|
-
* @returns {void}
|
|
1132
1188
|
*/
|
|
1133
1189
|
const onDecision = (shouldRun) => {
|
|
1134
1190
|
if (!shouldRun) {
|
|
@@ -1147,7 +1203,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1147
1203
|
const retry = { ctx, resolve, start }
|
|
1148
1204
|
/**
|
|
1149
1205
|
* @param {unknown} error
|
|
1150
|
-
* @returns {void}
|
|
1151
1206
|
*/
|
|
1152
1207
|
const onRejected = (error) => {
|
|
1153
1208
|
retry.ctx.detachedEfdRetryError = error
|
|
@@ -1206,9 +1261,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1206
1261
|
})
|
|
1207
1262
|
}
|
|
1208
1263
|
|
|
1209
|
-
/**
|
|
1210
|
-
* @returns {void}
|
|
1211
|
-
*/
|
|
1212
1264
|
drainDetachedEfdRetries () {
|
|
1213
1265
|
const queue = this.#detachedEfdRetryQueue
|
|
1214
1266
|
if (!queue) return
|
|
@@ -1225,7 +1277,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1225
1277
|
|
|
1226
1278
|
/**
|
|
1227
1279
|
* @param {DetachedEfdRetry} retry
|
|
1228
|
-
* @returns {void}
|
|
1229
1280
|
*/
|
|
1230
1281
|
finishDetachedEfdRetry (retry) {
|
|
1231
1282
|
this.#activeDetachedEfdRetries--
|
|
@@ -1238,7 +1289,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1238
1289
|
*
|
|
1239
1290
|
* @param {() => unknown} run
|
|
1240
1291
|
* @param {(error?: Error) => void} done
|
|
1241
|
-
* @returns {void}
|
|
1242
1292
|
*/
|
|
1243
1293
|
runCallbackEfdRetry (run, done) {
|
|
1244
1294
|
let result
|
|
@@ -1324,7 +1374,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1324
1374
|
* `handleTestEvent` without calling `super.handleTestEvent`.
|
|
1325
1375
|
*
|
|
1326
1376
|
* @param {(event: object, state: object) => Promise<void>|void} datadogHandleTestEvent
|
|
1327
|
-
* @returns {void}
|
|
1328
1377
|
*/
|
|
1329
1378
|
wrapCustomHandleTestEvent (datadogHandleTestEvent) {
|
|
1330
1379
|
const descriptor = Object.getOwnPropertyDescriptor(this, 'handleTestEvent')
|
|
@@ -1471,7 +1520,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1471
1520
|
* Registers retry tests while Jest still accepts additions to the test tree.
|
|
1472
1521
|
*
|
|
1473
1522
|
* @param {JestRetryOptions} options
|
|
1474
|
-
* @returns {number}
|
|
1475
1523
|
*/
|
|
1476
1524
|
retryTest ({
|
|
1477
1525
|
concurrentTestState: registeredConcurrentTestState,
|
|
@@ -1557,7 +1605,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1557
1605
|
* `add_test` dispatch, where Jest would report it as a test file error.
|
|
1558
1606
|
*
|
|
1559
1607
|
* @param {JestRetryOptions} retryOptions
|
|
1560
|
-
* @returns {boolean}
|
|
1561
1608
|
*/
|
|
1562
1609
|
registerRetryTests (retryOptions) {
|
|
1563
1610
|
// Jest turns later additions into "Cannot add a test after tests have started running".
|
|
@@ -1606,7 +1653,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1606
1653
|
* @param {string} testName
|
|
1607
1654
|
* @param {object} executedTest The Jest test node that selected the retry count.
|
|
1608
1655
|
* @param {number} [retryCount] Retries to keep. Every retry is dropped when omitted.
|
|
1609
|
-
* @returns {number} Retries left to run.
|
|
1610
1656
|
*/
|
|
1611
1657
|
discardEfdRetries (testName, executedTest, retryCount = 0) {
|
|
1612
1658
|
const siblings = getTestEntries(executedTest.parent)
|
|
@@ -1655,7 +1701,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1655
1701
|
* @param {object} describeBlock
|
|
1656
1702
|
* @param {boolean} hasFocusedTests
|
|
1657
1703
|
* @param {RegExp|undefined} testNamePattern
|
|
1658
|
-
* @returns {number}
|
|
1659
1704
|
*/
|
|
1660
1705
|
markPre30ConcurrentTests (describeBlock, hasFocusedTests, testNamePattern) {
|
|
1661
1706
|
if (describeBlock.mode === 'skip') return 0
|
|
@@ -1687,7 +1732,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1687
1732
|
/**
|
|
1688
1733
|
* @param {object} describeBlock
|
|
1689
1734
|
* @param {object} state
|
|
1690
|
-
* @returns {void}
|
|
1691
1735
|
*/
|
|
1692
1736
|
preparePre30ConcurrentTests (describeBlock, state) {
|
|
1693
1737
|
const testNamePattern = state.testNamePattern
|
|
@@ -1705,7 +1749,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1705
1749
|
|
|
1706
1750
|
/**
|
|
1707
1751
|
* @param {object[]} tests
|
|
1708
|
-
* @returns {void}
|
|
1709
1752
|
*/
|
|
1710
1753
|
orderConcurrentEfdRetries (tests) {
|
|
1711
1754
|
if (!this.#efdRetryGatesByName) return
|
|
@@ -1727,7 +1770,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1727
1770
|
/**
|
|
1728
1771
|
* @param {string} testName
|
|
1729
1772
|
* @param {number} durationMs
|
|
1730
|
-
* @returns {void}
|
|
1731
1773
|
*/
|
|
1732
1774
|
determineEfdRetries (testName, durationMs) {
|
|
1733
1775
|
if (efdDeterminedRetries.has(testName)) return
|
|
@@ -1746,9 +1788,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1746
1788
|
}
|
|
1747
1789
|
}
|
|
1748
1790
|
|
|
1749
|
-
/**
|
|
1750
|
-
* @returns {void}
|
|
1751
|
-
*/
|
|
1752
1791
|
removeDiscardedEfdRetries () {
|
|
1753
1792
|
if (!this.#discardedEfdRetryTests) return
|
|
1754
1793
|
|
|
@@ -1774,7 +1813,6 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1774
1813
|
*
|
|
1775
1814
|
* @param {object} event
|
|
1776
1815
|
* @param {object} state
|
|
1777
|
-
* @returns {void}
|
|
1778
1816
|
*/
|
|
1779
1817
|
handleAddTestEvent (event, state) {
|
|
1780
1818
|
if (event.concurrent) {
|
|
@@ -1879,11 +1917,17 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
1879
1917
|
this.handleAddTestEvent(event, state)
|
|
1880
1918
|
}
|
|
1881
1919
|
|
|
1920
|
+
restoreDynamicAtrErrors(event)
|
|
1921
|
+
|
|
1882
1922
|
if (super.handleTestEvent) {
|
|
1883
1923
|
await super.handleTestEvent(event, state)
|
|
1884
1924
|
}
|
|
1885
1925
|
|
|
1886
|
-
if (event.name === '
|
|
1926
|
+
if (event.name === 'run_start') {
|
|
1927
|
+
const registerResultHandler = dynamicAtrResultHandlerRegistrations.get(this)
|
|
1928
|
+
dynamicAtrResultHandlerRegistrations.delete(this)
|
|
1929
|
+
registerResultHandler?.()
|
|
1930
|
+
} else if (event.name === 'setup') {
|
|
1887
1931
|
this.wrapConcurrentTest(state)
|
|
1888
1932
|
this.bindTestEach(this.global.test)
|
|
1889
1933
|
}
|
|
@@ -2190,7 +2234,24 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2190
2234
|
|
|
2191
2235
|
// ATR: set failedAllTests when all auto test retries were exhausted and every attempt failed
|
|
2192
2236
|
if (this.isFlakyTestRetriesEnabled && !isAttemptToFix && !isEfdRetry) {
|
|
2193
|
-
|
|
2237
|
+
// Dynamic ATR: after the first attempt, compute the duration-based retry budget.
|
|
2238
|
+
if (
|
|
2239
|
+
this.isDynamicAtrEnabled &&
|
|
2240
|
+
event.test?.invocations === 1 &&
|
|
2241
|
+
!dynamicAtrRetryCountByTest.has(event.test)
|
|
2242
|
+
) {
|
|
2243
|
+
const dynamicCount = getDynamicAtrRetryCount(
|
|
2244
|
+
event.test.duration ?? 0,
|
|
2245
|
+
this.#earlyFlakeDetectionRetryPolicy,
|
|
2246
|
+
this.dynamicAtrBuckets
|
|
2247
|
+
)
|
|
2248
|
+
// Jest captures this ceiling when it starts running the describe block.
|
|
2249
|
+
const nativeRetryCount = Math.max(0, Number.parseInt(this.global[RETRY_TIMES], 10) || 0)
|
|
2250
|
+
dynamicAtrRetryCountByTest.set(event.test, Math.min(dynamicCount, nativeRetryCount))
|
|
2251
|
+
}
|
|
2252
|
+
const maxRetries = this.isDynamicAtrEnabled && dynamicAtrRetryCountByTest.has(event.test)
|
|
2253
|
+
? dynamicAtrRetryCountByTest.get(event.test)
|
|
2254
|
+
: (Number(this.global[RETRY_TIMES]) || 0)
|
|
2194
2255
|
if (event.test?.invocations === maxRetries + 1 && status === 'fail') {
|
|
2195
2256
|
failedAllTests = true
|
|
2196
2257
|
}
|
|
@@ -2199,7 +2260,12 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2199
2260
|
const promises = {}
|
|
2200
2261
|
const numRetries = this.global[RETRY_TIMES]
|
|
2201
2262
|
const numTestExecutions = event.test?.invocations
|
|
2202
|
-
|
|
2263
|
+
// Dynamic ATR: use the per-test duration-based count instead of the global flat limit.
|
|
2264
|
+
const dynamicAtrCount = this.isDynamicAtrEnabled && dynamicAtrRetryCountByTest.has(event.test)
|
|
2265
|
+
? dynamicAtrRetryCountByTest.get(event.test)
|
|
2266
|
+
: undefined
|
|
2267
|
+
const effectiveMaxRetries = dynamicAtrCount === undefined ? numRetries : dynamicAtrCount
|
|
2268
|
+
const willBeRetriedByAutoTestRetry = effectiveMaxRetries > 0 && numTestExecutions - 1 < effectiveMaxRetries
|
|
2203
2269
|
const isFailedTestReplayAllowed = !this.hasConcurrentTests
|
|
2204
2270
|
const willBeRetriedByFailedTestReplay = isFailedTestReplayAllowed && willBeRetriedByAutoTestRetry
|
|
2205
2271
|
const mightHitBreakpoint = this.isDiEnabled && isFailedTestReplayAllowed && numTestExecutions >= 2
|
|
@@ -2216,6 +2282,11 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2216
2282
|
}
|
|
2217
2283
|
}
|
|
2218
2284
|
|
|
2285
|
+
// Quarantine must consume terminal failures before we save errors for Jest's final result.
|
|
2286
|
+
if (dynamicAtrCount !== undefined && failedAllTests && event.test.errors?.length) {
|
|
2287
|
+
dynamicAtrFinalErrorsByTest.set(event.test, event.test.errors)
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2219
2290
|
const ctx = testContexts.get(event.test)
|
|
2220
2291
|
if (!ctx) {
|
|
2221
2292
|
log.warn('"ci:jest:test_done": no context found for test "%s"', testName)
|
|
@@ -2241,7 +2312,8 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2241
2312
|
!!ctx.isModified,
|
|
2242
2313
|
isEfdRetry,
|
|
2243
2314
|
isAttemptToFix,
|
|
2244
|
-
numTestExecutions
|
|
2315
|
+
numTestExecutions,
|
|
2316
|
+
dynamicAtrCount)
|
|
2245
2317
|
|
|
2246
2318
|
if (status === 'fail') {
|
|
2247
2319
|
const shouldSetProbe = this.isDiEnabled && willBeRetriedByFailedTestReplay && numTestExecutions === 1
|
|
@@ -2310,6 +2382,7 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2310
2382
|
efdDeterminedRetries.clear()
|
|
2311
2383
|
efdExpectedExecutions.clear()
|
|
2312
2384
|
efdSlowAbortedTests.clear()
|
|
2385
|
+
dynamicAtrRetryCountByTest.clear()
|
|
2313
2386
|
efdCandidates.clear()
|
|
2314
2387
|
newTests.clear()
|
|
2315
2388
|
retriedTestsToNumAttempts.clear()
|
|
@@ -2365,14 +2438,15 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2365
2438
|
return { isEfdEnabled, isEfdActive, isFinalEfdTestExecution, finalStatus }
|
|
2366
2439
|
}
|
|
2367
2440
|
|
|
2368
|
-
getAtrResult ({ status, isEfdRetry, isAttemptToFix, numberOfTestInvocations }) {
|
|
2441
|
+
getAtrResult ({ status, isEfdRetry, isAttemptToFix, numberOfTestInvocations, dynamicAtrRetryCount }) {
|
|
2442
|
+
const maxRetries = dynamicAtrRetryCount ?? Number(this.global[RETRY_TIMES])
|
|
2369
2443
|
const isAtrEnabled =
|
|
2370
2444
|
this.isFlakyTestRetriesEnabled &&
|
|
2371
2445
|
!isEfdRetry &&
|
|
2372
2446
|
!isAttemptToFix &&
|
|
2373
|
-
Number.isFinite(
|
|
2447
|
+
Number.isFinite(maxRetries)
|
|
2374
2448
|
const isLastAtrRetry =
|
|
2375
|
-
status === 'pass' || numberOfTestInvocations >= (
|
|
2449
|
+
status === 'pass' || numberOfTestInvocations >= (maxRetries + 1)
|
|
2376
2450
|
const isFinalAtrTestExecution = isAtrEnabled && isLastAtrRetry
|
|
2377
2451
|
|
|
2378
2452
|
// For ATR: The last execution's status is what the framework reports
|
|
@@ -2404,7 +2478,8 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2404
2478
|
isModifiedTest,
|
|
2405
2479
|
isEfdRetry,
|
|
2406
2480
|
isAttemptToFix,
|
|
2407
|
-
numberOfTestInvocations
|
|
2481
|
+
numberOfTestInvocations,
|
|
2482
|
+
dynamicAtrRetryCount
|
|
2408
2483
|
) {
|
|
2409
2484
|
const numberOfExecutedRetries = retriedTestsToNumAttempts.get(testName) ?? 0
|
|
2410
2485
|
|
|
@@ -2413,7 +2488,13 @@ function getWrappedEnvironment (BaseEnvironment, jestVersion) {
|
|
|
2413
2488
|
isNewTest,
|
|
2414
2489
|
isModifiedTest,
|
|
2415
2490
|
})
|
|
2416
|
-
const atrResult = this.getAtrResult({
|
|
2491
|
+
const atrResult = this.getAtrResult({
|
|
2492
|
+
status,
|
|
2493
|
+
isEfdRetry,
|
|
2494
|
+
isAttemptToFix,
|
|
2495
|
+
numberOfTestInvocations,
|
|
2496
|
+
dynamicAtrRetryCount,
|
|
2497
|
+
})
|
|
2417
2498
|
const attemptToFixResult = this.getAttemptToFixResult({
|
|
2418
2499
|
testName,
|
|
2419
2500
|
isAttemptToFix,
|
|
@@ -2735,7 +2816,10 @@ async function waitForTestSessionFinish (payload) {
|
|
|
2735
2816
|
|
|
2736
2817
|
publishWithCompletion(testSessionFinishCh, payload, onDone)
|
|
2737
2818
|
|
|
2738
|
-
const waitingResult = await Promise.race([
|
|
2819
|
+
const waitingResult = await Promise.race([
|
|
2820
|
+
Promise.all([flushPromise, getChannelPromise(logSubmissionFlushCh)]),
|
|
2821
|
+
timeoutPromise,
|
|
2822
|
+
])
|
|
2739
2823
|
|
|
2740
2824
|
if (waitingResult === 'timeout') {
|
|
2741
2825
|
log.error('Timeout waiting for the tracer to flush')
|
|
@@ -3088,6 +3172,7 @@ function getCliWrapper (isNewJestVersion) {
|
|
|
3088
3172
|
results: {
|
|
3089
3173
|
numFailedTestSuites,
|
|
3090
3174
|
numFailedTests,
|
|
3175
|
+
numPassedTests,
|
|
3091
3176
|
numRuntimeErrorTestSuites = 0,
|
|
3092
3177
|
numTotalTests,
|
|
3093
3178
|
numTotalTestSuites,
|
|
@@ -3258,14 +3343,19 @@ function getCliWrapper (isNewJestVersion) {
|
|
|
3258
3343
|
|
|
3259
3344
|
// Determine session status after EFD and quarantine checks have potentially modified success
|
|
3260
3345
|
let status, error
|
|
3346
|
+
const hasExecutedTests = numPassedTests > 0 || numFailedTests > 0 || numSuppressedQuarantinedTests > 0
|
|
3347
|
+
const testSessionEmptyReason = result.results.success && !hasExecutedTests
|
|
3348
|
+
? (numTotalTests > 0 || isSuitesSkipped ? 'all_tests_skipped' : 'zero_tests')
|
|
3349
|
+
: undefined
|
|
3261
3350
|
if (result.results.success) {
|
|
3262
|
-
status =
|
|
3351
|
+
status = testSessionEmptyReason ? 'skip' : 'pass'
|
|
3263
3352
|
} else {
|
|
3264
3353
|
status = 'fail'
|
|
3265
3354
|
error = new Error(`Failed test suites: ${numFailedTestSuites}. Failed tests: ${numFailedTests}`)
|
|
3266
3355
|
}
|
|
3267
3356
|
|
|
3268
3357
|
await waitForTestSessionFinish(getTestSessionFinishPayload(status, error, {
|
|
3358
|
+
testSessionEmptyReason,
|
|
3269
3359
|
...getTestSessionCoveragePayload(result.results, result.globalConfig?.rootDir),
|
|
3270
3360
|
}))
|
|
3271
3361
|
|
|
@@ -3322,7 +3412,6 @@ function cleanupTestSuiteState (testSuiteAbsolutePath) {
|
|
|
3322
3412
|
* Rechecks custom handlers after Jest has finished constructing the environment.
|
|
3323
3413
|
*
|
|
3324
3414
|
* @param {object} environment
|
|
3325
|
-
* @returns {void}
|
|
3326
3415
|
*/
|
|
3327
3416
|
function wrapEnvironmentCustomHandleTestEvent (environment) {
|
|
3328
3417
|
const datadogHandleTestEvent = environment[DD_JEST_HANDLE_TEST_EVENT_DATADOG]
|
|
@@ -3426,7 +3515,7 @@ addHook({
|
|
|
3426
3515
|
versions: [DD_MAJOR >= 6 ? '>=28.0.0' : '>=26.6.2'],
|
|
3427
3516
|
}, coverageReporterWrapper)
|
|
3428
3517
|
|
|
3429
|
-
function jestAdapterWrapper (jestAdapter, jestVersion) {
|
|
3518
|
+
function jestAdapterWrapper (jestAdapter, jestVersion, isIitm, hookMeta) {
|
|
3430
3519
|
const adapter = jestAdapter.default ?? jestAdapter
|
|
3431
3520
|
const newAdapter = shimmer.wrapFunction(adapter, adapter => function (...args) {
|
|
3432
3521
|
const environment = args[2]
|
|
@@ -3436,6 +3525,18 @@ function jestAdapterWrapper (jestAdapter, jestVersion) {
|
|
|
3436
3525
|
|
|
3437
3526
|
wrapEnvironmentCustomHandleTestEvent(environment)
|
|
3438
3527
|
|
|
3528
|
+
if (environment.isDynamicAtrEnabled && environment.isFlakyTestRetriesEnabled) {
|
|
3529
|
+
// Register at run_start, after Circus installs its per-test reporter and snapshot handlers.
|
|
3530
|
+
dynamicAtrResultHandlerRegistrations.set(environment, () => {
|
|
3531
|
+
if (satisfies(jestVersion, '>=30.0.0')) {
|
|
3532
|
+
environment.global[Symbol.for('EVENT_HANDLERS')].push(suppressDynamicAtrErrors)
|
|
3533
|
+
} else {
|
|
3534
|
+
const circusState = args[3].requireInternalModule(path.join(hookMeta.moduleBaseDir, 'build/state.js'))
|
|
3535
|
+
circusState.addEventHandler(suppressDynamicAtrErrors)
|
|
3536
|
+
}
|
|
3537
|
+
})
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3439
3540
|
testSuiteStartCh.publish({
|
|
3440
3541
|
testSuite: environment.testSuite,
|
|
3441
3542
|
testEnvironmentOptions: environment.testEnvironmentOptions,
|
|
@@ -3547,6 +3648,7 @@ addHook({
|
|
|
3547
3648
|
}, jestAdapterWrapper)
|
|
3548
3649
|
|
|
3549
3650
|
function configureTestEnvironment (readConfigsResult) {
|
|
3651
|
+
warnIfUnsupportedJestTestRunner(readConfigsResult.configs)
|
|
3550
3652
|
repositoryRoot = getJestRepositoryRoot(readConfigsResult)
|
|
3551
3653
|
isUserCodeCoverageEnabled = !!readConfigsResult.globalConfig.collectCoverage
|
|
3552
3654
|
const isCodeCoverageEnabledBecauseOfUs = shouldCollectJestCoverageForTia() && !isUserCodeCoverageEnabled
|
|
@@ -3628,6 +3730,8 @@ const DD_TEST_ENVIRONMENT_OPTION_KEYS = [
|
|
|
3628
3730
|
'_ddTestCodeCoverageEnabled',
|
|
3629
3731
|
'_ddIsFlakyTestRetriesEnabled',
|
|
3630
3732
|
'_ddFlakyTestRetriesCount',
|
|
3733
|
+
'_ddIsDynamicAtrEnabled',
|
|
3734
|
+
'_ddDynamicAtrBuckets',
|
|
3631
3735
|
'_ddItrSkippingEnabledTags',
|
|
3632
3736
|
'_ddIsDiEnabled',
|
|
3633
3737
|
'_ddIsKnownTestsEnabled',
|
|
@@ -3744,6 +3848,19 @@ const JEST_LOGGING_LIBRARIES = new Set([
|
|
|
3744
3848
|
const disabledJestInstrumentations = new Set(
|
|
3745
3849
|
getValueFromEnvSources('DD_TRACE_DISABLED_INSTRUMENTATIONS')?.split(',')
|
|
3746
3850
|
)
|
|
3851
|
+
|
|
3852
|
+
addHook({
|
|
3853
|
+
name: '@jest/console',
|
|
3854
|
+
versions: [MINIMUM_JEST_VERSION],
|
|
3855
|
+
}, jestConsole => {
|
|
3856
|
+
const isConsoleDisabled = disabledJestInstrumentations.has('console') ||
|
|
3857
|
+
disabledJestInstrumentations.has('node:console')
|
|
3858
|
+
if (!isConsoleDisabled && consoleLogSubmissionCh.hasSubscribers) {
|
|
3859
|
+
require('./console').wrapJestConsole(jestConsole)
|
|
3860
|
+
}
|
|
3861
|
+
return jestConsole
|
|
3862
|
+
})
|
|
3863
|
+
|
|
3747
3864
|
const LIBRARIES_BYPASSING_JEST_REQUIRE_ENGINE = new Set([
|
|
3748
3865
|
'selenium-webdriver',
|
|
3749
3866
|
'selenium-webdriver/chrome',
|
|
@@ -3887,7 +4004,6 @@ function requireOutsideJestRequireEngine (runtime, moduleName) {
|
|
|
3887
4004
|
* @param {object} runtime
|
|
3888
4005
|
* @param {string} from
|
|
3889
4006
|
* @param {string} moduleName
|
|
3890
|
-
* @returns {void}
|
|
3891
4007
|
*/
|
|
3892
4008
|
function recordJestEsmLoggingModulePath (runtime, from, moduleName) {
|
|
3893
4009
|
if (
|
|
@@ -3933,7 +4049,6 @@ function getJestEsmLoggingModuleName (runtime, from, modulePath) {
|
|
|
3933
4049
|
|
|
3934
4050
|
/**
|
|
3935
4051
|
* @param {object} runtime
|
|
3936
|
-
* @returns {void}
|
|
3937
4052
|
*/
|
|
3938
4053
|
function wrapJestEsmLoader (runtime) {
|
|
3939
4054
|
const esmLoader = runtime?.esmLoader
|
|
@@ -3994,7 +4109,6 @@ function getJestBypassModulePath (runtime, from, moduleName) {
|
|
|
3994
4109
|
* @param {object} runtime
|
|
3995
4110
|
* @param {string} from
|
|
3996
4111
|
* @param {string} moduleName
|
|
3997
|
-
* @returns {string}
|
|
3998
4112
|
*/
|
|
3999
4113
|
function resolveJestModulePath (runtime, from, moduleName) {
|
|
4000
4114
|
if (path.isAbsolute(moduleName)) return moduleName
|
|
@@ -128,7 +128,6 @@ function wrapCallbackWithFinish (callback, finish, context) {
|
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* @param {{ pool?: { numFree?: () => number, numPendingAcquires?: () => number } }} client
|
|
131
|
-
* @returns {boolean}
|
|
132
131
|
*/
|
|
133
132
|
function knexHasIdleConnection (client) {
|
|
134
133
|
const pool = client.pool
|