Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Update integration.yml #25

Closed
wants to merge 12 commits into from
47 changes: 13 additions & 34 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,24 @@
name: Autograding Tests
"on":
- push
- workflow_dispatch
permissions:
checks: write
actions: read
contents: read
name: Test
on:
- push
- workflow_dispatch
jobs:
autograding:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install and build node assets
run: |
npm install --silent
npm run build
- uses: ruby/setup-ruby@v1
- name: Shout Test
id: shout-test
uses: education/autograding-io-grader@v1
with:
test-name: Shout Test
command: "./test/bin/shout.sh"
input: hello
expected-output: HELLO
comparison-method: exact
timeout: 10
max-score: 100
- name: A command test
id: a-command-test
uses: education/autograding-command-grader@v1
with:
test-name: A command test
setup-command: bundle install
command: rspec hello_spec.rb
timeout: 10
max-score: 100
- name: Autograding Reporter
- uses: education/autograding-python-grader@main
id: runner1
- uses: education/autograding-python-grader@main
id: runner2
- name: Show Output
uses: ./
env:
SHOUT-TEST_RESULTS: "${{steps.shout-test.outputs.result}}"
A-COMMAND-TEST_RESULTS: "${{steps.a-command-test.outputs.result}}"
RUNNER1_RESULTS: ${{steps.runner1.outputs.result}}
RUNNER2_RESULTS: ${{steps.runner2.outputs.result}}
with:
runners: shout-test,a-command-test
runners: "runner1,runner2"
16 changes: 13 additions & 3 deletions src/console-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@ exports.ConsoleResults = function ConsoleResults(runnerResults) {

results.tests.forEach((test) => {
if (test.status === 'pass') {
console.log(`${COLORS.green}✅ ${test.name}${COLORS.reset}`)
passedTests += 1
if (test.line_no !== 0) {
console.log(`${COLORS.green}✅ ${test.name} - line ${test.line_no}${COLORS.reset}`)
} else {
console.log(`${COLORS.green}✅ ${test.name}${COLORS.reset}`)
}
} else if (test.status === 'error') {
console.log(`Error: ${test.message || `Failed to run test '${test.name}'`}\n${COLORS.reset}`)
} else {
console.log(`${COLORS.red}❌ ${test.name}\n`)
console.log(`${test.message || ''}\n${COLORS.reset}`)
if (test.line_no !== 0) {
console.log(`${COLORS.red}❌ ${test.name} - line ${test.line_no}${COLORS.reset}`)
} else {
console.log(`${COLORS.red}❌ ${test.name}${COLORS.reset}`)
}
}
if (test.test_code) {
console.log(`Test code:\n${test.test_code}\n`)
}
})

Expand Down
Loading