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

Make .mds testable #303

Merged
merged 2 commits into from
Sep 17, 2019
Merged

Make .mds testable #303

merged 2 commits into from
Sep 17, 2019

Conversation

dora-gt
Copy link
Collaborator

@dora-gt dora-gt commented Sep 13, 2019

This is a part of #198
I'm breaking the issue down into separate PRs this time.

What this PR realizes is to make .mds testable but it is NOT automated yet.
Integrating into CircleCI would be later.

  • Just run run-md-test.sh to test markdowns.
  • run-md-test.sh injects hook_before_kill functions into the script of markdowns.
    • The tests are actually written in scripts/run-md-tests/examples.
      • Each file defines a hook_before_kill function.
    • Why I adopted this approach is:
      • We wouldn't know when to test. i.e. when the payment is done. We have to wait for something without this.
      • This approach almost doesn't affect the original code.
    • Though this is slightly different from Ben's suggestion: Make .mds testable #198 (comment) is this acceptable? @bstrie
  • run-md-test.sh exits with 0 when it succeeded, and with 1 when it failed. So integrating this script into CircleCI wouldn't be so hard.

In a case of success:
image

In a case of failure:
image

@@ -0,0 +1,9 @@
## Tests for Runnable Markdowns

Should implement `hook_before_kill` function like:
Copy link
Member

Choose a reason for hiding this comment

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

This is very clean, LGTM.

Copy link
Contributor

@bstrie bstrie left a comment

Choose a reason for hiding this comment

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

These look great!

scripts/run-md-test.sh Outdated Show resolved Hide resolved
scripts/run-md-test.sh Outdated Show resolved Hide resolved
scripts/run-md-tests/README.md Outdated Show resolved Hide resolved
scripts/run-md-tests/examples/eth-settlement.sh Outdated Show resolved Hide resolved
@dora-gt dora-gt force-pushed the feature/dx/testable-md branch 2 times, most recently from 8f7ae52 to 67db0ef Compare September 17, 2019 04:55
Signed-off-by: Taiga Nakayama <dora@dora-gt.jp>
Merged tests into the original markdowns. Also fixed to add all the directories in the example
directory as test targets.

Signed-off-by: Taiga Nakayama <dora@dora-gt.jp>
@dora-gt
Copy link
Collaborator Author

dora-gt commented Sep 17, 2019

I'm merging this.

@dora-gt dora-gt merged commit 8bb329a into master Sep 17, 2019
@dora-gt dora-gt deleted the feature/dx/testable-md branch September 20, 2019 14:13
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.

4 participants