-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement a basic Roc test runner #4
Conversation
Mmmh, the tests pass on my machine (using podman on MacOS), but they seem to fail here with a weird |
Dockerfile
Outdated
@@ -1,8 +1,23 @@ | |||
FROM alpine:3.18 | |||
FROM debian:latest |
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.
Can we pin this to a specific Debian version? If feasible, it might be better to use an Alpine image to reduce the overall image size. That'll save Exercism money since we're deploying 71+ different Docker images to each test runner machine in the cloud.
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.
I can definitely pin this to debian:bookworm instead. However, I tried using alpine, but Roc failed, probably because I need to install some libraries. I'll start with debian:bookworm, and I'll switch to alpine asap.
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.
If Alpine doesn't work out, that's fine. It's just a nice starting point for reducing file size, but I don't believe all tracks can use Alpine images due to some limitations in what's available.
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.
Trying to solve the DlOpen
error (see above), I've switched to Ubuntu 22.24
. Still works fine on my machine but fails in Github CI. I think it might be a permission issue on the /tmp
folder (see this SO answer).
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.
What I know about Docker or Github CI can fit in a thimble, but Erik can probably help you out further. He's pretty handy. :)
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.
I looked into migrating to Alpine, but Roc is currently built on glibc whereas Alpine uses musl. There's an ongoing effort to make Roc support musl, so we should be able to migrate to Alpine once that work is completed.
The |
I'm really stumped by the |
This is an impressive PR, well done! I've just pushed a commit to fix the tmp folder issue. CI still fails though |
Thanks @ErikSchierboom ! |
Great, the tests finally pass! 👍 |
Thanks for your help @ErikSchierboom |
This PR implements a basic test runner for Roc:
Dockerfile
is based on debian:latest, it installs Roc and runsdownload-basic-cli.roc
to ensure thebasic-cli
platform is in Roc's cache (since the container will run without network access)bin/run.sh
runsroc test ...
and captures the output. It sanitises it (i.e., normalises) by removing timing output (e.g.,"in 123 ms."
).result.json
will contain{version: 1, status: "pass"}
. If the tests fail, then if the sanitised output contains-- EXPECT FAILED in
or-- EXPECT PANICKED in
, thenresult.json
will containstatus="fail"
, or else it will containstatus="error"
(which means that none of the tests could run).tests/{slug}/{slug}-test.roc
forslug
inall-fail
,empty-file
,partial-fail
,success
, andsyntax-error
, implement a very basic test for each of these basic scenarios. The corresponding expected output is intests/{slug}/expected_results.json
.