@testream/dotnet-reporter 0.4.2 โ 0.4.3
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/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -18
- package/dist/index.js.map +1 -1
- package/dist/trx-parser.d.ts +1 -1
- package/dist/trx-parser.d.ts.map +1 -1
- package/dist/types.d.ts +0 -108
- package/dist/types.d.ts.map +1 -1
- package/dist/uploader.d.ts +1 -1
- package/dist/uploader.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { parseTrxFile, parseTrxFiles } from './trx-parser';
|
|
2
2
|
export { uploadToApi, detectGitContext, detectCIContext, defaultLogger } from './uploader';
|
|
3
3
|
export type { Logger, UploadToApiOptions, CIContext } from './uploader';
|
|
4
|
-
export type {
|
|
4
|
+
export type { DotnetReporterConfig } from './types';
|
|
5
|
+
export type { CTRFReport, CTRFTest, CTRFSummary, CTRFResults, UploadResult, } from '@jira-test-manager/shared-types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/dotnet-reporter/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3F,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACxE,YAAY,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,YAAY,
|
|
1
|
+
{"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/dotnet-reporter/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3F,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACxE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,YAAY,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2413,7 +2413,7 @@ async function runDotnetTest(projectPath, additionalArgs = []) {
|
|
|
2413
2413
|
args.push('--results-directory', tempDir);
|
|
2414
2414
|
// Add any additional user-provided args
|
|
2415
2415
|
args.push(...additionalArgs);
|
|
2416
|
-
logger.info('
|
|
2416
|
+
logger.info('Running dotnet test...');
|
|
2417
2417
|
logger.info(` Command: dotnet ${args.join(' ')}`);
|
|
2418
2418
|
logger.info('');
|
|
2419
2419
|
return new Promise((resolve, reject) => {
|
|
@@ -2428,7 +2428,7 @@ async function runDotnetTest(projectPath, additionalArgs = []) {
|
|
|
2428
2428
|
// Find TRX file(s) in the temp directory
|
|
2429
2429
|
try {
|
|
2430
2430
|
const files = await fs.readdir(tempDir);
|
|
2431
|
-
const trxFiles = files.filter(f => f.endsWith('.trx'));
|
|
2431
|
+
const trxFiles = files.filter((f) => f.endsWith('.trx'));
|
|
2432
2432
|
if (trxFiles.length === 0) {
|
|
2433
2433
|
reject(new Error('No TRX file generated. Make sure dotnet test ran successfully.'));
|
|
2434
2434
|
return;
|
|
@@ -2462,7 +2462,7 @@ async function main() {
|
|
|
2462
2462
|
let trxPath;
|
|
2463
2463
|
// Either use provided TRX path or run dotnet test
|
|
2464
2464
|
if (options.trxPath) {
|
|
2465
|
-
logger.info('
|
|
2465
|
+
logger.info('Using existing TRX file(s)...');
|
|
2466
2466
|
trxPath = options.trxPath;
|
|
2467
2467
|
}
|
|
2468
2468
|
else {
|
|
@@ -2471,7 +2471,7 @@ async function main() {
|
|
|
2471
2471
|
logger.info('');
|
|
2472
2472
|
}
|
|
2473
2473
|
// Find TRX files
|
|
2474
|
-
logger.info(
|
|
2474
|
+
logger.info(`Finding TRX files: ${trxPath}`);
|
|
2475
2475
|
const trxFiles = await findTrxFiles(trxPath);
|
|
2476
2476
|
if (trxFiles.length === 0) {
|
|
2477
2477
|
throw new Error(`No TRX files found matching: ${trxPath}`);
|
|
@@ -2482,16 +2482,16 @@ async function main() {
|
|
|
2482
2482
|
}
|
|
2483
2483
|
logger.info('');
|
|
2484
2484
|
// Parse TRX files to CTRF
|
|
2485
|
-
logger.info('
|
|
2485
|
+
logger.info('Converting TRX to CTRF format...');
|
|
2486
2486
|
const report = await (0, trx_parser_1.parseTrxFiles)(trxFiles, options.testTool);
|
|
2487
2487
|
logger.info(` Detected tool: ${report.results.tool.name}`);
|
|
2488
2488
|
logger.info('');
|
|
2489
2489
|
// Skip upload if disabled
|
|
2490
2490
|
if (!options.uploadEnabled) {
|
|
2491
|
-
logger.info('
|
|
2491
|
+
logger.info('Upload disabled, skipping API upload');
|
|
2492
2492
|
logger.info('');
|
|
2493
2493
|
logger.info('='.repeat(60));
|
|
2494
|
-
logger.info('
|
|
2494
|
+
logger.info('Test run completed (upload skipped)');
|
|
2495
2495
|
logger.info(` Tests: ${report.results.summary.tests}`);
|
|
2496
2496
|
logger.info(` Passed: ${report.results.summary.passed}`);
|
|
2497
2497
|
logger.info(` Failed: ${report.results.summary.failed}`);
|
|
@@ -2538,7 +2538,7 @@ async function main() {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
catch (error) {
|
|
2540
2540
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
2541
|
-
logger.error(
|
|
2541
|
+
logger.error(`Error: ${errorMessage}`);
|
|
2542
2542
|
process.exit(1);
|
|
2543
2543
|
}
|
|
2544
2544
|
}
|
|
@@ -2870,7 +2870,7 @@ async function parseTrxFiles(trxPaths, testTool) {
|
|
|
2870
2870
|
/***/ }),
|
|
2871
2871
|
|
|
2872
2872
|
/***/ 10:
|
|
2873
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
2873
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2874
2874
|
|
|
2875
2875
|
"use strict";
|
|
2876
2876
|
|
|
@@ -2878,6 +2878,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2878
2878
|
exports.detectGitContext = exports.defaultLogger = void 0;
|
|
2879
2879
|
exports.uploadToApi = uploadToApi;
|
|
2880
2880
|
exports.detectCIContext = detectCIContext;
|
|
2881
|
+
const crypto_1 = __nccwpck_require__(982);
|
|
2881
2882
|
/**
|
|
2882
2883
|
* Hardcoded API URL for Testream backend
|
|
2883
2884
|
*/
|
|
@@ -2895,15 +2896,20 @@ exports.defaultLogger = {
|
|
|
2895
2896
|
*/
|
|
2896
2897
|
async function uploadToApi(options) {
|
|
2897
2898
|
const { report, projectKey, apiKey, commitSha = '', branch = '', repositoryUrl = '', buildName, buildNumber, buildUrl, testEnvironment, appName, appVersion, testType, logger = exports.defaultLogger, } = options;
|
|
2899
|
+
// Ensure reportId exists
|
|
2900
|
+
if (!report.reportId) {
|
|
2901
|
+
report.reportId = (0, crypto_1.randomUUID)();
|
|
2902
|
+
logger.info(`Generated reportId: ${report.reportId}`);
|
|
2903
|
+
}
|
|
2898
2904
|
try {
|
|
2899
2905
|
logger.info('='.repeat(60));
|
|
2900
|
-
logger.info('
|
|
2906
|
+
logger.info('Testream - .NET Test Results Upload');
|
|
2901
2907
|
logger.info('='.repeat(60));
|
|
2902
2908
|
logger.info(`API URL: ${API_URL}`);
|
|
2903
2909
|
logger.info(`Project Key: ${projectKey}`);
|
|
2904
2910
|
logger.info(`Test Tool: ${report.results.tool.name}`);
|
|
2905
2911
|
logger.info('');
|
|
2906
|
-
logger.info(
|
|
2912
|
+
logger.info(`Test Summary:`);
|
|
2907
2913
|
logger.info(` Total: ${report.results.summary.tests}`);
|
|
2908
2914
|
logger.info(` Passed: ${report.results.summary.passed}`);
|
|
2909
2915
|
logger.info(` Failed: ${report.results.summary.failed}`);
|
|
@@ -2911,7 +2917,7 @@ async function uploadToApi(options) {
|
|
|
2911
2917
|
logger.info('');
|
|
2912
2918
|
// Log git context if provided
|
|
2913
2919
|
if (branch || commitSha || repositoryUrl) {
|
|
2914
|
-
logger.info(
|
|
2920
|
+
logger.info(`Git Context:`);
|
|
2915
2921
|
if (branch)
|
|
2916
2922
|
logger.info(` Branch: ${branch}`);
|
|
2917
2923
|
if (commitSha)
|
|
@@ -2922,7 +2928,7 @@ async function uploadToApi(options) {
|
|
|
2922
2928
|
}
|
|
2923
2929
|
// Log build info if provided
|
|
2924
2930
|
if (buildName || buildNumber || buildUrl) {
|
|
2925
|
-
logger.info(
|
|
2931
|
+
logger.info(`Build Info:`);
|
|
2926
2932
|
if (buildName)
|
|
2927
2933
|
logger.info(` Name: ${buildName}`);
|
|
2928
2934
|
if (buildNumber)
|
|
@@ -2933,7 +2939,7 @@ async function uploadToApi(options) {
|
|
|
2933
2939
|
}
|
|
2934
2940
|
// Log environment info if provided
|
|
2935
2941
|
if (testEnvironment || appName || appVersion || testType) {
|
|
2936
|
-
logger.info(
|
|
2942
|
+
logger.info(`Environment:`);
|
|
2937
2943
|
if (testEnvironment)
|
|
2938
2944
|
logger.info(` Environment: ${testEnvironment}`);
|
|
2939
2945
|
if (appName)
|
|
@@ -2964,7 +2970,7 @@ async function uploadToApi(options) {
|
|
|
2964
2970
|
testType,
|
|
2965
2971
|
};
|
|
2966
2972
|
// Upload to API
|
|
2967
|
-
logger.info(
|
|
2973
|
+
logger.info(`Uploading test results...`);
|
|
2968
2974
|
logger.info(` Report ID: ${report.reportId}`);
|
|
2969
2975
|
let response;
|
|
2970
2976
|
try {
|
|
@@ -2995,7 +3001,7 @@ async function uploadToApi(options) {
|
|
|
2995
3001
|
}
|
|
2996
3002
|
// Handle 409 (already exists)
|
|
2997
3003
|
if (response.status === 409) {
|
|
2998
|
-
logger.warning(
|
|
3004
|
+
logger.warning(`Report already exists: ${errorData?.reportId || 'unknown'}`);
|
|
2999
3005
|
logger.info('This is expected if the workflow was re-run');
|
|
3000
3006
|
return {
|
|
3001
3007
|
success: true,
|
|
@@ -3017,7 +3023,7 @@ async function uploadToApi(options) {
|
|
|
3017
3023
|
const result = (await response.json());
|
|
3018
3024
|
logger.info('');
|
|
3019
3025
|
logger.info('='.repeat(60));
|
|
3020
|
-
logger.info('
|
|
3026
|
+
logger.info('Upload completed successfully');
|
|
3021
3027
|
logger.info(` Report ID: ${result.reportId}`);
|
|
3022
3028
|
logger.info(` Test Run ID: ${result.testRunId}`);
|
|
3023
3029
|
logger.info('='.repeat(60));
|
|
@@ -3030,7 +3036,7 @@ async function uploadToApi(options) {
|
|
|
3030
3036
|
}
|
|
3031
3037
|
catch (error) {
|
|
3032
3038
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3033
|
-
logger.error(
|
|
3039
|
+
logger.error(`Upload failed: ${errorMessage}`);
|
|
3034
3040
|
return {
|
|
3035
3041
|
success: false,
|
|
3036
3042
|
reportId: '',
|
|
@@ -3124,6 +3130,14 @@ module.exports = require("child_process");
|
|
|
3124
3130
|
|
|
3125
3131
|
/***/ }),
|
|
3126
3132
|
|
|
3133
|
+
/***/ 982:
|
|
3134
|
+
/***/ ((module) => {
|
|
3135
|
+
|
|
3136
|
+
"use strict";
|
|
3137
|
+
module.exports = require("crypto");
|
|
3138
|
+
|
|
3139
|
+
/***/ }),
|
|
3140
|
+
|
|
3127
3141
|
/***/ 896:
|
|
3128
3142
|
/***/ ((module) => {
|
|
3129
3143
|
|