From 2c78574fa2ade250d7a2e6b4be160167ecf9d265 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 2 Apr 2024 12:16:45 -0400 Subject: [PATCH 1/6] Update runtests.jl --- test/runtests.jl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 3eb1de97..8179b04f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,7 +21,18 @@ if Base.USE_GPL_LIBS # Test multithreaded execution @testset "threaded SuiteSparse tests" verbose = true begin @testset "threads = $nt" begin - include("threads.jl") + # 1. If the OS is Windows and we are in GitHub Actions CI, we do NOT run the `threads` tests. + # 2. If the OS is Windows and we are NOT in GitHub Actions CI, we DO run the `threads` tests. + # 3. If the OS is NOT Windows, we DO run the `threads` tests. + # + # So, just for example: + # - If the OS is Windows and we are in Buildkite CI, we DO run the `threads` tests. + if Sys.iswindows() && is_github_actions_ci() + @warn "Skipping `threads` tests on Windows on GitHub Actions CI" + @test_broken false + else + include("threads.jl") + end end # test both nthreads==1 and nthreads>1. spawn a process to test whichever # case we are not running currently. From 3b69974eaceab302b0b770e1a7d9380a69725421 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 2 Apr 2024 12:20:27 -0400 Subject: [PATCH 2/6] Create gha.jl --- test/util/gha.jl | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/util/gha.jl diff --git a/test/util/gha.jl b/test/util/gha.jl new file mode 100644 index 00000000..b7b17ee8 --- /dev/null +++ b/test/util/gha.jl @@ -0,0 +1,6 @@ +function is_github_actions_ci() + is_ci = parse(Bool, get(ENV, "CI", "false")) + is_gha = parse(Bool, get(ENV, "GITHUB_ACTIONS", "false")) + + return is_ci && is_gha +end From 18621efc393dc546ca603dbabf17db5d5e2b9a38 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 2 Apr 2024 12:20:57 -0400 Subject: [PATCH 3/6] Update runtests.jl --- test/runtests.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 8179b04f..444b53b9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,9 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license using Test, LinearAlgebra, SparseArrays +# Some utility functions: +include("util/gha.jl") + if Base.get_bool_env("SPARSEARRAYS_AQUA_TEST", false) include("ambiguous.jl") end From ad7257354bef3e5202618ae73aa5f0e9d7c3f532 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 2 Apr 2024 12:29:18 -0400 Subject: [PATCH 4/6] More logging --- test/runtests.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 444b53b9..5f4de798 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -34,7 +34,9 @@ if Base.USE_GPL_LIBS @warn "Skipping `threads` tests on Windows on GitHub Actions CI" @test_broken false else + @info "Beginning `threads` tests..." include("threads.jl") + @info "Finished `threads` tests" end end # test both nthreads==1 and nthreads>1. spawn a process to test whichever From 3ce3ff6fe45cab2116d9f7e51cfb7579a2c88eb2 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 2 Apr 2024 14:49:48 -0400 Subject: [PATCH 5/6] Update runtests.jl --- test/runtests.jl | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 5f4de798..e403447c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -24,6 +24,12 @@ if Base.USE_GPL_LIBS # Test multithreaded execution @testset "threaded SuiteSparse tests" verbose = true begin @testset "threads = $nt" begin + include("threads.jl") + end + # test both nthreads==1 and nthreads>1. spawn a process to test whichever + # case we are not running currently. + other_nthreads = nt == 1 ? 4 : 1 + @testset "threads = $other_nthreads" begin # 1. If the OS is Windows and we are in GitHub Actions CI, we do NOT run the `threads` tests. # 2. If the OS is Windows and we are NOT in GitHub Actions CI, we DO run the `threads` tests. # 3. If the OS is NOT Windows, we DO run the `threads` tests. @@ -34,29 +40,21 @@ if Base.USE_GPL_LIBS @warn "Skipping `threads` tests on Windows on GitHub Actions CI" @test_broken false else - @info "Beginning `threads` tests..." - include("threads.jl") - @info "Finished `threads` tests" - end - end - # test both nthreads==1 and nthreads>1. spawn a process to test whichever - # case we are not running currently. - other_nthreads = nt == 1 ? 4 : 1 - @testset "threads = $other_nthreads" begin - let p, cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads.jl` - p = run( - pipeline( - setenv( - cmd, - "JULIA_NUM_THREADS" => other_nthreads, - dir=@__DIR__()), - stdout = stdout, - stderr = stderr), - wait = false) - if !success(p) - error("SuiteSparse threads test failed with nthreads == $other_nthreads") - else - @test true # mimic the one @test in threads.jl + let p, cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads.jl` + p = run( + pipeline( + setenv( + cmd, + "JULIA_NUM_THREADS" => other_nthreads, + dir=@__DIR__()), + stdout = stdout, + stderr = stderr), + wait = false) + if !success(p) + error("SuiteSparse threads test failed with nthreads == $other_nthreads") + else + @test true # mimic the one @test in threads.jl + end end end end From 9f5aa9f7acb991fc186d8ea8476f09758df0d441 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 2 Apr 2024 15:09:24 -0400 Subject: [PATCH 6/6] Reorganize some comments --- test/runtests.jl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index e403447c..fbe97406 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -30,12 +30,13 @@ if Base.USE_GPL_LIBS # case we are not running currently. other_nthreads = nt == 1 ? 4 : 1 @testset "threads = $other_nthreads" begin - # 1. If the OS is Windows and we are in GitHub Actions CI, we do NOT run the `threads` tests. - # 2. If the OS is Windows and we are NOT in GitHub Actions CI, we DO run the `threads` tests. + # 1. If the OS is Windows and we are in GitHub Actions CI, we do NOT run + # the `threads` tests. + # 2. If the OS is Windows and we are NOT in GitHub Actions CI, we DO run + # the `threads` tests. + # - So, just as an example, if the OS is Windows and we are in + # Buildkite CI, we DO run the `threads` tests. # 3. If the OS is NOT Windows, we DO run the `threads` tests. - # - # So, just for example: - # - If the OS is Windows and we are in Buildkite CI, we DO run the `threads` tests. if Sys.iswindows() && is_github_actions_ci() @warn "Skipping `threads` tests on Windows on GitHub Actions CI" @test_broken false