Skip to content

Bump julia from 1.10.5 to 1.11.1 #285

Bump julia from 1.10.5 to 1.11.1

Bump julia from 1.10.5 to 1.11.1 #285

Workflow file for this run

name: CI
on:
push:
branches:
- main
- master
pull_request:
jobs:
test:
name: Automated tests
runs-on: ubuntu-22.04
# Change this to add or remove tests
env:
TESTS: all_passing,all_passing_with_debugging,everything_at_once,one_fail,one_passing,truncated_output,grains,complex-numbers,test_logs,using_stdlib
JULIA_NUM_THREADS: 2
steps:
- name: Disable GHA commands
run: echo "::stop-commands::`cat /dev/urandom | base64 | head -c 64`"
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Build image
run: docker build -t jtr-img .
- name: Run test runners
shell: julia --color=yes --project {0}
run: |
const tests = split(ENV["TESTS"], ",")
@info "The following tests will be run:\n - $(join(tests, "\n - "))"
mkdir("results")
Threads.@threads for test in tests
@info "Running test: $test..."
# Create container
run(`docker create --name jtr-$test jtr-img irrelevant /tmp/ /tmp/`)
# Copy test file(s) to container
run(`docker cp "test/fixtures/$test/runtests.jl" jtr-$test:/tmp/`)
isfile("test/fixtures/$test/$test.jl") &&
run(`docker cp "test/fixtures/$test/$test.jl" jtr-$test:/tmp/`)
# Start container to run the test runner
run(`docker start -a jtr-$test`)
# Copy result back to host
run(`docker cp jtr-$test:/tmp/results.json "results/$test.json"`)
end
- name: Install Julia dependencies for comparing results
run: julia --project --color=yes -e "using Pkg; Pkg.instantiate()"
- name: Compare created and expected results.json
shell: julia --color=yes --project {0}
run: |
using JSON
using Test
const tests = split(ENV["TESTS"], ",")
# Shorten the error messages so we don't need to care about specific paths, file numbers, etc.
function shorten_messages!(result)
if result["status"] == "error" && haskey(result, "message")
result["message"] = split(result["message"], '\n')[1]
end
end
@testset "Compare results.json files" begin
@testset "$test" for test in tests
expected = JSON.parsefile(joinpath("test", "fixtures", "$test", "expected_results.json"))
created = JSON.parsefile(joinpath("results", "$test.json"))
shorten_messages!(expected)
shorten_messages!(created)
foreach(shorten_messages!, expected["tests"])
foreach(shorten_messages!, created["tests"])
@test expected == created
end
end