@allurereport/plugin-testops 3.1.0 → 3.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.
package/dist/client.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare class TestOpsClient {
11
11
  startUpload(ci: CiDescriptor): Promise<void>;
12
12
  stopUpload(ci: CiDescriptor, status: TestStatus): Promise<void>;
13
13
  createLaunch(launchName: string, launchTags: string[]): Promise<void>;
14
- createSession(): Promise<void>;
14
+ createSession(environment?: Record<string, any>): Promise<void>;
15
15
  uploadTestResults(params: {
16
16
  trs: TestResult[];
17
17
  attachmentsResolver: (tr: TestResult) => Promise<any>;
package/dist/client.js CHANGED
@@ -108,12 +108,13 @@ export class TestOpsClient {
108
108
  });
109
109
  __classPrivateFieldSet(this, _TestOpsClient_launch, data, "f");
110
110
  }
111
- async createSession() {
111
+ async createSession(environment = {}) {
112
112
  if (!__classPrivateFieldGet(this, _TestOpsClient_launch, "f")) {
113
113
  throw new Error("Launch isn't created! Call createLaunch first");
114
114
  }
115
- const { data } = await __classPrivateFieldGet(this, _TestOpsClient_client, "f").post("/api/rs/upload/session?manual=true", {
115
+ const { data } = await __classPrivateFieldGet(this, _TestOpsClient_client, "f").post("/api/upload/session?manual=true", {
116
116
  launchId: __classPrivateFieldGet(this, _TestOpsClient_launch, "f").id,
117
+ environment: Object.entries(environment).map(([key, value]) => ({ key, value: String(value) })),
117
118
  }, {
118
119
  headers: {
119
120
  Authorization: `Bearer ${__classPrivateFieldGet(this, _TestOpsClient_oauthToken, "f")}`,
package/dist/plugin.js CHANGED
@@ -13,6 +13,7 @@ var _TestopsUploaderPlugin_instances, _TestopsUploaderPlugin_ci, _TestopsUploade
13
13
  import { detect } from "@allurereport/ci";
14
14
  import { getWorstStatus } from "@allurereport/core-api";
15
15
  import { convertToSummaryTestResult, } from "@allurereport/plugin-api";
16
+ import { env } from "node:process";
16
17
  import { TestOpsClient } from "./client.js";
17
18
  import { resolvePluginOptions, unwrapStepsAttachments } from "./utils.js";
18
19
  export class TestopsUploaderPlugin {
@@ -121,7 +122,7 @@ _TestopsUploaderPlugin_ci = new WeakMap(), _TestopsUploaderPlugin_client = new W
121
122
  if (issueNewToken) {
122
123
  await __classPrivateFieldGet(this, _TestopsUploaderPlugin_client, "f").issueOauthToken();
123
124
  }
124
- await __classPrivateFieldGet(this, _TestopsUploaderPlugin_client, "f").createSession();
125
+ await __classPrivateFieldGet(this, _TestopsUploaderPlugin_client, "f").createSession(env);
125
126
  await __classPrivateFieldGet(this, _TestopsUploaderPlugin_client, "f").uploadTestResults({
126
127
  trs: allTrsWithAttachments,
127
128
  attachmentsResolver: async (tr) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-testops",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Allure Plugin TestOps",
5
5
  "keywords": [
6
6
  "allure",
@@ -32,11 +32,11 @@
32
32
  "test": "rimraf ./out && vitest run"
33
33
  },
34
34
  "dependencies": {
35
- "@allurereport/ci": "3.1.0",
36
- "@allurereport/core-api": "3.1.0",
37
- "@allurereport/plugin-api": "3.1.0",
38
- "@allurereport/reader-api": "3.1.0",
39
- "axios": "^1.13.2",
35
+ "@allurereport/ci": "3.2.0",
36
+ "@allurereport/core-api": "3.2.0",
37
+ "@allurereport/plugin-api": "3.2.0",
38
+ "@allurereport/reader-api": "3.2.0",
39
+ "axios": "^1.13.5",
40
40
  "form-data": "^4.0.5",
41
41
  "lodash.chunk": "^4.2.0"
42
42
  },