@datadog/datadog-ci 1.1.0 → 1.2.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.
@@ -31,7 +31,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
32
32
  };
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.parseVariablesFromCli = exports.retry = exports.runTests = exports.getTestsToTrigger = exports.getReporter = exports.getResultDuration = exports.createSummary = exports.createTriggerResultMap = exports.waitForResults = exports.wait = exports.getSuites = exports.hasTestSucceeded = exports.hasResultPassed = exports.isCriticalError = exports.getStrictestExecutionRule = exports.getExecutionRule = exports.setCiTriggerApp = exports.handleConfig = void 0;
34
+ exports.parseVariablesFromCli = exports.retry = exports.runTests = exports.getTestsToTrigger = exports.getReporter = exports.getResultDuration = exports.createSummary = exports.createTriggerResultMap = exports.waitForResults = exports.wait = exports.getSuites = exports.hasTestSucceeded = exports.hasResultPassed = exports.isCriticalError = exports.getStrictestExecutionRule = exports.getExecutionRule = exports.setCiTriggerApp = exports.handleConfig = exports.ciTriggerApp = void 0;
35
35
  const fs = __importStar(require("fs"));
36
36
  const path = __importStar(require("path"));
37
37
  const url_1 = require("url");
@@ -48,7 +48,7 @@ const PUBLIC_ID_REGEX = /^[\d\w]{3}-[\d\w]{3}-[\d\w]{3}$/;
48
48
  const SUBDOMAIN_REGEX = /(.*?)\.(?=[^\/]*\..{2,5})/;
49
49
  const TEMPLATE_REGEX = /{{\s*([^{}]*?)\s*}}/g;
50
50
  const template = (st, context) => st.replace(TEMPLATE_REGEX, (match, p1) => (p1 in context ? context[p1] : match));
51
- let ciTriggerApp = 'npm_package';
51
+ exports.ciTriggerApp = 'npm_package';
52
52
  const handleConfig = (test, publicId, reporter, config) => {
53
53
  const executionRule = exports.getExecutionRule(test, config);
54
54
  let handledConfig = {
@@ -86,7 +86,7 @@ const handleConfig = (test, publicId, reporter, config) => {
86
86
  };
87
87
  exports.handleConfig = handleConfig;
88
88
  const setCiTriggerApp = (source) => {
89
- ciTriggerApp = source;
89
+ exports.ciTriggerApp = source;
90
90
  };
91
91
  exports.setCiTriggerApp = setCiTriggerApp;
92
92
  const parseUrlVariables = (url, reporter) => {
@@ -425,8 +425,9 @@ exports.getTestsToTrigger = getTestsToTrigger;
425
425
  const runTests = (api, testsToTrigger) => __awaiter(void 0, void 0, void 0, function* () {
426
426
  const payload = { tests: testsToTrigger };
427
427
  const ciMetadata = ci_1.getCIMetadata();
428
- const syntheticsMetadata = Object.assign(Object.assign({ ci: { job: {}, pipeline: {}, provider: {}, stage: {} }, git: { commit: { author: {}, committer: {} } } }, ciMetadata), { trigger_app: ciTriggerApp });
429
- payload.metadata = syntheticsMetadata;
428
+ if (ciMetadata) {
429
+ payload.metadata = ciMetadata;
430
+ }
430
431
  try {
431
432
  return yield api.triggerTests(payload);
432
433
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/datadog-ci",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Run datadog actions from the CI.",
5
5
  "repository": "https://github.com/DataDog/datadog-ci",
6
6
  "license": "Apache-2.0",
@@ -64,8 +64,9 @@
64
64
  "glob": "7.1.4",
65
65
  "inquirer": "8.2.0",
66
66
  "proxy-agent": "5.0.0",
67
- "simple-git": "2.31.0",
68
- "ssh2": "1.4.0",
67
+ "rimraf": "^3.0.2",
68
+ "simple-git": "3.3.0",
69
+ "ssh2": "1.8.0",
69
70
  "ssh2-streams": "0.4.10",
70
71
  "sshpk": "1.16.1",
71
72
  "tiny-async-pool": "1.2.0",
@@ -83,6 +84,7 @@
83
84
  "@types/inquirer": "8.1.3",
84
85
  "@types/jest": "24.0.15",
85
86
  "@types/node": "10.17.57",
87
+ "@types/rimraf": "^3.0.2",
86
88
  "@types/ssh2": "0.5.46",
87
89
  "@types/ssh2-streams": "0.1.8",
88
90
  "@types/sshpk": "1.10.5",