-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
introduce automatic testing for nix-repl
blocks
#672
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-10-documentation-team-meeting-notes-71/31558/1 |
The doctester app seems to fail when executed in the build phase. I'm guessing this has something to do with failing to creating a file that is part of creating a PTY. Perhaps as a flake "check" this would be run in an environment that would allow such files to be created? Can something be done otherwise to allow these files to be created? |
Worked around this by making this a flake app, instead. |
Regarding the fenced code block language tag, the following ```text nix-repl would work, but it's not nice. I'd like to use the Sphinx API to create an extension that prepends |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-14-documentation-team-meeting-notes-72/31722/1 |
6c5715b
to
c7d96aa
Compare
I can refine the implementation but that can be done later, as well. This is already useful. Therefore, asking for review. |
I feel that there is some open source rust crate potential somewhere in this but haven't thought of where to draw that line yet. |
Yes, there are no tests. I wonder whether anyone will insist on tests... |
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.
We should consider moving the Rust project into a separate repository, it should also definitely have tests and code comments and somebody should take a somewhat closer look at the code.
Have you seen https://github.com/OceanSprint/tesh |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-17-documentation-team-meeting-notes-73/31853/1 |
Yes, and I don't know why we didn't start with integrating |
It didn't seem to me like tesh provides the desired interface. I'm in the process of extracting the vast majority of this PR into its own repo. I suppose I will convert to draft. But I don't see the button. Are draft PRs disabled? |
72ebef3
to
5f16ed9
Compare
Well... today is the last day of https://thaigersprint.org/, during which I've been working primarily on this. The documentation example tester has been extracted and released. And I've updated this pull request. All examples are skipped except for two. Those two are repl examples. As it stands in this PR branch, repl examples and expression examples can be written and/or edited, as long as they're within the limited feature set of eelco. That is, channels cannot be used. Examples that consist of multiple files are not supported. Could be other things we wanna do that are not supported. |
Should this be merged at this stage? Is it better than nothing? Is the design of eelco reasonable? |
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.
I still have to play with it to see how it behaves in case of errors. From the consumer perspective I'd expect it not to require changing anything about the documentation source though.
Use the Nix REPL to evaluate Nix expressions interactively (by typing them on the command line). | ||
Execute it as `$ nix repl`, and you have a repl: |
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.
That is not an improvement because now there is no link to reference docs. It was good as it was.
nix-repl> 1 + 2 | ||
3 | ||
|
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.
Why is there an empty line?
@@ -158,7 +158,7 @@ On NixOS, `$NIX_PATH` can be set permanently with the [`nix.nixPath`](https://se | |||
|
|||
To quickly obtain packages for demonstration, we use the following concise pattern: | |||
|
|||
```nix | |||
```nix skip |
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.
Since you're only testing nix-repl blocks, there should be no need to spam every other block with redundant information (the purpose of which is not evident without "just knowing" what it means).
nix-repl
blocks
Closing this for now as it hasn't seen any progress in a long time and is far out of date. Feel free to reopen if there is any notable update. |
Sorry for taking so long. |
No description provided.