Devbox, is a framework for running interactive, test-driven programming courses—primarily focused on Go (Golang).
Devbox allows instructors to define programming courses as a series of stages, each with automated tests. Students submit solutions, and Devbox runs these solutions in isolated Docker containers, checking them against the tests defined for each stage.
Courses are described in YAML files (e.g., course.yaml), specifying metadata (name, description, version) and a sequence of stages. Each stage contains: A description and hints for the student. One or more test cases, each with: A Docker setup (image, environment, mounts, commands). Input and expected output.
Example on how to run the coursectl CLI.
Build the coursectl CLI and run it with the following command:
# Build the coursectl CLI
go build -o coursectl cmd/cli/main.go
# Run the coursectl CLI
./coursectl -course examples/http-server -solution examples/http-server/solutionThis will run the tests for the http-server course with the solution as the student's solution.
The course is defined in the examples/http-server folder.
The solution folder contains the student's solution.
The solution_tester folder contains the tester for the student's solution.
The internal packages is separated into small reusable modules that provide the core functionality:
-
docker: Manages Docker container operations including image pulling, container creation, execution, and cleanup. Handles container configuration, logging, and resource management.
-
test_runner: Orchestrates the execution of test cases in Docker containers. Manages test lifecycle, timeout handling, and result validation.
-
parser: Handles the parsing and validation of course YAML files, converting them into structured course definitions.
-
courses: Contains the course-specific implementations and testers for different programming exercises (e.g., HTTP server implementation).
-
logger: Provides structured logging with color-coded output levels (DEBUG, INFO, SUCCESS, WARNING, ERROR) and specialized formatting for test results.
-
matcher: Implements output matching strategies for test validation, supporting exact matches, substring matches, and JSON array comparisons.
The current diagrams and documentation is available to preview using a Mermaid Editor under the /docs folder.