@testream/dotnet-reporter 0.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/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ Proprietary License
2
+
3
+ Copyright (c) 2025 Jira Test Manager Team. All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are licensed,
6
+ not sold, to you for use only under the terms of this license.
7
+
8
+ GRANT OF LICENSE:
9
+ You are granted a non-exclusive, non-transferable license to use the Software
10
+ solely for the purpose of integrating test result reporting with the Jira Test
11
+ Manager service.
12
+
13
+ RESTRICTIONS:
14
+ - You may not modify, adapt, or create derivative works of the Software
15
+ - You may not distribute, sublicense, lease, or rent the Software
16
+ - You may not reverse engineer, decompile, or disassemble the Software
17
+ - The Software may only be used in conjunction with the Jira Test Manager service
18
+
19
+ OWNERSHIP:
20
+ The Software is licensed, not sold. This license does not grant you any rights
21
+ to trademarks or service marks.
22
+
23
+ TERMINATION:
24
+ This license is effective until terminated. Your rights under this license will
25
+ terminate automatically without notice if you fail to comply with any term of
26
+ this license.
27
+
28
+ DISCLAIMER:
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
package/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # @testream/dotnet-reporter
2
+
3
+ Run .NET tests and upload results to Testream with a **single command**.
4
+
5
+ ## Features
6
+
7
+ - **Zero Configuration** - Just run and upload, no TRX path needed
8
+ - **All .NET Frameworks** - Works with xUnit, NUnit, and MSTest
9
+ - **Auto-Detection** - Detects test framework and git context automatically
10
+ - **CI/CD Ready** - Works in GitHub Actions, GitLab CI, Azure Pipelines, and more
11
+
12
+ ## Quick Start
13
+
14
+ ```bash
15
+ # One command does everything!
16
+ npx @testream/dotnet-reporter -p MYPROJ -k your-api-key
17
+ ```
18
+
19
+ That's it! The CLI will:
20
+ 1. Run `dotnet test`
21
+ 2. Generate a test report
22
+ 3. Upload to Testream
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ # Use directly with npx (recommended)
28
+ npx @testream/dotnet-reporter ...
29
+
30
+ # Or install globally
31
+ npm install -g @testream/dotnet-reporter
32
+ testream-dotnet ...
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ ### Basic Usage
38
+
39
+ ```bash
40
+ # Run tests in current directory and upload
41
+ npx @testream/dotnet-reporter -p MYPROJ -k $API_KEY
42
+
43
+ # Run tests for a specific project
44
+ npx @testream/dotnet-reporter -p MYPROJ -k $API_KEY --project ./MyTests
45
+
46
+ # Run tests for a solution
47
+ npx @testream/dotnet-reporter -p MYPROJ -k $API_KEY --project ./MySolution.sln
48
+ ```
49
+
50
+ ### Pass Arguments to dotnet test
51
+
52
+ ```bash
53
+ # Filter tests
54
+ npx @testream/dotnet-reporter -p MYPROJ -k $API_KEY -- --filter "Category=Unit"
55
+
56
+ # Set configuration
57
+ npx @testream/dotnet-reporter -p MYPROJ -k $API_KEY -- --configuration Release
58
+
59
+ # Multiple arguments
60
+ npx @testream/dotnet-reporter -p MYPROJ -k $API_KEY -- --filter "Category=Unit" --no-build
61
+ ```
62
+
63
+ ### Use Existing TRX File
64
+
65
+ If you've already run tests and have TRX file(s):
66
+
67
+ ```bash
68
+ npx @testream/dotnet-reporter -p MYPROJ -k $API_KEY --trx-path TestResults/*.trx
69
+ ```
70
+
71
+ ## CLI Options
72
+
73
+ | Option | Description |
74
+ |--------|-------------|
75
+ | `-p, --project-key` | **(Required)** Jira project key |
76
+ | `-k, --api-key` | **(Required)** API key for authentication |
77
+ | `--project <path>` | Path to .NET project/solution (defaults to current directory) |
78
+ | `--trx-path <path>` | Use existing TRX file(s) instead of running tests |
79
+ | `--test-tool` | Test framework name (auto-detected) |
80
+ | `--branch` | Git branch (auto-detected in CI) |
81
+ | `--commit-sha` | Git commit SHA (auto-detected in CI) |
82
+ | `-- <args>` | Additional arguments to pass to `dotnet test` |
83
+
84
+ ## GitHub Actions Example
85
+
86
+ ```yaml
87
+ name: Tests
88
+
89
+ on: [push, pull_request]
90
+
91
+ jobs:
92
+ test:
93
+ runs-on: ubuntu-latest
94
+ steps:
95
+ - uses: actions/checkout@v4
96
+
97
+ - name: Setup .NET
98
+ uses: actions/setup-dotnet@v4
99
+ with:
100
+ dotnet-version: '8.0.x'
101
+
102
+ - name: Run tests and upload
103
+ run: |
104
+ npx @testream/dotnet-reporter \
105
+ -p ${{ secrets.PROJECT_KEY }} \
106
+ -k ${{ secrets.API_KEY }} \
107
+ --project ./MySolution.sln \
108
+ --test-tool xunit \
109
+ --branch ${{ github.ref_name }} \
110
+ --commit-sha ${{ github.sha }} \
111
+ --repository-url ${{ github.server_url }}/${{ github.repository }} \
112
+ --build-name ${{ github.workflow }} \
113
+ --build-number ${{ github.run_number }} \
114
+ --build-url ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \
115
+ --test-environment ci \
116
+ --app-name MyApp \
117
+ --app-version 1.0.0 \
118
+ --test-type unit \
119
+ --fail-on-error \
120
+ -- --configuration Release
121
+ ```
122
+
123
+ ## How It Works
124
+
125
+ ```
126
+ ┌──────────────────────────────────────────┐
127
+ │ @testream/dotnet-reporter │
128
+ ├──────────────────────────────────────────┤
129
+ │ 1. Run dotnet test │
130
+ │ 2. Generate report │
131
+ │ 3. Upload to Testream │
132
+ └──────────────────────────────────────────┘
133
+ ```
134
+
135
+ It all happens automatically - just provide your project key and API key!
136
+
137
+ ## Supported Frameworks
138
+
139
+ | Framework | Version | Status |
140
+ |-----------|---------|--------|
141
+ | xUnit | 2.x+ | ✅ Tested |
142
+ | NUnit | 4.x+ | ✅ Tested |
143
+ | MSTest | 3.x+ | ✅ Tested |
144
+
145
+ ## Supported CI Platforms
146
+
147
+ Git context (branch, commit, repository) is auto-detected in:
148
+
149
+ - GitHub Actions
150
+ - GitLab CI
151
+ - Azure Pipelines
152
+ - CircleCI
153
+ - Jenkins
154
+ - Bitbucket Pipelines
155
+
156
+ ## License
157
+
158
+ See [LICENSE](./LICENSE) file.
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///home/runner/work/jira-test-manager/jira-test-manager/packages/dotnet-reporter/src/cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export { parseTrxFile, parseTrxFiles } from './trx-parser';
2
+ export { uploadToApi, detectGitContext, detectCIContext, defaultLogger } from './uploader';
3
+ export type { Logger, UploadToApiOptions, CIContext } from './uploader';
4
+ export type { CTRFReport, CTRFTest, CTRFSummary, CTRFResults, UploadResult, DotnetReporterConfig, } from './types';
@@ -0,0 +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,EACZ,oBAAoB,GACrB,MAAM,SAAS,CAAC"}