Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempts to make tests work better using the buildkite plugin #190

Closed
wants to merge 17 commits into from
Closed
68 changes: 35 additions & 33 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,57 @@ env:
DATADEPS_ALWAYS_ACCEPT: true

steps:
- label: ":building_construction: initialize environment"
- label: ":construction: setup julia"
key: "init"
commands:
- "wget -N -P $JULIA_PATH https://julialang-s3.julialang.org/bin/linux/x64/$JULIA_MINOR_VERSION/julia-$JULIA_VERSION-linux-x86_64.tar.gz"
- "tar xf $JULIA_PATH/julia-$JULIA_VERSION-linux-x86_64.tar.gz -C $JULIA_PATH"
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.instantiate(; verbose=true)'"
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.build()'"
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.precompile()'"
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.status()'"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
command: "julia --color=yes --project -e 'using Pkg; Pkg.status()'"
notify:
- github_commit_status:
context: "Initialise environment"
context: "Setup test environment"


- label: ":speedboat: GPU unit tests"
commands:
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.Registry.update(); Pkg.test()'"
- label: ":speedboat: GPU tests"
depends_on: "init"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
- JuliaCI/julia-test#v1:
update_registry: false
coverage: false
notify:
- github_commit_status:
context: "GPU tests"

- label: ":rowboat: CPU unit tests"
env:
CUDA_VISIBLE_DEVICES: "-1"
commands:
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.Registry.update(); Pkg.test()'"
if: !build.pull_request.draft

- label: ":rowboat: CPU tests"
depends_on: "init"
env:
CUDA_VISIBLE_DEVICES: "-1"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
- JuliaCI/julia-test#v1:
update_registry: false
coverage: true
notify:
- github_commit_status:
context: "CPU tests"

if: !build.pull_request.draft

- label: ":docusaurus: Documentation"
depends_on: "init"
env:
CUDA_VISIBLE_DEVICES: "-1"
JULIA_DEBUG: "Documenter"
TMPDIR: "/var/lib/buildkite-agent/tmp"
commands:
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia --color=yes --project=docs/ -e 'using Pkg; Pkg.Registry.update(); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'"
- "$JULIA_PATH/julia-$JULIA_VERSION/bin/julia --color=yes --project=docs/ docs/make.jl"
depends_on: "init"
plugins:
- JuliaCI/julia#v1:
version: "1.10"
command:
- "julia --color=yes --project=docs/ -e 'using Pkg; Pkg.Registry.update(); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'"
- "julia --color=yes --project=docs/ docs/make.jl"
notify:
- github_commit_status:
context: "Documentation"

- wait: ~
continue_on_failure: true

- label: ":skeleton-dance: clean up environment"
command: "rm -rf $JULIA_PATH"
notify:
- github_commit_status:
context: "Clean up"
if: !build.pull_request.draft
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ examples = [

example_scripts = [ filename * ".jl" for (title, filename) in examples ]

replace_silly_warning(content) = replace(content, r"┌ Warning:.*\s+└ @ JLD2 ~/\.julia/packages/JLD2/.*/reconstructing_datatypes\.jl.*\n" => "")
replace_silly_warning(content) = replace(content, r"┌ Warning:.*\s+└ @ JLD2 ~/\.julia/packages/JLD2/.*/reconstructing_datatypes\.jl.*\n" => "",
r"┌ Warning:.*\s+└ @ JLD2 ~/.*/packages/JLD2/.*/reconstructing_datatypes\.jl.*\n" => "")

for example in example_scripts
example_filepath = joinpath(EXAMPLES_DIR, example)
Expand Down
28 changes: 16 additions & 12 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
include("dependencies_for_runtests.jl")

include("test_utils.jl")
include("test_light.jl")
include("test_slatissima.jl")
include("test_LOBSTER.jl")
include("test_NPZD.jl")
include("test_gasexchange.jl")
include("test_sediments.jl")
group = get(ENV, "TEST_GROUP", :all) |> Symbol

if architecture == CPU()
include("test_boxmodel.jl") # box models (probably) don't work on GPU, and it wouldn't be faster anyway
end
if group == :all
include("test_utils.jl")
include("test_light.jl")
include("test_slatissima.jl")
include("test_LOBSTER.jl")
include("test_NPZD.jl")
include("test_gasexchange.jl")
include("test_sediments.jl")

if architecture == CPU()
include("test_boxmodel.jl") # box models (probably) don't work on GPU, and it wouldn't be faster anyway
end

architecture == CPU() && @testset "Doctests" begin
doctest(OceanBioME)
architecture == CPU() && @testset "Doctests" begin
doctest(OceanBioME)
end
end