ChrisBoesch / singpathfire

An AngularFire-based version of SingPath
http://chrisboesch.github.io/singpathfire
MIT License
4 stars 7 forks source link

Java Verifier #195

Closed SingaporeClouds closed 8 years ago

SingaporeClouds commented 9 years ago

Extend the SingPath docker-based verifier to support Single-file Java problems. This Java verifier will compile and test code

Users will provide the implementation of the class SingPath.java and problem creators will write unit tests. The tests for the class will be inserted into a junit test file named SingPathTest.java

Then aggregate the results of the passing and failing tests to share in a table with the user like SingPath currently does for Javascript and Python problems.

The concept can be seen in this code which is running to demonstrate how to capture individual junit test failures.

This Github project will contain problem examples for various languages and a away to test these problems locally or in docker images that will need to be developed for each language.

https://github.com/ChrisBoesch/singpath-verifiers

You can run "python test_all_verifiers.py" to currently see all the supported Java examples being run.

The idea is to run "python verify.py" in each container to compile and execute solution code and tests. The Java 8 runtime is the priority.

The python script running outside of the docker container could download the solution and test code from Firebase, save the code and tests to files, insert the files into the secure Java container, execute the compile and test script, and timeout on long running code. Once the compile and execute process in the container completes in less than 5 seconds, the script outside of the container can collect the results.json file from within the container. This should contain the verification results which can be saved back to Firebase.

dinoboff commented 9 years ago

The Java verifier is partially implemented (cluster in place, GUI updated, firebase rules updated). It's currently using the old Singpath verifier using Beanshell. I will update it to instead compile the solution and test classes with regular Java tools.