-
Notifications
You must be signed in to change notification settings - Fork 375
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
proposal: testable markdown documentation #2245
Comments
@thehowl i think we can make test file in markdown files like example: https://github.com/Jc2k/pytest-markdown/blob/main/tests/integration/example.md. After that we can use github action to write report in same as markdown file to show test coverage and pass/fail test case. https://github.com/becheran/go-testreport |
If we think about it simply, I can try the following approach. After parsing, generate a temporary flowchart TD
A[Parse Markdown Document] --> B[Extract Code Blocks]
B --> C{Check Code Blocks}
C -->|None| D[End]
C -->|Exists| E[Preparation Before Code Execution]
E --> F[Initialize Error Handling and Logging Mechanisms]
F --> G[Set Execution Environment Resource Limits]
G --> H[Execute Code and Monitor]
H --> I{Check Cache for Result}
I -->|Cached| J[Use Cached Result]
I -->|No Cache| K[Execute Code]
K --> L[Process Results]
L --> M{Check for Errors}
M -->|Errors Present| N[Log Errors and Provide Feedback to User]
M -->|No Errors| O[Log and Save Results]
J --> P[Insert Results into Markdown Document]
O --> P
N --> D
style D fill:#f96,stroke:#333,stroke-width:2px
style J fill:#bbf,stroke:#333,stroke-width:2px
style O fill:#bbf,stroke:#333,stroke-width:2px
style N fill:#fbb,stroke:#333,stroke-width:2px
|
I suggest that we:
|
From #1913.
We need to have good support for testable examples our tests, same as Go. From this issue and ensuing discussion, with @gfanton we discussed the possibility of having a way to create tests as markdown files; which serve primarily as documentation, but can show usage examples using
gnokey
and which can be tested.This should be in opposition to using
txtar
tests for public usage; keeping them mostly for internal testing, but allowing to document how a realm is practically used publicly.The text was updated successfully, but these errors were encountered: