@freshworks/shiftleft-tools 1.1.14 → 1.1.15
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/package.json +1 -1
- package/templates/postman/scripts/lib/__pycache__/report_combined.cpython-310.pyc +0 -0
- package/templates/postman/scripts/lib/__pycache__/report_consolidated.cpython-310.pyc +0 -0
- package/templates/postman/scripts/lib/__pycache__/report_migration.cpython-310.pyc +0 -0
- package/templates/postman/scripts/lib/__pycache__/report_mutation.cpython-310.pyc +0 -0
- package/templates/postman/scripts/lib/__pycache__/report_unit.cpython-310.pyc +0 -0
- package/templates/postman/scripts/lib/__pycache__/report_utils.cpython-310.pyc +0 -0
- package/templates/postman/scripts/lib/report_consolidated.py +13 -1
- package/templates/postman/scripts/report-generators/generate-consolidated-report.sh +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freshworks/shiftleft-tools",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"description": "CLI for managing Cursor rules/skills and Postman test infrastructure across Java Spring Boot and Node.js/Express projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
Binary file
|
|
Binary file
|
|
@@ -135,7 +135,19 @@ def generate_consolidated_report(args):
|
|
|
135
135
|
for col in json.loads(args.collection_links):
|
|
136
136
|
f = col.get('file', '')
|
|
137
137
|
slug = f.split('/')[0] if '/' in f else 'legacy'
|
|
138
|
-
|
|
138
|
+
total_a = int(col.get('assertions_total', 0) or 0)
|
|
139
|
+
failed_a = int(col.get('assertions_failed', 0) or 0)
|
|
140
|
+
passed_a = max(total_a - failed_a, 0)
|
|
141
|
+
collections.append({
|
|
142
|
+
'name': col.get('name', ''),
|
|
143
|
+
'file': f,
|
|
144
|
+
'product_slug': slug,
|
|
145
|
+
'assertions_total': total_a,
|
|
146
|
+
'assertions_passed': passed_a,
|
|
147
|
+
'assertions_failed': failed_a,
|
|
148
|
+
'detail_href': f"{f}#pills-failed" if failed_a > 0 else f,
|
|
149
|
+
'status': 'passed' if failed_a == 0 else 'failed',
|
|
150
|
+
})
|
|
139
151
|
except json.JSONDecodeError:
|
|
140
152
|
pass
|
|
141
153
|
|
|
@@ -130,12 +130,15 @@ for json_file in "${JSON_FILES[@]}"; do
|
|
|
130
130
|
html_file="${col_name}-${TIMESTAMP}.html"
|
|
131
131
|
display_name=$(echo "$col_name" | sed 's/-/ /g' | sed 's/^[0-9]* //')
|
|
132
132
|
fi
|
|
133
|
+
# Per-collection assertion counts so the report cards show passed/failed.
|
|
134
|
+
col_total=$(jq '.run.stats.assertions.total // 0' "$json_file" 2>/dev/null || echo 0)
|
|
135
|
+
col_failed=$(jq '.run.stats.assertions.failed // 0' "$json_file" 2>/dev/null || echo 0)
|
|
133
136
|
if [ "$first" = true ]; then
|
|
134
137
|
first=false
|
|
135
138
|
else
|
|
136
139
|
COLLECTION_LINKS_JSON="${COLLECTION_LINKS_JSON},"
|
|
137
140
|
fi
|
|
138
|
-
COLLECTION_LINKS_JSON="${COLLECTION_LINKS_JSON}{\"name\":\"${display_name}\",\"file\":\"${html_file}\"}"
|
|
141
|
+
COLLECTION_LINKS_JSON="${COLLECTION_LINKS_JSON}{\"name\":\"${display_name}\",\"file\":\"${html_file}\",\"assertions_total\":${col_total},\"assertions_failed\":${col_failed}}"
|
|
139
142
|
done
|
|
140
143
|
COLLECTION_LINKS_JSON="${COLLECTION_LINKS_JSON}]"
|
|
141
144
|
|