I was just working out which users got to see the 'hidden' testcases in a question.
(hmm, not very good contrast in our theme).
Anyway, I found that this was tied to a standard Moodle capability: 'moodle/grade:viewhidden'.
That is potentially awkward for us. I was wondering if we should should create a specific capability for this (qtype/coderunner:viewhiddentestcases, by default allocated to the same roles that have moodle/grade:viewhidden).
Richard, if you are OK with that concept, I could code it an send you a pull request.