qase-javascript-commons 2.5.9 → 2.6.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/changelog.md +18 -0
- package/dist/client/clientV2.js +10 -4
- package/dist/models/host-data.d.ts +2 -2
- package/dist/models/test-result.d.ts +1 -0
- package/dist/models/test-result.js +2 -0
- package/dist/reporters/report-reporter.js +1 -0
- package/dist/utils/hostData.js +16 -6
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# qase-javascript-commons@2.6.0
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
- Added `tags: string[]` field to `TestResultType` domain model for tag support.
|
|
6
|
+
- Tags are mapped to `fields.tags` as a comma-separated string when sending results to API v2.
|
|
7
|
+
- Tags are included in report serialization output.
|
|
8
|
+
|
|
9
|
+
# qase-javascript-commons@2.5.10
|
|
10
|
+
|
|
11
|
+
## What's new
|
|
12
|
+
|
|
13
|
+
Unified HostData model to align field names across all Qase reporter languages:
|
|
14
|
+
|
|
15
|
+
- Renamed `node` → `language` and `npm` → `packageManager` in the `HostData` interface.
|
|
16
|
+
- Normalized `system` field: `win32` is now reported as `windows`.
|
|
17
|
+
- X-Platform and X-Client headers continue to use language-specific keys (`node=`, `npm=`).
|
|
18
|
+
|
|
1
19
|
# qase-javascript-commons@2.5.9
|
|
2
20
|
|
|
3
21
|
## Bug fixes
|
package/dist/client/clientV2.js
CHANGED
|
@@ -93,11 +93,11 @@ class ClientV2 extends clientV1_1.ClientV1 {
|
|
|
93
93
|
if (hostData.arch && hostData.arch.trim()) {
|
|
94
94
|
platformParts.push(`arch=${hostData.arch}`);
|
|
95
95
|
}
|
|
96
|
-
if (hostData.
|
|
97
|
-
platformParts.push(`node=${hostData.
|
|
96
|
+
if (hostData.language && hostData.language.trim()) {
|
|
97
|
+
platformParts.push(`node=${hostData.language}`);
|
|
98
98
|
}
|
|
99
|
-
if (hostData.
|
|
100
|
-
platformParts.push(`npm=${hostData.
|
|
99
|
+
if (hostData.packageManager && hostData.packageManager.trim()) {
|
|
100
|
+
platformParts.push(`npm=${hostData.packageManager}`);
|
|
101
101
|
}
|
|
102
102
|
if (platformParts.length > 0) {
|
|
103
103
|
headers['X-Platform'] = platformParts.join(';');
|
|
@@ -140,6 +140,12 @@ class ClientV2 extends clientV1_1.ClientV1 {
|
|
|
140
140
|
defect: this.config.defect ?? false,
|
|
141
141
|
signature: result.signature,
|
|
142
142
|
};
|
|
143
|
+
if (result.tags.length > 0) {
|
|
144
|
+
model.fields = {
|
|
145
|
+
...model.fields,
|
|
146
|
+
tags: [...new Set(result.tags)].join(','),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
143
149
|
this.logger.logDebug(`Transformed result: ${JSON.stringify(model)}`);
|
|
144
150
|
return model;
|
|
145
151
|
}
|
|
@@ -24,6 +24,7 @@ class TestResultType {
|
|
|
24
24
|
relations;
|
|
25
25
|
muted;
|
|
26
26
|
message;
|
|
27
|
+
tags;
|
|
27
28
|
preparedAttachments;
|
|
28
29
|
constructor(title) {
|
|
29
30
|
this.id = '';
|
|
@@ -42,6 +43,7 @@ class TestResultType {
|
|
|
42
43
|
this.relations = null;
|
|
43
44
|
this.muted = false;
|
|
44
45
|
this.message = null;
|
|
46
|
+
this.tags = [];
|
|
45
47
|
this.preparedAttachments = [];
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
@@ -192,6 +192,7 @@ class ReportReporter extends abstract_reporter_1.AbstractReporter {
|
|
|
192
192
|
relations: result.relations,
|
|
193
193
|
muted: result.muted,
|
|
194
194
|
message: result.message,
|
|
195
|
+
tags: result.tags,
|
|
195
196
|
};
|
|
196
197
|
// Internal-only fields are excluded: testops_id, group_params, run_id, author, testops_project_mapping, preparedAttachments
|
|
197
198
|
return serialized;
|
package/dist/utils/hostData.js
CHANGED
|
@@ -38,6 +38,16 @@ const os = __importStar(require("os"));
|
|
|
38
38
|
const cp = __importStar(require("child_process"));
|
|
39
39
|
const fs = __importStar(require("fs"));
|
|
40
40
|
const get_package_version_1 = require("./get-package-version");
|
|
41
|
+
/**
|
|
42
|
+
* Normalizes platform name to unified format
|
|
43
|
+
* @param {string} platform - process.platform value
|
|
44
|
+
* @returns {string} Normalized platform name
|
|
45
|
+
*/
|
|
46
|
+
function normalizePlatform(platform) {
|
|
47
|
+
if (platform === 'win32')
|
|
48
|
+
return 'windows';
|
|
49
|
+
return platform;
|
|
50
|
+
}
|
|
41
51
|
/**
|
|
42
52
|
* Gets detailed OS information based on the platform
|
|
43
53
|
* @returns {string} Detailed OS information
|
|
@@ -101,13 +111,13 @@ function getNpmVersion() {
|
|
|
101
111
|
function getHostInfo(framework, reporterName) {
|
|
102
112
|
try {
|
|
103
113
|
return {
|
|
104
|
-
system: process.platform,
|
|
114
|
+
system: normalizePlatform(process.platform),
|
|
105
115
|
machineName: os.hostname(),
|
|
106
116
|
release: os.release(),
|
|
107
117
|
version: getDetailedOSInfo(),
|
|
108
118
|
arch: os.arch(),
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
language: process.version,
|
|
120
|
+
packageManager: getNpmVersion(),
|
|
111
121
|
framework: (0, get_package_version_1.getPackageVersion)(framework) ?? '',
|
|
112
122
|
reporter: (0, get_package_version_1.getPackageVersion)(reporterName) ?? '',
|
|
113
123
|
commons: (0, get_package_version_1.getPackageVersion)('qase-javascript-commons') ?? '',
|
|
@@ -117,13 +127,13 @@ function getHostInfo(framework, reporterName) {
|
|
|
117
127
|
}
|
|
118
128
|
catch (error) {
|
|
119
129
|
return {
|
|
120
|
-
system: process.platform,
|
|
130
|
+
system: normalizePlatform(process.platform),
|
|
121
131
|
machineName: os.hostname() || '',
|
|
122
132
|
release: os.release(),
|
|
123
133
|
version: '',
|
|
124
134
|
arch: os.arch(),
|
|
125
|
-
|
|
126
|
-
|
|
135
|
+
language: '',
|
|
136
|
+
packageManager: '',
|
|
127
137
|
framework: '',
|
|
128
138
|
reporter: '',
|
|
129
139
|
commons: '',
|