-
Notifications
You must be signed in to change notification settings - Fork 223
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
Add md-k6 script + new workflow #1828
Conversation
Better options Add workflow Tweak Fix param Test MD creation, modification, rename and deletion More tweaks Revert "Test MD creation, modification, rename and deletion" This reverts commit 393424d. Tweak script Test file modifications Compare changes on PR commits only Revert "Test file modifications" This reverts commit cab6dae. More tweaks
6a0dff5
to
7a76499
Compare
This is awesome, thanks so much for creating this @federicotdn! 🎉 Tagging @jdbaldry here as well if you'd like to take a look 🤓 . I'm not sure if this could be applicable to other repos, but what do you think of having this in the k6-docs repo? |
I would rather keep it here since this is only documentation-related, but also I have a feeling that adding it to the main k6 repo would take more time in terms of reviewing. |
Ah sorry @federicotdn I just meant adding this to the k6-docs repo, not the k6 main repo. 😅 |
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.
Made some small edits to the README, thanks for including a new section there! 🙇
I tested this locally running the script on a few files, and it works as expected 🤓 . I think this will be really helpful to keep the doc samples working and up to date!
Cool script, thanks for making me aware of it. It's a neat solution to ensuring the validity of code blocks. Another mechanism, used by the Mimir team, is to write tests using the code or configuration files directly and then embed that code or configuration in the documentation using something like |
@jdbaldry thanks! And yes, that sounds like a good idea with |
Co-authored-by: Heitor Tashiro Sergent <[email protected]>
Co-authored-by: Heitor Tashiro Sergent <[email protected]>
No need to migrate if this is working for you :) |
What?
Adds a new script,
md-k6.py
, that is run via therun-code-blocks.yml
Workflow. The workflow is run only when .md files are modified in thek6/next/**
directory via a PR. The script then takes the paths of all .md files that were modified in the PR (in comparison tomain
) and then run all JS codeblocks within those files. If any of the scripts causes k6 to exit with 1, or logs any type of error, then the workflow will fail.It is possible to skip the running of the script by adding a magic comment on top of the script:
<!--md-k6:skip-->
.Checklist
npm start
command locally and verified that the changes look good.docs/sources/k6/next
folder of the documentation.docs/sources/k6/v{most_recent_release}
folder of the documentation.docs/sources/k6/next
folder of the documentation.Related PR(s)/Issue(s)