Replies: 1 comment
-
As we launched tutorials.ignite.com and due to the current tutorial workflow, this would not apply anymore. However, let's convert to discussion as the concepts here are good reference. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In progress
We have tutorials in our docs.
Tutorials might quickly get out of sync if the templates used for scaffolding changes or between SDK versions and some other reasons. They should be kept up to date and always properly work with the latest version of the CLI. Whenever we make a change in the develop branch, we should make sure that tutorials are not broken.
To fix this this problem we basically need to run tests for tutorials which requires us to write tutorials in a special format, but not entirely different from Markdown format. If Markdown supports it, we basically need to add some some metadata to each step in a tutorial and later use that metadata to run tests from a tutorial.
Running tests
tutorials
under theintegration
tests dir.docs/docs/guide
(we may need to refactor the docs dir if needed).Add(path string)
all the .md files for that tutorial to the suite.Run()
the tests.docs/docs/guide
to the new format, to add metadata so the test suite can use it interpret and run tests.An example from the scavenge tutorial:
01-hunt.md
Doesn't have any steps
02-game.md
Doesn't have any steps
03-scaffolding.md
1st step is about scaffolding a chain with no module. It is originally written in the .md file like below:
We can add a hidden comment, as a metadata, just above the code block to give instructions to the test runner about how tun interpret this step:
The test runner in the beginning should create a temporary directory and then in this step, recognize the
exec
instruction and then executeignite scaffold ...module
command.If the instruction is unknown, then tests should fail.
The interoperation part of the Markdown file and executing steps could be a generic package can be created under
pkg/
and used inintegration/tutorials
. This way, if we plan to add a new command setignite tutorial
, logic can be reused.The
ignite tutorial
could be about scaffolding an from a tutorial but not necessarily running test over it.2nd step could be converted as:
3rd step is same as the 2nd step
4th step is same as the 2nd step
...
07-keeper.md
...
As different from the
exec
instruction, here in this step below tutorial asks user to edit a certain file (x/scavenge/keeper/msg_server_submit_scavenge.go
), that part of tutorial can be rewritten like this:In this step,
replace-func
instruction:...
TODO: define execute query, tx, relayer steps like in the tutorial
Beta Was this translation helpful? Give feedback.
All reactions