Skip to content

Commit 1e9d9ed

Browse files
authored
fix(runner): generate report.json when --format json is specified for run subcommand (#58)
* fix(runner): add json report generation for consistency with other formats * fix(changelog): document json report generation fix for consistency
1 parent ffcfe49 commit 1e9d9ed

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.1] - 2026-05-22
9+
10+
### Fixed
11+
- `skill-up run --format json` now generates `report.json` in the iteration
12+
output directory. Previously the `"json"` format was silently skipped
13+
because `result.json` is always written unconditionally; this made
14+
`--format json` a no-op and was inconsistent with `skill-up report --format json`
15+
which correctly produced `report.json`.
16+
817
## [0.2.0] - 2026-05-21
918

1019
### Changed
@@ -98,6 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
98107
project and delivers the end-to-end capability to declare eval environments,
99108
run cases and emit structured reports as described in [README.md](README.md).
100109

110+
[0.2.1]: https://github.com/alibaba/skill-up/releases/tag/v0.2.1
101111
[0.2.0]: https://github.com/alibaba/skill-up/releases/tag/v0.2.0
102112
[0.1.2]: https://github.com/alibaba/skill-up/releases/tag/v0.1.2
103113
[0.1.1]: https://github.com/alibaba/skill-up/releases/tag/v0.1.1

internal/runner/runner.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,16 @@ func (r *Runner) writeGroupedCaseArtifacts(ws *report.IterationWorkspace, groupe
309309
}
310310

311311
// writeFormattedReports generates report files for each requested format.
312-
// "json" is silently skipped because result.json is always written by the caller.
312+
// Note: result.json is always written by the caller as the raw data source;
313+
// "json" here additionally produces report.json for consistency with other formats.
313314
func writeFormattedReports(ctx context.Context, iterDir string, formats []string, input report.Input) error {
314315
for _, format := range formats {
315316
switch format {
316317
case "json":
317-
// result.json already written; skip.
318+
reporter := &report.JSONReporter{OutputPath: filepath.Join(iterDir, "report.json")}
319+
if err := reporter.Write(ctx, input); err != nil {
320+
return fmt.Errorf("write json report: %w", err)
321+
}
318322
case "junit":
319323
reporter := &report.JUnitReporter{OutputPath: filepath.Join(iterDir, "report.xml")}
320324
if err := reporter.Write(ctx, input); err != nil {

0 commit comments

Comments
 (0)