Tests and feedback
See GitHub Actions results directly alongside submissions in GradePush.
1. Configure tests
- Enable automatic tests in the assignment.
- Add a test, give it a name and points, and optionally describe what it checks. Choose Command succeeds, File exists or Input / output. Click the card header to collapse or expand the fields; its name and points remain visible and entered values are preserved. A card opens when validation finds an error.
- For command and input/output tests, choose Python, Node.js, PHP, Java, C/C++ or Shell / custom command. The language options select the displayed version on an Ubuntu 24.04 GitHub runner. For a different language, use the custom option and prepare the required tools yourself.
- Enter an optional Preparation command to install dependencies or compile, then the Run command. For example, Java can use
javac Main.javafollowed byjava Main; C can usegcc main.c -o mainfollowed by./main. Preparation runs once per test, in its own shell. If it fails, the run command is skipped. Set the time limit for each command: 300 seconds by default, adjustable from 30 to 1200 seconds. - For input/output tests, enter the input and expected output, then choose a comparison. Ignore trailing whitespace ignores ASCII spaces and tabs at line ends and final line breaks, preserving indentation, spaces within lines and interior empty lines. Exact match compares every byte. Contains expected output searches for the expected text anywhere in the output. For Regular expression, enter the expression in Expected pattern, which replaces Expected output. Use JavaScript syntax without
/delimiters, searching anywhere; use anchors when needed, for example^Total: [0-9]+\n$. Invalid expressions fail the test. Comparisons have a ten-second limit; captured stdout and stderr are each limited to 8 MiB. - Check that GitHub Actions is enabled for your organization’s repositories.
- Try the tests on a sample solution before sharing the assignment. Test settings are fixed once students have accepted.
2. Review results
- Open a submission’s results after its GitHub Actions run finishes.
- Check the assessed commit and the points earned for each test.
- Open View GitHub Actions to read the logs for a failing test. Input/output logs show the expected output or pattern and actual output. Exact and trailing-whitespace mismatches also show a diff; compilation errors and timeouts identify the failed command. GradePush awards points only when the whole test succeeds.
3. Give feedback
Open the repository from GradePush to review the code and leave comments on GitHub.
Tests use GitHub Actions; their cost depends on your organization’s plan. If results do not arrive, see troubleshooting.
