zephyr-enterprise-tools 1.0.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 +21 -0
- package/README.md +260 -0
- package/cli.js +465 -0
- package/package.json +53 -0
- package/zephyr-enterprise-tools.js +1129 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zephyr Quality Gates Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# Zephyr Enterprise Tools
|
|
2
|
+
|
|
3
|
+
Comprehensive tools for Zephyr Enterprise - Release Readiness, Project Health, Test Analytics & More.
|
|
4
|
+
|
|
5
|
+
## 🛠️ Available Tools
|
|
6
|
+
|
|
7
|
+
### 🚦 Release Readiness (Quality Gates)
|
|
8
|
+
|
|
9
|
+
| Tool | Description | Thresholds |
|
|
10
|
+
|------|-------------|------------|
|
|
11
|
+
| `release-readiness` | Run all 4 quality gates | Combined assessment |
|
|
12
|
+
| `requirement-coverage` | Are requirements covered by tests? | ≥70% = GO |
|
|
13
|
+
| `test-plan` | Are tests planned and assigned? | <80% = NO GO, 80-90% = CONDITIONAL, ≥90% = GO |
|
|
14
|
+
| `test-execution` | Have tests been executed? | <90% = NO GO, 90-97% = CONDITIONAL, ≥97% = GO |
|
|
15
|
+
| `defect-quality` | Are critical defects resolved? | Blocker >0 = NO GO, High-risk >10 = NO GO |
|
|
16
|
+
|
|
17
|
+
### 📊 Analytics & Insights
|
|
18
|
+
|
|
19
|
+
| Tool | Description |
|
|
20
|
+
|------|-------------|
|
|
21
|
+
| `project-health` | Overall project health score (0-100) with status |
|
|
22
|
+
| `test-coverage` | Detailed test coverage analysis |
|
|
23
|
+
| `failed-tests` | List and analyze failed tests |
|
|
24
|
+
| `req-coverage` | Requirements with/without test coverage |
|
|
25
|
+
| `test-trends` | Test execution trends over time |
|
|
26
|
+
| `search-tests` | Search test cases by query |
|
|
27
|
+
| `user-activity` | User activity and productivity metrics |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 📦 Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Install from npm
|
|
35
|
+
npm install -g zephyr-Enterprise-tools
|
|
36
|
+
|
|
37
|
+
# Or install locally
|
|
38
|
+
npm install zephyr-Enterprise-tools
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## ⚙️ Configuration
|
|
44
|
+
|
|
45
|
+
Set environment variables:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
export ZEPHYR_BASE_URL="https://your-zephyr.com/flex/services/rest/latest"
|
|
49
|
+
export ZEPHYR_USERNAME="your-username"
|
|
50
|
+
export ZEPHYR_PASSWORD="your-password"
|
|
51
|
+
|
|
52
|
+
# Or use a bearer token instead:
|
|
53
|
+
export ZEPHYR_TOKEN="your-token"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🖥️ CLI Usage
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Run all quality gates (release readiness)
|
|
62
|
+
zephyr-tools -p <projectId> -r <releaseId>
|
|
63
|
+
|
|
64
|
+
# Run specific tool
|
|
65
|
+
zephyr-tools -p 364 -r 4312 -t project-health
|
|
66
|
+
zephyr-tools -p 364 -r 4312 -t failed-tests
|
|
67
|
+
zephyr-tools -p 364 -r 4312 -t user-activity
|
|
68
|
+
|
|
69
|
+
# Search test cases
|
|
70
|
+
zephyr-tools -p 364 -r 4312 -t search-tests -q "login"
|
|
71
|
+
|
|
72
|
+
# Get trends for last 14 days
|
|
73
|
+
zephyr-tools -p 364 -r 4312 -t test-trends -d 14
|
|
74
|
+
|
|
75
|
+
# JSON output (for CI/CD)
|
|
76
|
+
zephyr-tools -p 364 -r 4312 --json
|
|
77
|
+
|
|
78
|
+
# Help
|
|
79
|
+
zephyr-tools --help
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### CLI Options
|
|
83
|
+
|
|
84
|
+
| Option | Description |
|
|
85
|
+
|--------|-------------|
|
|
86
|
+
| `-p, --project <id>` | Project ID (required) |
|
|
87
|
+
| `-r, --release <id>` | Release ID (required) |
|
|
88
|
+
| `-t, --tool <name>` | Tool to run (default: release-readiness) |
|
|
89
|
+
| `-q, --query <text>` | Search query (for search-tests) |
|
|
90
|
+
| `-d, --days <n>` | Days for trends/activity (default: 30) |
|
|
91
|
+
| `-l, --limit <n>` | Max results (default: 50) |
|
|
92
|
+
| `--json` | Output as JSON |
|
|
93
|
+
| `-h, --help` | Show help |
|
|
94
|
+
|
|
95
|
+
### Exit Codes
|
|
96
|
+
- `0` = GO / Healthy
|
|
97
|
+
- `1` = CONDITIONAL GO / At Risk
|
|
98
|
+
- `2` = NO GO / Critical
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 📚 Programmatic Usage
|
|
103
|
+
|
|
104
|
+
```javascript
|
|
105
|
+
import QualityGates from 'zephyr-quality-gates';
|
|
106
|
+
// Or with the new filename:
|
|
107
|
+
// import ZephyrTools from './zephyr-enterprise-tools.js';
|
|
108
|
+
|
|
109
|
+
const tools = new QualityGates({
|
|
110
|
+
baseUrl: 'https://your-zephyr.com/flex/services/rest/latest',
|
|
111
|
+
username: 'user',
|
|
112
|
+
password: 'pass',
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// ── Release Readiness ──────────────────────────────────────
|
|
116
|
+
const report = await tools.runAllGates(364, 4312);
|
|
117
|
+
console.log(report.overallStatus); // "GO" | "CONDITIONAL GO" | "NO GO"
|
|
118
|
+
|
|
119
|
+
// Individual gates
|
|
120
|
+
const coverage = await tools.requirementCoverageGate(364, 4312);
|
|
121
|
+
const planning = await tools.testPlanAnalysisGate(364, 4312);
|
|
122
|
+
const execution = await tools.testExecutionGate(364, 4312);
|
|
123
|
+
const defects = await tools.defectQualityGate(364, 4312);
|
|
124
|
+
|
|
125
|
+
// ── Analytics & Insights ───────────────────────────────────
|
|
126
|
+
const health = await tools.getProjectHealth(364, 4312);
|
|
127
|
+
console.log(health.healthScore); // 0-100
|
|
128
|
+
|
|
129
|
+
const coverage = await tools.getTestCoverage(364, 4312);
|
|
130
|
+
const failed = await tools.getFailedTests(364, 4312, { limit: 20 });
|
|
131
|
+
const reqCoverage = await tools.getRequirementCoverage(364, 4312);
|
|
132
|
+
const trends = await tools.getTestCaseTrends(364, 4312, { days: 14 });
|
|
133
|
+
const results = await tools.searchTestCases(364, 4312, { query: 'login' });
|
|
134
|
+
const activity = await tools.getUserActivity(364, 4312, { days: 30 });
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 📊 Sample Outputs
|
|
140
|
+
|
|
141
|
+
### Release Readiness Report
|
|
142
|
+
```
|
|
143
|
+
════════════════════════════════════════════════════════════════════════════════
|
|
144
|
+
RELEASE READINESS REPORT
|
|
145
|
+
════════════════════════════════════════════════════════════════════════════════
|
|
146
|
+
Project: 364 | Release: 4312 | 2026-08-12T10:30:00.000Z
|
|
147
|
+
────────────────────────────────────────────────────────────────────────────────
|
|
148
|
+
|
|
149
|
+
┌─────────────────────────┬──────────┬───────────┬─────────────────────────┐
|
|
150
|
+
│ Gate │ Score │ Status │ Threshold │
|
|
151
|
+
├─────────────────────────┼──────────┼───────────┼─────────────────────────┤
|
|
152
|
+
│ Requirement Coverage │ 37.04% │ 🔴 NO GO │ ≥70% coverage │
|
|
153
|
+
│ Test Plan Analysis │ 19.53% │ 🔴 NO GO │ ≥90% planned & assigned │
|
|
154
|
+
│ Test Execution │ 80% │ 🔴 NO GO │ ≥97% executed │
|
|
155
|
+
│ Defect Quality │ 0B/0H │ 🟢 GO │ 0 blocker, ≤10 high │
|
|
156
|
+
└─────────────────────────┴──────────┴───────────┴─────────────────────────┘
|
|
157
|
+
|
|
158
|
+
OVERALL: 🔴 NO GO (1/4 passed, 3 failed, 0 conditional)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Project Health
|
|
162
|
+
```
|
|
163
|
+
══════════════════════════════════════════════════════════════════════
|
|
164
|
+
PROJECT HEALTH
|
|
165
|
+
══════════════════════════════════════════════════════════════════════
|
|
166
|
+
Health Score: 🟡 65/100 (MODERATE)
|
|
167
|
+
|
|
168
|
+
📈 METRICS:
|
|
169
|
+
Requirements:
|
|
170
|
+
Total: 135, Covered: 50, Coverage: 37.04%
|
|
171
|
+
Executions:
|
|
172
|
+
Total: 100, Passed: 80, Failed: 10
|
|
173
|
+
Execution Rate: 90%, Pass Rate: 89%
|
|
174
|
+
|
|
175
|
+
💡 RECOMMENDATIONS:
|
|
176
|
+
• Improve requirement coverage from 37.04% to ≥70%
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### User Activity
|
|
180
|
+
```
|
|
181
|
+
══════════════════════════════════════════════════════════════════════
|
|
182
|
+
USER ACTIVITY
|
|
183
|
+
══════════════════════════════════════════════════════════════════════
|
|
184
|
+
👥 TEAM SUMMARY:
|
|
185
|
+
Active Users: 5
|
|
186
|
+
Team Completion Rate: 85%
|
|
187
|
+
Team Pass Rate: 78%
|
|
188
|
+
|
|
189
|
+
👤 USERS:
|
|
190
|
+
┌─────────────────────────┬────────┬────────┬────────┬────────┐
|
|
191
|
+
│ User │ Assign │ Exec │ Pass% │ Comp% │
|
|
192
|
+
├─────────────────────────┼────────┼────────┼────────┼────────┤
|
|
193
|
+
│ John Smith │ 50 │ 45 │ 82% │ 90% │
|
|
194
|
+
│ Jane Doe │ 30 │ 28 │ 75% │ 93% │
|
|
195
|
+
└─────────────────────────┴────────┴────────┴────────┴────────┘
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 🔧 CI/CD Integration
|
|
201
|
+
|
|
202
|
+
### GitHub Actions
|
|
203
|
+
|
|
204
|
+
```yaml
|
|
205
|
+
- name: Check Release Readiness
|
|
206
|
+
env:
|
|
207
|
+
ZEPHYR_BASE_URL: ${{ secrets.ZEPHYR_URL }}
|
|
208
|
+
ZEPHYR_USERNAME: ${{ secrets.ZEPHYR_USER }}
|
|
209
|
+
ZEPHYR_PASSWORD: ${{ secrets.ZEPHYR_PASS }}
|
|
210
|
+
run: |
|
|
211
|
+
npx zephyr-quality-gates -p ${{ vars.PROJECT_ID }} -r ${{ vars.RELEASE_ID }} --json > report.json
|
|
212
|
+
cat report.json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Jenkins
|
|
216
|
+
|
|
217
|
+
```groovy
|
|
218
|
+
stage('Quality Gates') {
|
|
219
|
+
environment {
|
|
220
|
+
ZEPHYR_BASE_URL = credentials('zephyr-url')
|
|
221
|
+
ZEPHYR_USERNAME = credentials('zephyr-user')
|
|
222
|
+
ZEPHYR_PASSWORD = credentials('zephyr-pass')
|
|
223
|
+
}
|
|
224
|
+
steps {
|
|
225
|
+
sh 'node quality-gates/cli.js -p ${PROJECT_ID} -r ${RELEASE_ID}'
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 📝 Customizing Thresholds
|
|
233
|
+
|
|
234
|
+
Edit `quality-gates.js`:
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
export const THRESHOLDS = {
|
|
238
|
+
requirementCoverage: {
|
|
239
|
+
go: 70, // Change to 80 for stricter requirements
|
|
240
|
+
},
|
|
241
|
+
testPlanAnalysis: {
|
|
242
|
+
noGo: 80,
|
|
243
|
+
conditionalGo: 90,
|
|
244
|
+
},
|
|
245
|
+
testExecution: {
|
|
246
|
+
noGo: 90,
|
|
247
|
+
conditionalGo: 97,
|
|
248
|
+
},
|
|
249
|
+
defectQuality: {
|
|
250
|
+
blockerLimit: 0,
|
|
251
|
+
highRiskLimit: 10, // Change to 5 for stricter defect policy
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 📄 License
|
|
259
|
+
|
|
260
|
+
MIT
|