dd-trace 5.110.0 → 5.112.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/LICENSE-3rdparty.csv +1 -2
- package/README.md +13 -8
- package/ci/init.js +21 -2
- package/ci/vitest-no-worker-init-setup.mjs +430 -0
- package/ext/tags.js +2 -0
- package/index.d.ts +34 -1
- package/initialize.mjs +5 -6
- package/loader-hook.mjs +76 -55
- package/package.json +37 -34
- package/packages/datadog-instrumentations/src/ai.js +45 -0
- package/packages/datadog-instrumentations/src/apollo-server.js +5 -13
- package/packages/datadog-instrumentations/src/child_process.js +3 -3
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +587 -0
- package/packages/datadog-instrumentations/src/cucumber.js +102 -43
- package/packages/datadog-instrumentations/src/cypress-config.js +11 -3
- package/packages/datadog-instrumentations/src/fastify.js +27 -8
- package/packages/datadog-instrumentations/src/fs.js +8 -6
- package/packages/datadog-instrumentations/src/graphql.js +26 -495
- package/packages/datadog-instrumentations/src/helpers/hooks.js +1 -0
- package/packages/datadog-instrumentations/src/helpers/instrument.js +7 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/ai.js +6 -6
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/claude-agent-sdk.js +17 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql.js +201 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +2 -0
- package/packages/datadog-instrumentations/src/jest.js +713 -63
- package/packages/datadog-instrumentations/src/mocha/main.js +24 -3
- package/packages/datadog-instrumentations/src/mocha/utils.js +128 -22
- package/packages/datadog-instrumentations/src/mocha/worker.js +13 -0
- package/packages/datadog-instrumentations/src/mongodb.js +74 -0
- package/packages/datadog-instrumentations/src/mongoose.js +13 -2
- package/packages/datadog-instrumentations/src/playwright.js +13 -9
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +1297 -0
- package/packages/datadog-instrumentations/src/vitest-main.js +1594 -0
- package/packages/datadog-instrumentations/src/vitest-util.js +254 -0
- package/packages/datadog-instrumentations/src/vitest-worker.js +823 -0
- package/packages/datadog-instrumentations/src/vitest.js +11 -1855
- package/packages/datadog-plugin-ai/src/index.js +1 -1
- package/packages/datadog-plugin-ai/src/tracing.js +66 -3
- package/packages/datadog-plugin-ai/src/utils.js +17 -4
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/client.js +2 -2
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/context.js +19 -10
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/handler.js +1 -0
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +47 -11
- package/packages/datadog-plugin-child_process/src/index.js +13 -2
- package/packages/datadog-plugin-claude-agent-sdk/src/index.js +31 -0
- package/packages/datadog-plugin-claude-agent-sdk/src/tracing.js +107 -0
- package/packages/datadog-plugin-claude-agent-sdk/src/util.js +15 -0
- package/packages/datadog-plugin-cucumber/src/index.js +15 -24
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +360 -14
- package/packages/datadog-plugin-cypress/src/index.js +47 -2
- package/packages/datadog-plugin-cypress/src/plugin.js +1 -0
- package/packages/datadog-plugin-cypress/src/support.js +45 -1
- package/packages/datadog-plugin-express/src/code_origin.js +1 -1
- package/packages/datadog-plugin-fastify/src/code_origin.js +1 -1
- package/packages/datadog-plugin-graphql/src/execute.js +639 -12
- package/packages/datadog-plugin-graphql/src/index.js +37 -9
- package/packages/datadog-plugin-graphql/src/parse.js +24 -4
- package/packages/datadog-plugin-graphql/src/utils.js +9 -2
- package/packages/datadog-plugin-graphql/src/validate.js +17 -6
- package/packages/datadog-plugin-http/src/index.js +6 -8
- package/packages/datadog-plugin-jest/src/index.js +31 -15
- package/packages/datadog-plugin-mocha/src/index.js +40 -15
- package/packages/datadog-plugin-mongodb-core/src/bulk-write.js +43 -0
- package/packages/datadog-plugin-mongodb-core/src/index.js +8 -443
- package/packages/datadog-plugin-mongodb-core/src/query.js +452 -0
- package/packages/datadog-plugin-openai/src/services.js +2 -2
- package/packages/datadog-plugin-playwright/src/index.js +4 -3
- package/packages/datadog-plugin-vitest/src/index.js +120 -72
- package/packages/datadog-shimmer/src/shimmer.js +37 -16
- package/packages/dd-trace/src/aiguard/index.js +9 -14
- package/packages/dd-trace/src/aiguard/integrations/index.js +34 -0
- package/packages/dd-trace/src/aiguard/integrations/openai.js +47 -33
- package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +42 -28
- package/packages/dd-trace/src/aiguard/sdk.js +2 -2
- package/packages/dd-trace/src/appsec/api_security/sampler.js +3 -3
- package/packages/dd-trace/src/appsec/channels.js +3 -1
- package/packages/dd-trace/src/appsec/downstream_requests.js +4 -4
- package/packages/dd-trace/src/appsec/graphql.js +14 -11
- package/packages/dd-trace/src/appsec/iast/analyzers/nosql-injection-mongodb-analyzer.js +23 -23
- package/packages/dd-trace/src/appsec/iast/security-controls/index.js +2 -2
- package/packages/dd-trace/src/appsec/iast/telemetry/index.js +2 -1
- package/packages/dd-trace/src/appsec/index.js +10 -1
- package/packages/dd-trace/src/appsec/lambda.js +135 -0
- package/packages/dd-trace/src/appsec/reporter.js +49 -10
- package/packages/dd-trace/src/appsec/telemetry/index.js +1 -1
- package/packages/dd-trace/src/appsec/waf/index.js +16 -4
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +4 -4
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/index.js +26 -1
- package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +115 -24
- package/packages/dd-trace/src/ci-visibility/early-flake-detection/get-known-tests.js +21 -6
- package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +5 -2
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +1 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +1 -1
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/index.js +6 -2
- package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +1 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +130 -20
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +2 -2
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/writer.js +17 -0
- package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +47 -26
- package/packages/dd-trace/src/ci-visibility/log-submission/log-submission-plugin.js +2 -2
- package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +64 -53
- package/packages/dd-trace/src/ci-visibility/requests/upload-coverage-report.js +3 -3
- package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +156 -0
- package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +23 -5
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +128 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +287 -0
- package/packages/dd-trace/src/config/defaults.js +3 -2
- package/packages/dd-trace/src/config/generated-config-types.d.ts +71 -57
- package/packages/dd-trace/src/config/helper.js +1 -0
- package/packages/dd-trace/src/config/index.js +35 -22
- package/packages/dd-trace/src/config/major-overrides.js +4 -2
- package/packages/dd-trace/src/config/remote_config.js +1 -1
- package/packages/dd-trace/src/config/supported-configurations.json +127 -56
- package/packages/dd-trace/src/constants.js +7 -0
- package/packages/dd-trace/src/crashtracking/crashtracker.js +2 -2
- package/packages/dd-trace/src/datastreams/processor.js +11 -3
- package/packages/dd-trace/src/exporters/agent/index.js +1 -1
- package/packages/dd-trace/src/exporters/agentless/writer.js +4 -4
- package/packages/dd-trace/src/llmobs/index.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/ai/ddTelemetry.js +403 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/index.js +8 -395
- package/packages/dd-trace/src/llmobs/plugins/ai/util.js +27 -0
- package/packages/dd-trace/src/llmobs/plugins/ai/vercelTelemetry.js +363 -0
- package/packages/dd-trace/src/llmobs/plugins/base.js +4 -4
- package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/index.js +270 -0
- package/packages/dd-trace/src/llmobs/plugins/claude-agent-sdk/utils.js +10 -0
- package/packages/dd-trace/src/llmobs/plugins/langgraph/index.js +1 -1
- package/packages/dd-trace/src/llmobs/sdk.js +3 -3
- package/packages/dd-trace/src/llmobs/span_processor.js +1 -1
- package/packages/dd-trace/src/llmobs/tagger.js +3 -3
- package/packages/dd-trace/src/llmobs/writers/base.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/index.js +54 -5
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +40 -0
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +169 -0
- package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +38 -39
- package/packages/dd-trace/src/opentelemetry/span.js +5 -0
- package/packages/dd-trace/src/opentelemetry/trace/index.js +4 -0
- package/packages/dd-trace/src/opentelemetry/tracer_provider.js +1 -1
- package/packages/dd-trace/src/opentracing/tracer.js +6 -1
- package/packages/dd-trace/src/plugin_manager.js +23 -7
- package/packages/dd-trace/src/plugins/ci_plugin.js +159 -10
- package/packages/dd-trace/src/plugins/index.js +2 -0
- package/packages/dd-trace/src/plugins/util/llm.js +6 -1
- package/packages/dd-trace/src/plugins/util/test.js +15 -9
- package/packages/dd-trace/src/profiling/exporter_cli.js +2 -2
- package/packages/dd-trace/src/profiling/exporters/agent.js +28 -3
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +3 -3
- package/packages/dd-trace/src/profiling/profilers/wall.js +1 -1
- package/packages/dd-trace/src/proxy.js +8 -8
- package/packages/dd-trace/src/span_processor.js +5 -6
- package/packages/dd-trace/src/span_stats.js +96 -78
- package/packages/dd-trace/src/startup-log.js +2 -1
- package/packages/dd-trace/src/telemetry/dependencies.js +1 -1
- package/packages/dd-trace/src/telemetry/endpoints.js +6 -4
- package/packages/dd-trace/src/telemetry/index.js +2 -2
- package/packages/dd-trace/src/telemetry/logs/index.js +1 -1
- package/packages/dd-trace/src/telemetry/send-data.js +8 -8
- package/packages/dd-trace/src/telemetry/session-propagation.js +1 -1
- package/packages/dd-trace/src/telemetry/telemetry.js +9 -9
- package/vendor/dist/@datadog/sketches-js/index.js +1 -1
- package/vendor/dist/protobufjs/index.js +1 -1
- package/vendor/dist/protobufjs/minimal/index.js +1 -1
- package/vendor/dist/shell-quote/index.js +1 -1
- package/packages/datadog-plugin-graphql/src/resolve.js +0 -170
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const log = require('../../dd-trace/src/log')
|
|
4
|
+
const { channel } = require('./helpers/instrument')
|
|
5
|
+
|
|
6
|
+
// test hooks
|
|
7
|
+
const testStartCh = channel('ci:vitest:test:start')
|
|
8
|
+
const testFinishTimeCh = channel('ci:vitest:test:finish-time')
|
|
9
|
+
const testPassCh = channel('ci:vitest:test:pass')
|
|
10
|
+
const testErrorCh = channel('ci:vitest:test:error')
|
|
11
|
+
const testDiWaitCh = channel('ci:vitest:test:di:wait')
|
|
12
|
+
const testSkipCh = channel('ci:vitest:test:skip')
|
|
13
|
+
const testFnCh = channel('ci:vitest:test:fn')
|
|
14
|
+
|
|
15
|
+
// test suite hooks
|
|
16
|
+
const testSuiteStartCh = channel('ci:vitest:test-suite:start')
|
|
17
|
+
const testSuiteFinishCh = channel('ci:vitest:test-suite:finish')
|
|
18
|
+
const testSuiteErrorCh = channel('ci:vitest:test-suite:error')
|
|
19
|
+
|
|
20
|
+
// test session hooks
|
|
21
|
+
const testSessionStartCh = channel('ci:vitest:session:start')
|
|
22
|
+
const testSessionFinishCh = channel('ci:vitest:session:finish')
|
|
23
|
+
const testSessionConfigurationCh = channel('ci:vitest:session:configuration')
|
|
24
|
+
const libraryConfigurationCh = channel('ci:vitest:library-configuration')
|
|
25
|
+
const knownTestsCh = channel('ci:vitest:known-tests')
|
|
26
|
+
const isEarlyFlakeDetectionFaultyCh = channel('ci:vitest:is-early-flake-detection-faulty')
|
|
27
|
+
const testManagementTestsCh = channel('ci:vitest:test-management-tests')
|
|
28
|
+
const modifiedFilesCh = channel('ci:vitest:modified-files')
|
|
29
|
+
|
|
30
|
+
const workerReportTraceCh = channel('ci:vitest:worker-report:trace')
|
|
31
|
+
const workerReportLogsCh = channel('ci:vitest:worker-report:logs')
|
|
32
|
+
const codeCoverageReportCh = channel('ci:vitest:coverage-report')
|
|
33
|
+
|
|
34
|
+
function findExportByName (pkg, name) {
|
|
35
|
+
for (const [key, value] of Object.entries(pkg)) {
|
|
36
|
+
if (value?.name === name) {
|
|
37
|
+
return { key, value }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getChannelPromise (channelToPublishTo, frameworkVersion, payload) {
|
|
43
|
+
return new Promise(resolve => {
|
|
44
|
+
channelToPublishTo.publish({ ...payload, onDone: resolve, frameworkVersion })
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getTestRunnerExport (testPackage) {
|
|
49
|
+
return findExportByName(testPackage, 'VitestTestRunner') || findExportByName(testPackage, 'TestRunner')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getTypeTasks (fileTasks, type = 'test') {
|
|
53
|
+
const typeTasks = []
|
|
54
|
+
|
|
55
|
+
function getTasks (tasks) {
|
|
56
|
+
for (const task of tasks) {
|
|
57
|
+
if (task.type === type) {
|
|
58
|
+
typeTasks.push(task)
|
|
59
|
+
} else if (task.tasks) {
|
|
60
|
+
getTasks(task.tasks)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
getTasks(fileTasks)
|
|
66
|
+
|
|
67
|
+
return typeTasks
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getTestName (task) {
|
|
71
|
+
let testName = task.name
|
|
72
|
+
let currentTask = task.suite
|
|
73
|
+
|
|
74
|
+
while (currentTask) {
|
|
75
|
+
if (currentTask.name) {
|
|
76
|
+
testName = `${currentTask.name} ${testName}`
|
|
77
|
+
}
|
|
78
|
+
currentTask = currentTask.suite
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return testName
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getWorkspaceProject (ctx) {
|
|
85
|
+
return ctx.getCoreWorkspaceProject
|
|
86
|
+
? ctx.getCoreWorkspaceProject()
|
|
87
|
+
: ctx.getRootProject()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function setProvidedContext (ctx, values, warningMessage) {
|
|
91
|
+
try {
|
|
92
|
+
Object.assign(getWorkspaceProject(ctx)._provided, values)
|
|
93
|
+
} catch {
|
|
94
|
+
log.warn(warningMessage)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function getProvidedContext () {
|
|
99
|
+
try {
|
|
100
|
+
const {
|
|
101
|
+
_ddIsEarlyFlakeDetectionEnabled,
|
|
102
|
+
_ddIsDiEnabled,
|
|
103
|
+
_ddTestPropertiesByFilepath: testPropertiesByFilepath,
|
|
104
|
+
_ddEarlyFlakeDetectionNumRetries: numRepeats,
|
|
105
|
+
_ddEarlyFlakeDetectionSlowTestRetries: slowTestRetries,
|
|
106
|
+
_ddIsKnownTestsEnabled: isKnownTestsEnabled,
|
|
107
|
+
_ddIsTestManagementTestsEnabled: isTestManagementTestsEnabled,
|
|
108
|
+
_ddTestManagementAttemptToFixRetries: testManagementAttemptToFixRetries,
|
|
109
|
+
_ddIsFlakyTestRetriesEnabled: isFlakyTestRetriesEnabled,
|
|
110
|
+
_ddFlakyTestRetriesCount: flakyTestRetriesCount,
|
|
111
|
+
_ddFlakyTestRetriesIncludesUnnamedProject: flakyTestRetriesIncludesUnnamedProject,
|
|
112
|
+
_ddFlakyTestRetriesProjectNames: flakyTestRetriesProjectNames,
|
|
113
|
+
_ddIsImpactedTestsEnabled: isImpactedTestsEnabled,
|
|
114
|
+
_ddTestSessionId: testSessionId,
|
|
115
|
+
_ddTestModuleId: testModuleId,
|
|
116
|
+
_ddTestCommand: testCommand,
|
|
117
|
+
_ddRepositoryRoot: repositoryRoot,
|
|
118
|
+
_ddCodeOwnersEntries: codeOwnersEntries,
|
|
119
|
+
_ddTestEnvironmentMetadata: testEnvironmentMetadata,
|
|
120
|
+
} = globalThis.__vitest_worker__.providedContext
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
isDiEnabled: _ddIsDiEnabled,
|
|
124
|
+
isEarlyFlakeDetectionEnabled: _ddIsEarlyFlakeDetectionEnabled,
|
|
125
|
+
testPropertiesByFilepath,
|
|
126
|
+
numRepeats,
|
|
127
|
+
slowTestRetries: slowTestRetries ?? {},
|
|
128
|
+
isKnownTestsEnabled,
|
|
129
|
+
isTestManagementTestsEnabled,
|
|
130
|
+
testManagementAttemptToFixRetries,
|
|
131
|
+
isFlakyTestRetriesEnabled,
|
|
132
|
+
flakyTestRetriesCount: flakyTestRetriesCount ?? 0,
|
|
133
|
+
flakyTestRetriesIncludesUnnamedProject,
|
|
134
|
+
flakyTestRetriesProjectNames,
|
|
135
|
+
isImpactedTestsEnabled,
|
|
136
|
+
testSessionId,
|
|
137
|
+
testModuleId,
|
|
138
|
+
testCommand,
|
|
139
|
+
repositoryRoot,
|
|
140
|
+
codeOwnersEntries,
|
|
141
|
+
testEnvironmentMetadata,
|
|
142
|
+
}
|
|
143
|
+
} catch {
|
|
144
|
+
log.error('Vitest workers could not parse provided context, so some features will not work.')
|
|
145
|
+
return {
|
|
146
|
+
isDiEnabled: false,
|
|
147
|
+
isEarlyFlakeDetectionEnabled: false,
|
|
148
|
+
testPropertiesByFilepath: {},
|
|
149
|
+
numRepeats: 0,
|
|
150
|
+
slowTestRetries: {},
|
|
151
|
+
isKnownTestsEnabled: false,
|
|
152
|
+
isTestManagementTestsEnabled: false,
|
|
153
|
+
testManagementAttemptToFixRetries: 0,
|
|
154
|
+
isFlakyTestRetriesEnabled: false,
|
|
155
|
+
flakyTestRetriesCount: 0,
|
|
156
|
+
flakyTestRetriesIncludesUnnamedProject: false,
|
|
157
|
+
flakyTestRetriesProjectNames: undefined,
|
|
158
|
+
isImpactedTestsEnabled: false,
|
|
159
|
+
testSessionId: undefined,
|
|
160
|
+
testModuleId: undefined,
|
|
161
|
+
testCommand: undefined,
|
|
162
|
+
repositoryRoot: undefined,
|
|
163
|
+
codeOwnersEntries: undefined,
|
|
164
|
+
testEnvironmentMetadata: undefined,
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function isFlakyTestRetriesEnabledForTask (providedContext, task) {
|
|
170
|
+
if (!providedContext.isFlakyTestRetriesEnabled) return false
|
|
171
|
+
|
|
172
|
+
const { flakyTestRetriesProjectNames } = providedContext
|
|
173
|
+
if (!Array.isArray(flakyTestRetriesProjectNames)) return true
|
|
174
|
+
|
|
175
|
+
const projectName = task.file?.projectName
|
|
176
|
+
if (!projectName) {
|
|
177
|
+
return providedContext.flakyTestRetriesIncludesUnnamedProject === true
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return flakyTestRetriesProjectNames.includes(projectName)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Return the main-prepared Test Optimization metadata for a Vitest test.
|
|
185
|
+
*
|
|
186
|
+
* @param {{ testPropertiesByFilepath?: Record<string, {
|
|
187
|
+
* testSuite?: string,
|
|
188
|
+
* knownTests?: string[],
|
|
189
|
+
* testManagementTests?: Record<string, {
|
|
190
|
+
* isAttemptToFix?: boolean,
|
|
191
|
+
* isDisabled?: boolean,
|
|
192
|
+
* isQuarantined?: boolean
|
|
193
|
+
* }>,
|
|
194
|
+
* isModified?: boolean
|
|
195
|
+
* }> }} providedContext
|
|
196
|
+
* @param {string} testSuiteAbsolutePath
|
|
197
|
+
* @param {string} testName
|
|
198
|
+
* @returns {{
|
|
199
|
+
* testSuite?: string,
|
|
200
|
+
* isNew: boolean,
|
|
201
|
+
* isModified: boolean,
|
|
202
|
+
* isAttemptToFix?: boolean,
|
|
203
|
+
* isDisabled?: boolean,
|
|
204
|
+
* isQuarantined?: boolean
|
|
205
|
+
* }}
|
|
206
|
+
*/
|
|
207
|
+
function getVitestTestProperties (providedContext, testSuiteAbsolutePath, testName) {
|
|
208
|
+
const testProperties = providedContext.testPropertiesByFilepath?.[testSuiteAbsolutePath]
|
|
209
|
+
const knownTests = testProperties?.knownTests
|
|
210
|
+
const testManagementProperties = testProperties?.testManagementTests?.[testName] || {}
|
|
211
|
+
|
|
212
|
+
return {
|
|
213
|
+
testSuite: testProperties?.testSuite,
|
|
214
|
+
isNew: Array.isArray(knownTests) ? !knownTests.includes(testName) : false,
|
|
215
|
+
isModified: testProperties?.isModified === true,
|
|
216
|
+
isAttemptToFix: testManagementProperties.isAttemptToFix,
|
|
217
|
+
isDisabled: testManagementProperties.isDisabled,
|
|
218
|
+
isQuarantined: testManagementProperties.isQuarantined,
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
module.exports = {
|
|
223
|
+
testStartCh,
|
|
224
|
+
testFinishTimeCh,
|
|
225
|
+
testPassCh,
|
|
226
|
+
testErrorCh,
|
|
227
|
+
testDiWaitCh,
|
|
228
|
+
testSkipCh,
|
|
229
|
+
testFnCh,
|
|
230
|
+
testSuiteStartCh,
|
|
231
|
+
testSuiteFinishCh,
|
|
232
|
+
testSuiteErrorCh,
|
|
233
|
+
testSessionStartCh,
|
|
234
|
+
testSessionFinishCh,
|
|
235
|
+
testSessionConfigurationCh,
|
|
236
|
+
libraryConfigurationCh,
|
|
237
|
+
knownTestsCh,
|
|
238
|
+
isEarlyFlakeDetectionFaultyCh,
|
|
239
|
+
testManagementTestsCh,
|
|
240
|
+
modifiedFilesCh,
|
|
241
|
+
workerReportTraceCh,
|
|
242
|
+
workerReportLogsCh,
|
|
243
|
+
codeCoverageReportCh,
|
|
244
|
+
findExportByName,
|
|
245
|
+
getChannelPromise,
|
|
246
|
+
getTestRunnerExport,
|
|
247
|
+
getTypeTasks,
|
|
248
|
+
getTestName,
|
|
249
|
+
getWorkspaceProject,
|
|
250
|
+
setProvidedContext,
|
|
251
|
+
getProvidedContext,
|
|
252
|
+
isFlakyTestRetriesEnabledForTask,
|
|
253
|
+
getVitestTestProperties,
|
|
254
|
+
}
|