nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

Proof-of-concept for testing shell sessions

Open zupo opened this issue 3 years ago • 7 comments

In https://github.com/nix-dot-dev/nix.dev/pull/248 I introduced a way to export code samples into files, and then test them.

This commit adds an additional improvement on top of that: to test shell session examples, command by command, and verify the output of commands matches the output given in the shell session example.

zupo avatar Apr 08 '22 13:04 zupo

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7c52a2a
Status: ✅  Deploy successful!
Preview URL: https://df0be80c.nix-dev.pages.dev
Branch Preview URL: https://shell-sessions-testing.nix-dev.pages.dev

View logs

Don't merge yet. Apparently find does not fail if one of the exec commands fail. So we have test failures, but CI thinks everything is OK. Need to rewrite it. Probably to xargs.

zupo avatar Apr 08 '22 13:04 zupo

Don't merge yet. Apparently find does not fail if one of the exec commands fail. So we have test failures, but CI thinks everything is OK. Need to rewrite it. Probably to xargs.

This is now taken care of, CI fails on test failures.

What's next is rewriting the test runner to not rely on my shell-darwin.nix.

zupo avatar May 01 '22 08:05 zupo

What's missing here to get this merged?

domenkozar avatar Jul 12 '22 16:07 domenkozar

Fixing the CI.

zupo avatar Jul 13 '22 07:07 zupo

Rebased off of latest master.

zupo avatar Jul 14 '22 19:07 zupo

Potentially interesting: https://www.npmjs.com/package/codedown

zupo avatar Jul 14 '22 20:07 zupo

What about https://zimbatm.github.io/mdsh/ :laughing:

domenkozar avatar Nov 02 '22 11:11 domenkozar

We now have https://github.com/OceanSprint/tesh

domenkozar avatar Nov 30 '22 10:11 domenkozar

We now have https://github.com/OceanSprint/tesh

Yep, I'll rewrite this PR.

zupo avatar Nov 30 '22 11:11 zupo

Are you still interested in working on this?

infinisil avatar Aug 10 '23 14:08 infinisil

Are you still interested in working on this?

Hey @infinisil, long time no hear!

I plan to work on this during OceanSprint but I'm not sure how much time I'll have besides running the logistics of the sprint, so please go ahead and take over if you want to!

zupo avatar Aug 10 '23 19:08 zupo

Yeah long time no see, hope you're doing good!

I don't have any time to work on this myself either, but we were triaging issues in the documentation team meeting. Since you're planning to work on this, let's leave it open.

Note that this is very related to @mightyiam's recent work on a tester for nix-repl in https://github.com/NixOS/nix.dev/pull/672. Might be good to synchronize on that before diving in. I can recommend checking in with the documentation team on Matrix or the meetings for that :)

infinisil avatar Aug 10 '23 20:08 infinisil

I'd say let's close this for now, can always be re-opened (or a new one opened) if work is being done.

infinisil avatar Nov 07 '23 17:11 infinisil