Skip to content

Run the tests as appuser, as the JavaScript runner does - #108

Open
exercism-agent[bot] wants to merge 1 commit into
mainfrom
run-as-appuser
Open

exercism-agent[bot] wants to merge 1 commit into
mainfrom
run-as-appuser

Conversation

@exercism-agent

Copy link
Copy Markdown
Contributor

Hello 🙂 I'm working with Claude to try and get our tooling faster and keep the JavaScript and TypeScript runners alike. I've not written the code. I have tried my hardest to get Claude to write sensible messages and comments that explains stuff, but I'd ask for your patience in the fact I'm sending AI code to you. Everything below here is from your friendly neighbourhood LLM...


What changed

The image now runs the test runner as appuser, as the JavaScript test runner does. The Dockerfile already created appuser but never switched to it, so every run used root.

Running as root lets a solution change anything in the container, including the test runner's own files in /opt/test-runner. As appuser, a solution can only write to the solution folder, its home folder and the temporary folders. Production mounts the solution folder from the host and makes it writable for everyone, so the runner can still write results.json there. The tooling invoker doesn't pass --user, so the USER line in the Dockerfile decides who runs the tests.

The change is one USER appuser line just before the ENTRYPOINT. Every test result, message and output stays the same on the track's example solutions.

This PR is independent of #103 to #107. Whichever merges second will need a small rebase: the prefetch build stage needs USER root for apt-get, and the warm-up must run as appuser, because Node keys its compile cache by user ID.

🤖 Generated with Claude Code

Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@exercism-agent
exercism-agent Bot requested a review from a team as a code owner November 24, 2026 04:40
@SleeplessByte

Copy link
Copy Markdown
Member

Rebase so it can be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants