@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freshworks/shiftleft-tools",
3
- "version": "1.1.14",
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",
@@ -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
- collections.append({'name': col.get('name', ''), 'file': f, 'product_slug': slug})
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