CodeGrade / bottlenose

CS assignment / grade mangement system
GNU Affero General Public License v3.0
37 stars 21 forks source link

Get rid of TAP, YAML, JSON variety, and standardize on a single configuration format #139

Open blerner opened 5 years ago

blerner commented 5 years ago

It's unfortunate that professors need to know JSON config for Java style graders, YAML config for question and codereview assignments, TAP+YAML output for producing new autograders, etc etc. Since all of these are basically just plain-old-objects, we should standardize on a single format and simplify away the cruft of knowing all these formats. I'd suggest using solely JSON, which has better editor support, fewer parsing weirdnesses, and is sufficient for our purposes. (The only benefit TAP has over JSON here is that it's almost streamable: if the testing process dies midway through, some tests have already been written out. But our tester processes shouldn't die, anyway, so that's not a decisive factor.)

Switching over to YAML would require converting all existing files to JSON, via File.write(YAML.parse(File.read(...)).to_json) more or less. TAP will take a slight bit more doing, but not much.

NatTuck commented 5 years ago

I had two goals in using TAP:

I don't think that either of these are terribly important to the intro sequence usecase for Bottlenose - and are somewhat lost in the extended TAP format anyway - so switching to JSON for test output is probably an improvement long as some thought is put into the schema.

For config files both JSON and YAML are awful because they're not easily human writable, but that's probably more an argument to create UIs for configuration rather than a different format.

blerner commented 5 years ago

Yeah, it's a worthy goal to let students see the raw test output, and I don't entirely want to eliminate it. But my hybrid kludge of shoving a YAML value into the TAP output just feels ugly, and it hindered me being able to tell one of my TAs, "Here's the schema you should produce with your automated tests, and here's the schema checker to use to confirm you've gotten it right."

Since Bottlenose now has fancier renderings for its outputs, I'm ok not having TAP directly. The one use-case we'd like to really preserve (or enable, since it's not implemented yet) is streaming the testing results to a student's browser: JSON won't parse an array of results unless the closing bracket is present, but YAML or TAP might... (On the other hand, https://github.com/brianmario/yajl-ruby might help with that...)