Skip to content
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

Doc test generator #15

Merged
merged 3 commits into from May 3, 2024
Merged

Doc test generator #15

merged 3 commits into from May 3, 2024

Conversation

aumetra
Copy link
Member

@aumetra aumetra commented Apr 29, 2024

A quick little tool that visits all .mdx files, parses them using pulldown-cmark, and writes all codeblocks annotated with something like:

```rust template="core"

into a separate test file, that applies the core template.

There is nothing fancy about this, just some globbing, aggregating, and file creation.
Also supports Go blocks, but I'm not sure how to properly set up a working test environment for this, I'm just a poor little Rust dev.


This should either be a Git hook or we should have a CI step that ensures no new files have been created (probably both).

Copy link

vercel bot commented Apr 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cosmwasm-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2024 0:18am

Copy link
Contributor

@chipshort chipshort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this gets the job done nicely. No need to be too fancy here.
Regarding CI: We should have a step that checks no new files are created and also run the tests.
CI should also have a cronjob that runs the tests with the latest versions of our crates, so we notice when it breaks with new releases.

docs-test-gen/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@chipshort chipshort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too familiar with Github Actions, but looks good to me.
Nice work and thanks for taking the initiative on this!

@aumetra aumetra merged commit 7b7017c into main May 3, 2024
3 checks passed
@aumetra aumetra deleted the docs-test-gen branch May 3, 2024 08:29
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.

None yet

2 participants