Skip to content

fix: preserve camelCase metadata in machine-readable summaries#6079

Open
immanuwell wants to merge 1 commit into
grafana:masterfrom
immanuwell:fix-machine-readable-summary-metadata
Open

fix: preserve camelCase metadata in machine-readable summaries#6079
immanuwell wants to merge 1 commit into
grafana:masterfrom
immanuwell:fix-machine-readable-summary-metadata

Conversation

@immanuwell

Copy link
Copy Markdown
Contributor

What?

Fix machine-readable summary metadata keys.

Repro:
printf 'export default function() {}\n' > script.js
k6 run --summary-export=summary.json --new-machine-readable-summary=true script.js

Before:
metadata.generated_at
metadata.k6_version

After:
metadata.generatedAt
metadata.k6Version

Why?

This is easy to hit on a plain local run, no cloud bits or quotas involved.
The new summary was going through JS as Go structs, so Sobek rewrote the field names to snake_case. Bit sneaky.
This switches that path to JSON-compatible maps and adds tests for handleSummary(data) and CLI export.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (make check) and all pass.

Checklist: Documentation (only for k6 maintainers and if relevant)

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

Closes #6004

@immanuwell immanuwell requested a review from a team as a code owner June 12, 2026 10:29
@immanuwell immanuwell requested review from mstoykov and oleiade and removed request for a team June 12, 2026 10:29
@immanuwell immanuwell temporarily deployed to azure-trusted-signing June 12, 2026 20:24 — with GitHub Actions Inactive
@immanuwell immanuwell temporarily deployed to azure-trusted-signing June 12, 2026 20:25 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metadata.k6_version in summary.json should be k6Version when producing machine-readable-summary

1 participant