I write my notes in org-mode. It's supported in many editors in a basic form, letting you add code snippets etc in an unobtrusive way. Using a well thought out format helps you in the long run.
I use this in Emacs, through which it lets me refer to emails, execute code snippets, attach related files, fetch content on/from remote servers, send off the debug session as an html email, ... Support will depend on your editor but even as raw text it works.
I don't use something specific to make non-code repeatable as you suggest here, but you could embed a test language in an org code block.
The syntax is straight-forward and exports to multiple external formats exist (eg: html).