-
-
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
41fd0fe
Implement a basic Roc test runner
ageron f4ba82c
Switch Dockerfile to debian:bookworm instead of latest
ageron a58488c
Fix excessive level in .gitignore tests/ filter
ageron 57e2b4c
Tweak tests/success/expected_results.json to get it to be pushed to g…
ageron e98920d
Revert tweak to tests/success/expected_results.json
ageron 0e65b64
Switch to Ubuntu 24.04
ageron c519e17
Set TMPDIR to point to ${{ runner.temp }}
ageron 6f9d86c
Since `runner.temp` seems R/O, creating TMPDIR in `github.workspace` …
ageron 4dacd75
Debugging Github Actions
ageron d8d1128
Still debugging the TMPDIR issue
ageron fe65169
Debugging RUNNER_TEMP and GITHUB_WORKSPACE vars
ageron 9d1c84b
Is /tmp actually writable?
ageron f276ff3
Try forcing TMPDIR=/tmp since /tmp is writable
ageron 45b3412
Still debugging, trying to add debug symbols
ageron 99dc755
Try testing on macOS 14 instead of ubuntu-24.04
ageron eacd31a
Back to ubuntu-24.04
ageron 31e3378
Test /tmp permissions further
ageron 821f518
Debugging: use Roc compiled from source in debug mode
ageron dce360e
Use volume mount for /tmp
ErikSchierboom 5cd2f1d
Use Roc version based on latest ccode
ageron 9bc4ef7
Adapt to latest Roc outputs
ageron 55693ed
Merge all-fail and partial-fail expected_results.json
ageron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
FROM alpine:3.18 | ||
FROM debian:latest | ||
|
||
RUN apt-get update --fix-missing | ||
RUN apt-get upgrade --yes | ||
|
||
# install packages required to run the tests | ||
RUN apk add --no-cache jq coreutils | ||
RUN apt-get install --yes wget jq coreutils libc-dev binutils \ | ||
&& apt clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /opt/test-runner | ||
COPY bin/download-basic-cli.roc bin/download-basic-cli.roc | ||
|
||
# download & install roc and the basic-cli platform | ||
RUN wget -q -O roc.tar.gz https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz \ | ||
&& mkdir /usr/lib/roc \ | ||
&& tar -xvz -f roc.tar.gz --directory /usr/lib/roc --strip-components=1 \ | ||
&& rm roc.tar.gz \ | ||
&& /usr/lib/roc/roc test bin/download-basic-cli.roc | ||
ENV PATH="$PATH:/usr/lib/roc" | ||
|
||
COPY . . | ||
ENTRYPOINT ["/opt/test-runner/bin/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.12.0/Lb8EgiejTUzbggO2HVVuPJFkwvvsfW6LojkLR20kTVE.tar.br" } | ||
|
||
import pf.Task exposing [Task] | ||
|
||
expect Bool.true | ||
|
||
main = | ||
Task.ok {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.12.0/Lb8EgiejTUzbggO2HVVuPJFkwvvsfW6LojkLR20kTVE.tar.br" } | ||
|
||
import pf.Task exposing [Task] | ||
|
||
expect 2 + 2 == 5 | ||
expect "four" == "five" | ||
|
||
main = | ||
Task.ok {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"status": "fail", | ||
"message": "TODO: replace with correct output" | ||
"message": "\u001b[1;36m── EXPECT FAILED in tests/all-fail/all-fail-test.roc ───────────────────────────\u001b[0m\n\nThis expectation failed:\n\n\u001b[1;36m5\u001b[0m\u001b[1;36m│\u001b[0m \u001b[37mexpect 2 + 2 == 5\u001b[0m\n \u001b[1;31m^^^^^^^^^^^^^^^^^\u001b[0m\n\n\n\u001b[1;36m── EXPECT FAILED in tests/all-fail/all-fail-test.roc ───────────────────────────\u001b[0m\n\nThis expectation failed:\n\n\u001b[1;36m6\u001b[0m\u001b[1;36m│\u001b[0m \u001b[37mexpect \"four\" == \"five\"\u001b[0m\n \u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\n\u001b[1;31m2\u001b[0m failed and \u001b[1;32m0\u001b[0m passed." | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"status": "fail", | ||
"message": "TODO: replace with correct output" | ||
"status": "error", | ||
"message": "\u001b[1;36m── MISSING HEADER in tests/empty-file/empty-file-test.roc ──────────────────────\u001b[0m\n\nI am expecting a header, but got stuck here:\n\n\u001b[1;36m1\u001b[0m\u001b[1;36m│\u001b[0m\n \u001b[1;31m^\u001b[0m\n\nI am expecting a module keyword next, one of \u001b[1;32minterface\u001b[0m, \u001b[1;32mapp\u001b[0m, \u001b[1;32mpackage\u001b[0m\nor \u001b[1;32mplatform\u001b[0m." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"status": "fail", | ||
"message": "TODO: replace with correct output" | ||
"message": "\u001b[1;36m── EXPECT FAILED in tests/partial-fail/partial-fail-test.roc ───────────────────\u001b[0m\n\nThis expectation failed:\n\n\u001b[1;36m6\u001b[0m\u001b[1;36m│\u001b[0m \u001b[37mexpect \"hello\" == \"good bye\"\u001b[0m\n \u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\n\u001b[1;31m1\u001b[0m failed and \u001b[1;32m1\u001b[0m passed." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.12.0/Lb8EgiejTUzbggO2HVVuPJFkwvvsfW6LojkLR20kTVE.tar.br" } | ||
|
||
import pf.Task exposing [Task] | ||
|
||
expect 2 + 2 == 4 | ||
expect "hello" == "good bye" | ||
|
||
main = | ||
Task.ok {} |
ageron marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.12.0/Lb8EgiejTUzbggO2HVVuPJFkwvvsfW6LojkLR20kTVE.tar.br" } | ||
|
||
import pf.Task exposing [Task] | ||
|
||
expect 2 + 2 == 4 | ||
expect "four" == "four" | ||
|
||
main = | ||
Task.ok {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": 1, | ||
"status": "error", | ||
"message": "TODO: replace with correct output" | ||
"message": "\u001b[1;36m── NOT END OF FILE in tests/syntax-error/syntax-error-test.roc ─────────────────\u001b[0m\n\nI expected to reach the end of the file, but got stuck here:\n\n\u001b[1;36m3\u001b[0m\u001b[1;36m│\u001b[0m \u001b[37miMpOrT pf.Task exposing [Task]\u001b[0m\n \u001b[1;31m^\u001b[0m" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.12.0/Lb8EgiejTUzbggO2HVVuPJFkwvvsfW6LojkLR20kTVE.tar.br" } | ||
|
||
iMpOrT pf.Task exposing [Task] | ||
|
||
expect 2 + 2 == 5 | ||
expect "four" == "five" | ||
|
||
main = | ||
Task.ok {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toUbuntu 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.