-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
18: Upgrade runner to meet version 2 spec #104
18: Upgrade runner to meet version 2 spec #104
Conversation
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I've left some comments.
@cdimitroulas You'll also need to fix the tests. You can run them locally by running: |
Co-authored-by: Erik Schierboom <[email protected]>
- If all tests pass, hspec formatter now correctly outputs top-level success status - Implemented bash LSP hints in bin/run.sh - Added newline at end of code injection to package.yaml files
11bc796
to
2416867
Compare
I'm doing some preliminary performance testing locally, and it does look like this new version is a bit slower. Hopefully pre-compiling will help. |
Whilst testing things locally, I'm getting this error:
I submitted these files:
module LeapYear (isLeapYear) where
isLeapYear :: Int -> Bool
isLeapYear year = hasFactor 4 && (not (hasFactor 100) || hasFactor 400)
where hasFactor n = year `rem` n == 0 and
name: leap
dependencies:
- base
library:
exposed-modules: LeapYear
source-dirs: src
tests:
test:
main: Tests.hs
source-dirs: test
dependencies:
- leap
- hspec One other request: could you make it such that after running |
@ErikSchierboom I've added some automatic cleanup when running Regarding the error you encountered, I can't reproduce that. I believe that this used to occur when you ran the test-runner multiple times without cleanup in-between because the lines appended to Note that I presume this issue would not have occurred in a real run as the input directory would contain a clean copy of the files each time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit: see comments
Let's go! |
Closes #18
The solution here relies on a custom
hspec
formatter which deals with producing theresults.json
file. In order to make this work, it uses code injection to modify the exercise test code to use this custom formatter.Outstanding items
bin/run.sh
executes this code injection by usingstack runghc
. We may wish to avoid this by building an executable and executing that directly.