@datadog/datadog-ci-plugin-junit 0.0.2 → 5.3.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 CHANGED
@@ -1 +1,89 @@
1
- Empty package
1
+ # jUnit command
2
+
3
+ Upload your jUnit XML files.
4
+
5
+ ## Usage
6
+
7
+ #### Commands
8
+
9
+ ##### `upload`
10
+
11
+ This command will upload your jUnit XML test report to Datadog.
12
+
13
+ ```bash
14
+ datadog-ci junit upload [--service] [--max-concurrency] [--dry-run] [--tags] <paths>
15
+ ```
16
+
17
+ For example:
18
+
19
+ ```bash
20
+ datadog-ci junit upload --service my-service --tags key1:value1 --tags key2:value2 unit-tests/junit-reports acceptance-tests/junit-reports e2e-tests/single-report.xml
21
+ ```
22
+
23
+ - The positional arguments are the directories or file paths in which the jUnit XML reports are located. If you pass a folder, the CLI will look for all `.xml` files in it.
24
+ - `--auto-discovery` (default: `false`) enables recursive search in folders passed as positional arguments, automatically discovering jUnit XML reports with filenames matching `*junit*.xml`, `*test*.xml`, or `*TEST-*.xml`.
25
+ - `--ignored-paths` a comma-separated list of paths that should be excluded from automatic reports discovery (only applicable when `--auto-discovery` is set). Glob patterns are supported
26
+ - `--service` (default: `DD_SERVICE` env var) should be set as the name of the service you're uploading jUnit XML reports for.
27
+ - `--tags` is an array of key value pairs of the shape `key:value`. This will set global tags applied to all spans.
28
+ - The resulting dictionary will be merged with whatever is in the `DD_TAGS` environment variable. If a `key` appears both in `--tags` and `DD_TAGS`, whatever value is in `DD_TAGS` will take precedence.
29
+ - `--measures` is an array of key numerical value pairs of the shape `key:123`. This will set global measures applied to all spans.
30
+ - The resulting dictionary will be merged with whatever is in the `DD_MEASURES` environment variable. If a `key` appears both in `--measures` and `DD_MEASURES`, whatever value is in `DD_MEASURES` will take precedence.
31
+ - `--report-tags` is an array of key value pairs like the `--tags` argument, but the tags are only applied to the session instead of to every test.
32
+ - The resulting dictionary will NOT be merged with `DD_TAGS`.
33
+ - `--report-measures` is an array of key numerical value pairs like the `--measures` argument, but the measures are only applied to the session instead of to every test.
34
+ - The resulting dictionary will NOT be merged with `DD_MEASURES`.
35
+ - `--env` (default: `DD_ENV` env var) is a string that represents the environment where you want your tests to appear in.
36
+ - `--max-concurrency` (default: `20`): number of concurrent uploads to the API.
37
+ - `--dry-run` (default: `false`): it will run the command without the final upload step. All other checks are performed.
38
+ - `--logs` (default: `false`): it will enable collecting logs from the content in the XML reports.
39
+ - `--skip-git-metadata-upload` (default: `false`): Pass this flag if you want to skip uploading git metadata.
40
+ - `--git-repository-url` is a string with the repository URL to retrieve git metadata from. If this is missing, the URL is retrieved from the local git repository.
41
+ - `--verbose` (default: `false`): it will add extra verbosity to the output of the command.
42
+
43
+ #### Environment variables
44
+
45
+ Additionally you might configure the `junit` command with environment variables:
46
+
47
+ - `DD_API_KEY` (**required**): API key used to authenticate the requests.
48
+ - `DD_ENV`: you may choose the environment you want your test results to appear in.
49
+ - `DD_SERVICE`: if you haven't specified a service through `--service` you might do it with this env var.
50
+ - `DD_TAGS`: set global tags applied to all test spans. The format must be `key1:value1,key2:value2`.
51
+ - The resulting dictionary will be merged with whatever is in the `--tags` parameter. If a `key` appears both in `--tags` and `DD_TAGS`, whatever value is in `DD_TAGS` will take precedence.
52
+ - `DD_MEASURES`: set global numerical tags applied to all test spans. The format must be `key1:123,key2:321`.
53
+ - The resulting dictionary will be merged with whatever is in the `--measures` parameter. If a `key` appears both in `--measures` and `DD_MEASURES`, whatever value is in `DD_MEASURES` will take precedence.
54
+ - `DD_SITE`: choose your Datadog site, e.g. datadoghq.com or datadoghq.eu.
55
+ - `DD_CIVISIBILITY_LOGS_ENABLED`: it will enable collecting logs from the content in the XML reports.
56
+ - `DD_SUBDOMAIN`: if you have a [custom sub-domain enabled](https://docs.datadoghq.com/account_management/multi_organization/#custom-sub-domains) for your organization, this value should be set with the subdomain so that the link to the Datadog Application that the library logs once the upload finishes is accurate.
57
+
58
+ ### Optional dependencies
59
+
60
+ - [`git`](https://git-scm.com/downloads) is used for extracting repository metadata.
61
+
62
+ ### End-to-end testing process
63
+
64
+ To verify this command works as expected, you can use `--dry-run`:
65
+
66
+ ```bash
67
+ export DD_API_KEY='<API key>'
68
+
69
+ yarn launch junit upload ./packages/plugin-junit/__tests__/fixtures/java-report.xml --service example-upload --dry-run
70
+ ```
71
+
72
+ Successful output should look like this:
73
+
74
+ ```bash
75
+ ⚠️ DRY-RUN MODE ENABLED. WILL NOT UPLOAD JUNIT XML
76
+ Starting upload with concurrency 20.
77
+ Will upload jUnit XML file src/__tests__/fixtures/java-report.xml
78
+ service: example-upload
79
+ [DRYRUN] Uploading jUnit XML test report file in src/__tests__/fixtures/java-report.xml
80
+ ✅ Uploaded 1 files in 0 seconds.
81
+ ```
82
+
83
+ ## Further reading
84
+
85
+ Additional helpful documentation, links, and articles:
86
+
87
+ - [Learn about Uploading JUnit test report files to Datadog][1]
88
+
89
+ [1]: https://docs.datadoghq.com/tests/setup/junit_xml/
package/dist/api.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { AxiosPromise, AxiosRequestConfig, AxiosResponse } from 'axios';
2
+ import { Payload } from './interfaces';
3
+ export declare const datadogSite: string;
4
+ export declare const intakeUrl: string;
5
+ export declare const apiUrl: string;
6
+ export declare const uploadJUnitXML: (request: (args: AxiosRequestConfig) => AxiosPromise<AxiosResponse>) => (jUnitXML: Payload) => Promise<AxiosResponse<AxiosResponse<any, any, {}>, any, {}>>;
7
+ export declare const apiConstructor: (baseIntakeUrl: string, apiKey: string) => {
8
+ uploadJUnitXML: (jUnitXML: Payload) => Promise<AxiosResponse<AxiosResponse<any, any, {}>, any, {}>>;
9
+ };
package/dist/api.js ADDED
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.apiConstructor = exports.uploadJUnitXML = exports.apiUrl = exports.intakeUrl = exports.datadogSite = void 0;
16
+ const fs_1 = __importDefault(require("fs"));
17
+ const zlib_1 = require("zlib");
18
+ const utils_1 = require("@datadog/datadog-ci-base/helpers/utils");
19
+ const form_data_1 = __importDefault(require("form-data"));
20
+ const upath_1 = __importDefault(require("upath"));
21
+ const uuid_1 = require("uuid");
22
+ // Dependency follows-redirects sets a default maxBodyLength of 10 MB https://github.com/follow-redirects/follow-redirects/blob/b774a77e582b97174813b3eaeb86931becba69db/index.js#L391
23
+ // We don't want any hard limit enforced by the CLI, the backend will enforce a max size by returning 413 errors.
24
+ const maxBodyLength = Infinity;
25
+ exports.datadogSite = process.env.DATADOG_SITE || process.env.DD_SITE || 'datadoghq.com';
26
+ exports.intakeUrl = `https://cireport-intake.${exports.datadogSite}`;
27
+ exports.apiUrl = `https://api.${exports.datadogSite}`;
28
+ const uploadJUnitXML = (request) => (jUnitXML) => __awaiter(void 0, void 0, void 0, function* () {
29
+ const form = new form_data_1.default();
30
+ let fileName;
31
+ try {
32
+ fileName = upath_1.default.parse(jUnitXML.xmlPath).name;
33
+ }
34
+ catch (e) {
35
+ fileName = 'default_file_name';
36
+ }
37
+ const reportTagsAndMetrics = {
38
+ tags: jUnitXML.reportTags,
39
+ metrics: jUnitXML.reportMeasures, // We can't change `metrics` to `measures` because the backend only accepts `metrics`.
40
+ };
41
+ const custom = {
42
+ metadata: jUnitXML.spanTags,
43
+ tags: jUnitXML.customTags,
44
+ metrics: jUnitXML.customMeasures,
45
+ session: reportTagsAndMetrics,
46
+ '_dd.cireport_version': '3',
47
+ '_dd.hostname': jUnitXML.hostname,
48
+ '_dd.report_name': fileName,
49
+ };
50
+ if (jUnitXML.logsEnabled) {
51
+ custom['_dd.junitxml_logs'] = true;
52
+ }
53
+ if (jUnitXML.xpathTags) {
54
+ custom['_dd.junitxml_xpath_tags'] = jUnitXML.xpathTags;
55
+ }
56
+ form.append('event', JSON.stringify(custom), { filename: 'event.json' });
57
+ form.append('junit_xml_report_file', fs_1.default.createReadStream(jUnitXML.xmlPath).pipe((0, zlib_1.createGzip)()), {
58
+ filename: `${(0, uuid_1.v4)()}.xml.gz`,
59
+ });
60
+ return request({
61
+ data: form,
62
+ headers: form.getHeaders(),
63
+ maxBodyLength,
64
+ method: 'POST',
65
+ url: 'api/v2/cireport',
66
+ });
67
+ });
68
+ exports.uploadJUnitXML = uploadJUnitXML;
69
+ const apiConstructor = (baseIntakeUrl, apiKey) => {
70
+ const requestIntake = (0, utils_1.getRequestBuilder)({ baseUrl: baseIntakeUrl, apiKey });
71
+ return {
72
+ uploadJUnitXML: (0, exports.uploadJUnitXML)(requestIntake),
73
+ };
74
+ };
75
+ exports.apiConstructor = apiConstructor;
76
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAmB;AACnB,+BAA+B;AAI/B,kEAAwE;AACxE,0DAAgC;AAChC,kDAAyB;AACzB,+BAAiC;AAIjC,sLAAsL;AACtL,iHAAiH;AACjH,MAAM,aAAa,GAAG,QAAQ,CAAA;AAEjB,QAAA,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,eAAe,CAAA;AAChF,QAAA,SAAS,GAAG,2BAA2B,mBAAW,EAAE,CAAA;AACpD,Q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AAC,EAAE;QAC7F,QAAQ,EAAE,GAAG,IAAA,SAAM,GAAE,SAAS;KAC/B,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC;QACb,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;QAC1B,aAAa;QACb,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,iBAAiB;KACvB,CAAC,CAAA;AACJ,CAAC,CAAA,CAAA;AA/CU,QAAA,cAAc,kBA+CxB;AAEI,MAAM,cAAc,GAAG,CAAC,aAAqB,EAAE,MAAc,EAAE,EAAE;IACtE,MAAM,aAAa,GAAG,IAAA,yBAAiB,EAAC,EAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAC,CAAC,CAAA;IAEzE,OAAO;QACL,cAAc,EAAE,IAAA,sBAAc,EAAC,aAAa,CAAC;KAC9C,CAAA;AACH,CAAC,CAAA;AANY,QAAA,cAAc,kBAM1B"}
@@ -0,0 +1,17 @@
1
+ import { JunitUploadCommand } from '@datadog/datadog-ci-base/commands/junit/upload';
2
+ export declare class PluginCommand extends JunitUploadCommand {
3
+ private config;
4
+ private xpathTags?;
5
+ private logger;
6
+ execute(): Promise<1 | undefined>;
7
+ private uploadToGitDB;
8
+ private getApiHelper;
9
+ private parseXPathTags;
10
+ private getMatchingJUnitXMLFiles;
11
+ private getSpanTags;
12
+ private getCustomTags;
13
+ private getCustomMeasures;
14
+ private getReportTags;
15
+ private getReportMeasures;
16
+ private uploadJUnitXML;
17
+ }
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PluginCommand = void 0;
16
+ const fs_1 = __importDefault(require("fs"));
17
+ const os_1 = __importDefault(require("os"));
18
+ const git_1 = require("@datadog/datadog-ci-base/commands/git-metadata/git");
19
+ const gitdb_1 = require("@datadog/datadog-ci-base/commands/git-metadata/gitdb");
20
+ const library_1 = require("@datadog/datadog-ci-base/commands/git-metadata/library");
21
+ const upload_1 = require("@datadog/datadog-ci-base/commands/junit/upload");
22
+ const constants_1 = require("@datadog/datadog-ci-base/constants");
23
+ const ci_1 = require("@datadog/datadog-ci-base/helpers/ci");
24
+ const concurrency_1 = require("@datadog/datadog-ci-base/helpers/concurrency");
25
+ const env_1 = require("@datadog/datadog-ci-base/helpers/env");
26
+ const file_finder_1 = require("@datadog/datadog-ci-base/helpers/file-finder");
27
+ const fips_1 = require("@datadog/datadog-ci-base/helpers/fips");
28
+ const format_git_span_data_1 = require("@datadog/datadog-ci-base/helpers/git/format-git-span-data");
29
+ const glob_1 = require("@datadog/datadog-ci-base/helpers/glob");
30
+ const id_1 = __importDefault(require("@datadog/datadog-ci-base/helpers/id"));
31
+ const logger_1 = require("@datadog/datadog-ci-base/helpers/logger");
32
+ const retry_1 = require("@datadog/datadog-ci-base/helpers/retry");
33
+ const tags_1 = require("@datadog/datadog-ci-base/helpers/tags");
34
+ const user_provided_git_1 = require("@datadog/datadog-ci-base/helpers/user-provided-git");
35
+ const utils_1 = require("@datadog/datadog-ci-base/helpers/utils");
36
+ const chalk_1 = __importDefault(require("chalk"));
37
+ const fast_xml_parser_1 = require("fast-xml-parser");
38
+ const upath_1 = __importDefault(require("upath"));
39
+ const api_1 = require("../api");
40
+ const renderer_1 = require("../renderer");
41
+ const TRACE_ID_HTTP_HEADER = 'x-datadog-trace-id';
42
+ const PARENT_ID_HTTP_HEADER = 'x-datadog-parent-id';
43
+ const errorCodesStopUpload = [400, 403];
44
+ const isJunitXmlReport = (file) => {
45
+ if (upath_1.default.extname(file) !== '.xml') {
46
+ return false;
47
+ }
48
+ const filename = upath_1.default.basename(file);
49
+ return (filename.includes('junit') || // *junit*.xml
50
+ filename.includes('test') || // *test*.xml
51
+ filename.includes('TEST-') // *TEST-*.xml
52
+ );
53
+ };
54
+ const validateXml = (xmlFilePath) => {
55
+ const xmlFileContentString = String(fs_1.default.readFileSync(xmlFilePath));
56
+ const validationOutput = fast_xml_parser_1.XMLValidator.validate(xmlFileContentString);
57
+ if (validationOutput !== true) {
58
+ return validationOutput.err.msg;
59
+ }
60
+ const xmlParser = new fast_xml_parser_1.XMLParser();
61
+ const xmlFileJSON = xmlParser.parse(String(xmlFileContentString));
62
+ if (!('testsuites' in xmlFileJSON) && !('testsuite' in xmlFileJSON)) {
63
+ return 'Neither <testsuites> nor <testsuite> are the root tag.';
64
+ }
65
+ else if (!xmlFileJSON.testsuite && !xmlFileJSON.testsuites) {
66
+ return 'The junit report file is empty, there are no <testcase> elements.';
67
+ }
68
+ return undefined;
69
+ };
70
+ class PluginCommand extends upload_1.JunitUploadCommand {
71
+ constructor() {
72
+ var _a, _b;
73
+ super(...arguments);
74
+ this.config = {
75
+ apiKey: process.env.DATADOG_API_KEY || process.env.DD_API_KEY,
76
+ env: process.env.DD_ENV,
77
+ envVarTags: process.env.DD_TAGS,
78
+ envVarMetrics: process.env.DD_METRICS,
79
+ envVarMeasures: process.env.DD_MEASURES,
80
+ fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
81
+ fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
82
+ };
83
+ this.logger = new logger_1.Logger((s) => this.context.stdout.write(s), logger_1.LogLevel.INFO);
84
+ }
85
+ execute() {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ (0, fips_1.enableFips)(this.fips || this.config.fips, this.fipsIgnoreError || this.config.fipsIgnoreError);
88
+ this.logger.setLogLevel(this.verbose ? logger_1.LogLevel.DEBUG : logger_1.LogLevel.INFO);
89
+ this.logger.setShouldIncludeTime(this.verbose);
90
+ if (!this.basePaths || !this.basePaths.length) {
91
+ this.context.stderr.write('Missing basePath\n');
92
+ return 1;
93
+ }
94
+ if (!this.config.env) {
95
+ this.config.env = this.env;
96
+ }
97
+ if (this.rawXPathTags) {
98
+ this.xpathTags = this.parseXPathTags(this.rawXPathTags);
99
+ if (Object.keys(this.xpathTags).length !== this.rawXPathTags.length) {
100
+ return 1;
101
+ }
102
+ }
103
+ const api = this.getApiHelper();
104
+ // Normalizing the basePath to resolve .. and .
105
+ this.basePaths = this.basePaths.map((basePath) => upath_1.default.normalize(basePath));
106
+ this.logger.info((0, renderer_1.renderCommandInfo)(this.basePaths, this.service, this.maxConcurrency, this.dryRun));
107
+ const spanTags = yield this.getSpanTags();
108
+ const customTags = this.getCustomTags();
109
+ const customMeasures = this.getCustomMeasures();
110
+ const reportTags = this.getReportTags();
111
+ const reportMeasures = this.getReportMeasures();
112
+ const payloads = yield this.getMatchingJUnitXMLFiles(spanTags, customTags, customMeasures, reportTags, reportMeasures);
113
+ const upload = (p) => this.uploadJUnitXML(api, p);
114
+ const initialTime = new Date().getTime();
115
+ yield (0, concurrency_1.doWithMaxConcurrency)(this.maxConcurrency, payloads, upload);
116
+ const totalTimeSeconds = (Date.now() - initialTime) / 1000;
117
+ this.logger.info((0, renderer_1.renderSuccessfulUpload)(this.dryRun, payloads.length, totalTimeSeconds));
118
+ if (!this.skipGitMetadataUpload) {
119
+ if (yield (0, library_1.isGitRepo)()) {
120
+ const traceId = (0, id_1.default)();
121
+ const requestBuilder = (0, utils_1.getRequestBuilder)({
122
+ baseUrl: api_1.apiUrl,
123
+ apiKey: this.config.apiKey,
124
+ headers: new Map([
125
+ [TRACE_ID_HTTP_HEADER, traceId],
126
+ [PARENT_ID_HTTP_HEADER, traceId],
127
+ ]),
128
+ });
129
+ try {
130
+ this.logger.info(`${this.dryRun ? '[DRYRUN] ' : ''}Syncing git metadata...`);
131
+ let elapsed = 0;
132
+ if (!this.dryRun) {
133
+ elapsed = yield (0, utils_1.timedExecAsync)(this.uploadToGitDB.bind(this), { requestBuilder });
134
+ }
135
+ this.logger.info((0, renderer_1.renderSuccessfulGitDBSync)(this.dryRun, elapsed));
136
+ }
137
+ catch (err) {
138
+ this.logger.info((0, renderer_1.renderFailedGitDBSync)(err));
139
+ }
140
+ }
141
+ else {
142
+ this.logger.info(`${this.dryRun ? '[DRYRUN] ' : ''}Not syncing git metadata (not a git repo)`);
143
+ }
144
+ }
145
+ else {
146
+ this.logger.debug('Not syncing git metadata (skip git upload flag detected)');
147
+ }
148
+ if (!this.dryRun) {
149
+ this.context.stdout.write((0, renderer_1.renderSuccessfulCommand)(spanTags, this.service, this.config.env));
150
+ }
151
+ });
152
+ }
153
+ uploadToGitDB(opts) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ yield (0, gitdb_1.uploadToGitDB)(this.logger, opts.requestBuilder, yield (0, git_1.newSimpleGit)(), this.dryRun, this.gitRepositoryURL);
156
+ });
157
+ }
158
+ getApiHelper() {
159
+ if (!this.config.apiKey) {
160
+ this.logger.error(`Neither ${chalk_1.default.red.bold('DATADOG_API_KEY')} nor ${chalk_1.default.red.bold('DD_API_KEY')} is in your environment.`);
161
+ throw new Error('API key is missing');
162
+ }
163
+ return (0, api_1.apiConstructor)(api_1.intakeUrl, this.config.apiKey);
164
+ }
165
+ parseXPathTags(rawXPathTags) {
166
+ return rawXPathTags.reduce((xpathTags, rawExpression) => {
167
+ const index = rawExpression.indexOf('=');
168
+ if (index === -1) {
169
+ this.context.stderr.write('Invalid xpath-tag: missing =. Value must be <tag>=<xpath-expression>\n');
170
+ return xpathTags;
171
+ }
172
+ const tagName = rawExpression.substring(0, index);
173
+ const xPath = rawExpression.substring(index + 1);
174
+ xpathTags[tagName] = xPath;
175
+ return xpathTags;
176
+ }, {});
177
+ }
178
+ getMatchingJUnitXMLFiles(spanTags, customTags, customMeasures, reportTags, reportMeasures) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ let basePaths;
181
+ let searchFoldersRecursively;
182
+ let filterFile;
183
+ if (this.automaticReportsDiscovery) {
184
+ basePaths = this.basePaths || ['.'];
185
+ searchFoldersRecursively = true;
186
+ filterFile = isJunitXmlReport;
187
+ }
188
+ else {
189
+ // maintaining legacy matching logic for backward compatibility
190
+ basePaths = this.basePaths || [];
191
+ searchFoldersRecursively = false;
192
+ filterFile = (file) => upath_1.default.extname(file) === '.xml';
193
+ }
194
+ const validUniqueFiles = (0, file_finder_1.findFiles)(basePaths, searchFoldersRecursively, (0, glob_1.parsePathsList)(this.ignoredPaths), filterFile, validateXml, (filePath, errorMessage) => this.context.stdout.write((0, renderer_1.renderInvalidFile)(filePath, errorMessage)));
195
+ return validUniqueFiles.map((jUnitXMLFilePath) => ({
196
+ hostname: os_1.default.hostname(),
197
+ logsEnabled: this.logs,
198
+ xpathTags: this.xpathTags,
199
+ spanTags,
200
+ customTags,
201
+ customMeasures,
202
+ reportTags,
203
+ reportMeasures,
204
+ xmlPath: jUnitXMLFilePath,
205
+ }));
206
+ });
207
+ }
208
+ getSpanTags() {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ const ciSpanTags = (0, ci_1.getCISpanTags)();
211
+ const gitSpanTags = yield (0, format_git_span_data_1.getGitMetadata)();
212
+ const userGitSpanTags = (0, user_provided_git_1.getUserGitSpanTags)();
213
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, gitSpanTags), ciSpanTags), userGitSpanTags), (this.config.env ? { env: this.config.env } : {})), { service: this.service });
214
+ });
215
+ }
216
+ getCustomTags() {
217
+ const envVarTags = this.config.envVarTags ? (0, tags_1.parseTags)(this.config.envVarTags.split(',')) : {};
218
+ const cliTags = this.tags ? (0, tags_1.parseTags)(this.tags) : {};
219
+ return Object.assign(Object.assign({}, cliTags), envVarTags);
220
+ }
221
+ getCustomMeasures() {
222
+ const envVarMetrics = this.config.envVarMetrics ? (0, tags_1.parseMetrics)(this.config.envVarMetrics.split(',')) : {};
223
+ const envVarMeasures = this.config.envVarMeasures ? (0, tags_1.parseMetrics)(this.config.envVarMeasures.split(',')) : {};
224
+ const cliMeasures = this.measures ? (0, tags_1.parseMetrics)(this.measures) : {};
225
+ return Object.assign(Object.assign(Object.assign({}, cliMeasures), envVarMetrics), envVarMeasures);
226
+ }
227
+ getReportTags() {
228
+ return this.reportTags ? (0, tags_1.parseTags)(this.reportTags) : {};
229
+ }
230
+ getReportMeasures() {
231
+ const cliMeasures = this.reportMeasures ? (0, tags_1.parseMetrics)(this.reportMeasures) : {};
232
+ return Object.assign({}, cliMeasures);
233
+ }
234
+ uploadJUnitXML(api, jUnitXML) {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ if (this.dryRun) {
237
+ this.logger.info((0, renderer_1.renderDryRunUpload)(jUnitXML));
238
+ return;
239
+ }
240
+ try {
241
+ this.logger.info((0, renderer_1.renderUpload)(jUnitXML));
242
+ yield (0, retry_1.retryRequest)(() => api.uploadJUnitXML(jUnitXML), {
243
+ onRetry: (e, attempt) => {
244
+ this.context.stderr.write((0, renderer_1.renderRetriedUpload)(jUnitXML, e.message, attempt));
245
+ },
246
+ retries: 5,
247
+ });
248
+ }
249
+ catch (error) {
250
+ this.context.stderr.write((0, renderer_1.renderFailedUpload)(jUnitXML, error));
251
+ if (error.response) {
252
+ // If it's an axios error
253
+ if (!errorCodesStopUpload.includes(error.response.status)) {
254
+ // And a status code that should not stop the whole upload, just return
255
+ return;
256
+ }
257
+ }
258
+ throw error;
259
+ }
260
+ });
261
+ }
262
+ }
263
+ exports.PluginCommand = PluginCommand;
264
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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AC,QAAQ,EAAE;oBAClB,yBAAyB;oBACzB,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;wBACzD,uEAAuE;wBACvE,OAAM;qBACP;iBACF;gBACD,MAAM,KAAK,CAAA;aACZ;QACH,CAAC;KAAA;CACF;AAxPD,sCAwPC"}
@@ -0,0 +1,16 @@
1
+ import type { AxiosPromise, AxiosResponse } from 'axios';
2
+ import { SpanTags } from '@datadog/datadog-ci-base/helpers/interfaces';
3
+ export interface Payload {
4
+ hostname: string;
5
+ logsEnabled: boolean;
6
+ spanTags: SpanTags;
7
+ customTags: Record<string, string>;
8
+ customMeasures: Record<string, number>;
9
+ reportTags: Record<string, string>;
10
+ reportMeasures: Record<string, number>;
11
+ xmlPath: string;
12
+ xpathTags?: Record<string, string>;
13
+ }
14
+ export interface APIHelper {
15
+ uploadJUnitXML(jUnitXML: Payload): AxiosPromise<AxiosResponse>;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { SpanTags } from '@datadog/datadog-ci-base/helpers/interfaces';
2
+ import { Payload } from './interfaces';
3
+ export declare const renderInvalidFile: (xmlPath: string, errorMessage: string) => string;
4
+ export declare const renderFailedUpload: (payload: Payload, errorMessage: string) => string;
5
+ export declare const renderFailedGitDBSync: (err: any) => string;
6
+ export declare const renderRetriedUpload: (payload: Payload, errorMessage: string, attempt: number) => string;
7
+ export declare const renderSuccessfulUpload: (dryRun: boolean, fileCount: number, duration: number) => string;
8
+ export declare const renderSuccessfulGitDBSync: (dryRun: boolean, elapsed: number) => string;
9
+ export declare const renderSuccessfulCommand: (spanTags: SpanTags, service?: string, env?: string) => string;
10
+ export declare const renderDryRunUpload: (payload: Payload) => string;
11
+ export declare const renderUpload: (payload: Payload) => string;
12
+ export declare const renderCommandInfo: (basePaths: string[], service: string | undefined, concurrency: number, dryRun: boolean) => string;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.renderCommandInfo = exports.renderUpload = exports.renderDryRunUpload = exports.renderSuccessfulCommand = exports.renderSuccessfulGitDBSync = exports.renderSuccessfulUpload = exports.renderRetriedUpload = exports.renderFailedGitDBSync = exports.renderFailedUpload = exports.renderInvalidFile = void 0;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ const upath_1 = __importDefault(require("upath"));
9
+ const utils_1 = require("./utils");
10
+ const ICONS = {
11
+ FAILED: '❌',
12
+ SUCCESS: '✅',
13
+ WARNING: '⚠️',
14
+ };
15
+ const renderInvalidFile = (xmlPath, errorMessage) => {
16
+ const jUnitXMLPath = `[${chalk_1.default.bold.dim(xmlPath)}]`;
17
+ return chalk_1.default.red(`${ICONS.FAILED} Invalid jUnitXML file ${jUnitXMLPath}: ${errorMessage}\n`);
18
+ };
19
+ exports.renderInvalidFile = renderInvalidFile;
20
+ const renderFailedUpload = (payload, errorMessage) => {
21
+ const jUnitXMLPath = `[${chalk_1.default.bold.dim(payload.xmlPath)}]`;
22
+ return chalk_1.default.red(`${ICONS.FAILED} Failed upload jUnitXML for ${jUnitXMLPath}: ${errorMessage}\n`);
23
+ };
24
+ exports.renderFailedUpload = renderFailedUpload;
25
+ const renderFailedGitDBSync = (err) => {
26
+ return chalk_1.default.red.bold(`${ICONS.FAILED} Could not sync git metadata: ${err}\n`);
27
+ };
28
+ exports.renderFailedGitDBSync = renderFailedGitDBSync;
29
+ const renderRetriedUpload = (payload, errorMessage, attempt) => {
30
+ const jUnitXMLPath = `[${chalk_1.default.bold.dim(payload.xmlPath)}]`;
31
+ return chalk_1.default.yellow(`[attempt ${attempt}] Retrying jUnitXML upload ${jUnitXMLPath}: ${errorMessage}\n`);
32
+ };
33
+ exports.renderRetriedUpload = renderRetriedUpload;
34
+ const renderSuccessfulUpload = (dryRun, fileCount, duration) => {
35
+ return chalk_1.default.green(`${dryRun ? '[DRYRUN] ' : ''}${ICONS.SUCCESS} Uploaded ${fileCount} files in ${duration} seconds.`);
36
+ };
37
+ exports.renderSuccessfulUpload = renderSuccessfulUpload;
38
+ const renderSuccessfulGitDBSync = (dryRun, elapsed) => {
39
+ return chalk_1.default.green(`${dryRun ? '[DRYRUN] ' : ''}${ICONS.SUCCESS} Synced git metadata in ${elapsed} seconds.`);
40
+ };
41
+ exports.renderSuccessfulGitDBSync = renderSuccessfulGitDBSync;
42
+ const renderSuccessfulCommand = (spanTags, service, env) => {
43
+ let fullStr = '';
44
+ fullStr += chalk_1.default.green('=================================================================================================\n');
45
+ fullStr += chalk_1.default.green('* View detailed reports on Datadog (they can take a few minutes to become available)\n');
46
+ const redirectTestCommitURL = (0, utils_1.getTestCommitRedirectURL)(spanTags, service, env);
47
+ if (redirectTestCommitURL) {
48
+ fullStr += chalk_1.default.green('* Commit report:\n');
49
+ fullStr += chalk_1.default.green(`* ${redirectTestCommitURL}\n`);
50
+ }
51
+ const testRunsUrl = (0, utils_1.getTestRunsUrl)(spanTags);
52
+ if (testRunsUrl) {
53
+ fullStr += chalk_1.default.green('* Test runs report:\n');
54
+ fullStr += chalk_1.default.green(`* ${testRunsUrl}\n`);
55
+ }
56
+ fullStr += chalk_1.default.green('=================================================================================================\n');
57
+ return fullStr;
58
+ };
59
+ exports.renderSuccessfulCommand = renderSuccessfulCommand;
60
+ const renderDryRunUpload = (payload) => `[DRYRUN] ${(0, exports.renderUpload)(payload)}`;
61
+ exports.renderDryRunUpload = renderDryRunUpload;
62
+ const renderUpload = (payload) => `Uploading jUnit XML test report file in ${payload.xmlPath}`;
63
+ exports.renderUpload = renderUpload;
64
+ const renderCommandInfo = (basePaths, service, concurrency, dryRun) => {
65
+ let fullStr = '';
66
+ if (dryRun) {
67
+ fullStr += chalk_1.default.yellow(`${ICONS.WARNING} DRY-RUN MODE ENABLED. WILL NOT UPLOAD JUNIT XML\n`);
68
+ }
69
+ fullStr += chalk_1.default.green(`Starting upload with concurrency ${concurrency}. \n`);
70
+ if (basePaths.length === 1 && !!upath_1.default.extname(basePaths[0])) {
71
+ fullStr += chalk_1.default.green(`Will upload jUnit XML file ${basePaths[0]}\n`);
72
+ }
73
+ else {
74
+ fullStr += chalk_1.default.green(`Will look for jUnit XML files in ${basePaths.join(', ')}\n`);
75
+ }
76
+ if (service) {
77
+ fullStr += chalk_1.default.green(`service: ${service}`);
78
+ }
79
+ return fullStr;
80
+ };
81
+ exports.renderCommandInfo = renderCommandInfo;
82
+ //# sourceMappingURL=renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":";;;;;;AACA,kDAAyB;AACzB,kDAAyB;AAGzB,mCAAgE;AAEhE,MAAM,KAAK,GAAG;IACZ,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,IAAI;CACd,CAAA;AAEM,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,YAAoB,EAAE,EAAE;IACzE,MAAM,YAAY,GAAG,IAAI,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAA;IAEnD,OAAO,eAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,0BAA0B,YAAY,KAAK,YAAY,IAAI,CAAC,CAAA;AAC9F,CAAC,CAAA;AAJY,QAAA,iBAAiB,qBAI7B;AAEM,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAAE,YAAoB,EAAE,EAAE;IAC3E,MAAM,YAAY,GAAG,IAAI,eAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAA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OAAO,GAAG,EAAE,CAAA;IAChB,IAAI,MAAM,EAAE;QACV,OAAO,IAAI,eAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,OAAO,oDAAoD,CAAC,CAAA;KAC9F;IACD,OAAO,IAAI,eAAK,CAAC,KAAK,CAAC,oCAAoC,WAAW,MAAM,CAAC,CAAA;IAC7E,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,eAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;QAC3D,OAAO,IAAI,eAAK,CAAC,KAAK,CAAC,8BAA8B,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;KACvE;SAAM;QACL,OAAO,IAAI,eAAK,CAAC,KAAK,CAAC,oCAAoC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KACrF;IACD,IAAI,OAAO,EAAE;QACX,OAAO,IAAI,eAAK,CAAC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAA;KAC9C;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AArBY,QAAA,iBAAiB,qBAqB7B"}
@@ -0,0 +1,3 @@
1
+ import { SpanTags } from '@datadog/datadog-ci-base/helpers/interfaces';
2
+ export declare const getTestRunsUrl: (spanTags: SpanTags, queryPrefix?: string) => string;
3
+ export declare const getTestCommitRedirectURL: (spanTags: SpanTags, service?: string, env?: string) => string;
package/dist/utils.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTestCommitRedirectURL = exports.getTestRunsUrl = void 0;
4
+ const app_1 = require("@datadog/datadog-ci-base/helpers/app");
5
+ const tags_1 = require("@datadog/datadog-ci-base/helpers/tags");
6
+ const getTestRunsUrl = (spanTags, queryPrefix = '') => {
7
+ const path = (0, app_1.getTestRunsUrlPath)(spanTags, queryPrefix);
8
+ return path ? `${(0, app_1.getBaseUrl)()}${path}` : '';
9
+ };
10
+ exports.getTestRunsUrl = getTestRunsUrl;
11
+ const getTestCommitRedirectURL = (spanTags, service, env) => {
12
+ if (!spanTags[tags_1.GIT_REPOSITORY_URL] || !spanTags[tags_1.GIT_BRANCH] || !spanTags[tags_1.GIT_SHA] || !service) {
13
+ return '';
14
+ }
15
+ const encodedRepoUrl = encodeURIComponent(`${spanTags[tags_1.GIT_REPOSITORY_URL]}`);
16
+ const encodedService = encodeURIComponent(service);
17
+ const encodedBranch = encodeURIComponent(`${spanTags[tags_1.GIT_BRANCH]}`);
18
+ const commitSha = `${spanTags[tags_1.GIT_SHA]}`;
19
+ let url = `${(0, app_1.getBaseUrl)()}ci/redirect/tests/${encodedRepoUrl}/-/${encodedService}/-/${encodedBranch}/-/${commitSha}`;
20
+ if (env) {
21
+ url += `?env=${encodeURIComponent(env)}`;
22
+ }
23
+ return url;
24
+ };
25
+ exports.getTestCommitRedirectURL = getTestCommitRedirectURL;
26
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,8DAAmF;AAEnF,gEAA6F;AAEtF,MAAM,cAAc,GAAG,CAAC,QAAkB,EAAE,WAAW,GAAG,EAAE,EAAU,EAAE;IAC7E,MAAM,IAAI,GAAG,IAAA,wBAAkB,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;IAEtD,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,IAAA,gBAAU,GAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;AAC7C,CAAC,CAAA;AAJY,QAAA,cAAc,kBAI1B;AAEM,MAAM,wBAAwB,GAAG,CAAC,QAAkB,EAAE,OAAgB,EAAE,GAAY,EAAU,EAAE;IACrG,IAAI,CAAC,QAAQ,CAAC,yBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAO,CAAC,IAAI,CAAC,OAAO,EAAE;QAC5F,OAAO,EAAE,CAAA;KACV;IAED,MAAM,cAAc,GAAG,kBAAkB,CAAC,GAAG,QAAQ,CAAC,yBAAkB,CAAC,EAAE,CAAC,CAAA;IAC5E,MAAM,cAAc,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAClD,MAAM,aAAa,GAAG,kBAAkB,CAAC,GAAG,QAAQ,CAAC,iBAAU,CAAC,EAAE,CAAC,CAAA;IACnE,MAAM,SAAS,GAAG,GAAG,QAAQ,CAAC,cAAO,CAAC,EAAE,CAAA;IAExC,IAAI,GAAG,GAAG,GAAG,IAAA,gBAAU,GAAE,qBAAqB,cAAc,MAAM,cAAc,MAAM,aAAa,MAAM,SAAS,EAAE,CAAA;IACpH,IAAI,GAAG,EAAE;QACP,GAAG,IAAI,QAAQ,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAA;KACzC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAhBY,QAAA,wBAAwB,4BAgBpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/datadog-ci-plugin-junit",
3
- "version": "0.0.2",
3
+ "version": "5.3.0",
4
4
  "description": "Datadog CI plugin for `junit` commands",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -35,6 +35,14 @@
35
35
  "prepack": "yarn package:clean-dist"
36
36
  },
37
37
  "peerDependencies": {
38
- "@datadog/datadog-ci-base": "5.2.1"
38
+ "@datadog/datadog-ci-base": "5.3.0"
39
+ },
40
+ "dependencies": {
41
+ "axios": "^1.12.1",
42
+ "chalk": "3.0.0",
43
+ "fast-xml-parser": "^4.4.1",
44
+ "form-data": "^4.0.4",
45
+ "upath": "^2.0.1",
46
+ "uuid": "^9.0.0"
39
47
  }
40
48
  }