Feature/haskell testing - #20
Conversation
Wrote the docker file used to create the image for Haskell testing
The entry script for the Haskell testing container
Added values in `application-local.yml` Added variables in `DockerService.java` Note: Most of the changes in `DockerService.java` is from the fromatter
Commented out all `ulimit` commands in `haskell_entry.sh` There were resource problems when running the container. 1. `-u` option was problematic 2. The command said it requires at least 70MiB to run More investigation is required to find proper resource limits.
Made the stack install a common command so it won't need to be rerun for every image Only `Add . .` and `ENTRYPOINT ...` are the "unique" layers
Fixed timeout issue for new layers that take a long time to build Increased `docker.build.timeout` to 300s from 10s
Java still need to be implemented
Added missing argument to `String.format` call
Allow the user to set the suite file name to any name, as long as it is a valid module name Added `-main-is` option to `stack ghc` command call
Automatically add `import HUnit` to generated suite file It is needed for all Haskell files, so best to automate it
Wrote the docker file used to create the image for Haskell testing
The entry script for the Haskell testing container
Added values in `application-local.yml` Added variables in `DockerService.java` Note: Most of the changes in `DockerService.java` is from the fromatter
Commented out all `ulimit` commands in `haskell_entry.sh` There were resource problems when running the container. 1. `-u` option was problematic 2. The command said it requires at least 70MiB to run More investigation is required to find proper resource limits.
Made the stack install a common command so it won't need to be rerun for every image Only `Add . .` and `ENTRYPOINT ...` are the "unique" layers
Fixed timeout issue for new layers that take a long time to build Increased `docker.build.timeout` to 300s from 10s
Java still need to be implemented
Added missing argument to `String.format` call
Allow the user to set the suite file name to any name, as long as it is a valid module name Added `-main-is` option to `stack ghc` command call
Automatically add `import HUnit` to generated suite file It is needed for all Haskell files, so best to automate it
Removed `-u` option, doesn't work in container Increased $PF_VIR_MEM, required for compilation Increased $PF_MAX_FILE_SZ, required for compilation/linking NOTE: We will probably need to increase $PF_VIR_MEM for prod, bigger programs might require more memory to compile
Fixed wrong entry file name
Changed `Test.hs` in command back to `"$TEST_FILE_NAME"`
benjaminkostiuk
left a comment
There was a problem hiding this comment.
Sorry for all the changes, I managed to run it on my machine and it seems to work 👍 so that's great. The only hiccup is gonna be image size for Haskell down the road...we might have to create our own in alpine or something cause 4 GB is too much.
Could you also bootstrap a sample project + test cases for haskell for easy testing, similar to what I did for python? I'll push what I did and you can build it out a little maybe. Look in bootstrap_data.sql to get started.
Co-authored-by: Ben Kostiuk <kostiukb@mcmaster.ca>
Co-authored-by: Ben Kostiuk <kostiukb@mcmaster.ca>
Co-authored-by: Ben Kostiuk <kostiukb@mcmaster.ca>
Co-authored-by: Ben Kostiuk <kostiukb@mcmaster.ca>
Co-authored-by: Ben Kostiuk <kostiukb@mcmaster.ca>
Co-authored-by: Omar Alkersh <oalkersh@protonmail.com>
Co-authored-by: Omar Alkersh <oalkersh@protonmail.com>
Program now exits with code 1 if any test case failures and exit code 2 if there are any runtime errors Checking that number of errors and number of failures are 0 Before program used to exit with code 0 regardless of test results, now returns the correct exit code on test failure
Return code 3 on compilation error and code 137, `TIMEOUT_ERROR`, on command timeout Before it used to return runtime error or constraint error on compilation errors
Moved Haskell section under python and above Walkthrough Updated the sample generated test file
|
I am assuming everything is good now? If so, could you approve the PR. |
| // TODO; | ||
| break; | ||
| case HASKELL: | ||
| // TODO: Consider putting code in file and replacing function name and body into read string |
There was a problem hiding this comment.
I think this is necessary at this point. It's not exactly practical to make changes to.
There was a problem hiding this comment.
I am assuming everything is good now? If so, could you approve the PR.
Almost!
There was a problem hiding this comment.
The suite template, should I save it with the Dockerfile and the entry script? Or should I create a new directory for it? If so, lmk where do want it.
And I think we should save the path in the application.yml file under docker.build.haskell.suite-template. Lmk if this sounds good or where do want it before I push the changes.
Co-authored-by: Omar Alkersh <oalkersh@protonmail.com>
Storing the Haskell suite template in a text file for later read and formatting. Easier management and more practical changes than using StringBuilder
benjaminkostiuk
left a comment
There was a problem hiding this comment.
You'll need to add the new suite-template property in application-test.yml for the automated tests to pass. Otherwise looks good! Feel free to squash and merge when ready.
Don't forget to give a little time for the Bump package version Actions script to finish after merging before deleting the branch.
Overview
Added support for Haskell testing.
Addresses #6.
Needed to create a new PR due a branch rename.
This change is a
Description
haskell_entry.shwriteTestCaseToSuiteFileto allow for different languagesMotivation/Links
Notes and problems:
ulimitcommands from the entry script as it was breaking stack. It said it needed at least 70 MiB to run. And there was a problem with the-ucommand.How was this tested?
I ran the tests using the REST API, and it behaved as expected.
Todos