-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Revamp the machine-readable (JSON) end-of-test summary #5338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4b9b2dd
Add script to checkout k6-summary schemas
joanlopez 8a26f54
Add script to generate code from k6-summary schemas
joanlopez ab2de19
Code generated from k6-summary with 'grafana/cog'
joanlopez d26ef6c
Make 'cog' templates golangci-lint friendly
joanlopez 0fd90d0
GitHub Workflow to verify that the cog-generated code is up-to-date
joanlopez e8c91e1
Add script to clean up code-generation stuff
joanlopez 7596609
Opt-out option to disable the machine-readable summary
joanlopez 03e6969
Machine-readable summary for --summary-export/handleSummary()
joanlopez bba2f08
End-to-end test for the machine-readable summary
joanlopez 50d7e52
Merge remote-tracking branch 'upstream/master' into k6-summary
joanlopez 407fdc5
Fix runtime options tests with the new default
joanlopez c813026
Make TestMachineReadableSummary date regexp UTC-compliant
joanlopez 7eb7bdd
Make linter happy again
joanlopez 0ff344a
Fix panic on nil Summary.Checks
joanlopez 711b3b0
Merge remote-tracking branch 'upstream/master' into k6-summary
joanlopez 0616bb7
Flip the option to enable the new machine-readable summary
joanlopez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: Summary code generation | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check-generated-code: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install cog | ||
| run: | | ||
| COG_VERSION="v0.0.46" | ||
| curl -sSL "https://github.com/grafana/cog/releases/download/${COG_VERSION}/cog_Linux_x86_64.tar.gz" \ | ||
| | sudo tar -xz -C /usr/local/bin | ||
| cog --version | ||
|
|
||
| - name: Checkout schemas | ||
| run: | | ||
| ./internal/lib/summary/machinereadable/checkout.sh | ||
|
|
||
| - name: Generate code | ||
| run: | | ||
| ./internal/lib/summary/machinereadable/generate.sh | ||
|
|
||
| - name: Check for uncommitted changes | ||
| run: | | ||
| # Check if there are any changes in the Git working directory | ||
| if ! git diff --exit-code; then | ||
| echo "❌ Generated code is not up-to-date!" | ||
| echo "" | ||
| echo "The following files have uncommitted changes:" | ||
| git diff --name-only | ||
| echo "" | ||
| echo "Please run the following commands to update the generated code:" | ||
| echo " ./internal/lib/summary/machinereadable/checkout.sh" | ||
| echo " ./internal/lib/summary/machinereadable/generate.sh" | ||
| echo "" | ||
| echo "Then commit the changes." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Also check for untracked files | ||
| if [ -n "$(git ls-files --others --exclude-standard internal/lib/summary/machinereadable/ | grep -v k6-summary/)" ]; then | ||
| echo "❌ There are untracked generated files!" | ||
| echo "" | ||
| echo "Untracked files:" | ||
| git ls-files --others --exclude-standard internal/lib/summary/machinereadable/ | grep -v k6-summary/ | ||
| echo "" | ||
| echo "Please run the generation scripts and commit all generated files." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "✅ Generated code is up-to-date!" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing it on each pull request, should we do only on the ones directly applying changes to
lib/summary/...package?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can. Although it's super cheap and fast, so not sure if it really worth it.