Skip to content

Make it possible to customize the worker a test is run on.#9

Merged
maleadt merged 1 commit into
mainfrom
tb/test_worker
Oct 10, 2025
Merged

Make it possible to customize the worker a test is run on.#9
maleadt merged 1 commit into
mainfrom
tb/test_worker

Conversation

@maleadt

@maleadt maleadt commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator

In the case of Metal.jl, some tests require specific env vars to be set:

function test_worker(name)
    if name == "capturing"
        return addworker(env=["METAL_CAPTURE_ENABLED"=>"1"])
    end

    return nothing
end

In the case of Metal.jl, some tests require specific env vars to be set.
@maleadt maleadt merged commit b09d96a into main Oct 10, 2025
15 checks passed
@maleadt maleadt deleted the tb/test_worker branch October 10, 2025 08:11
Comment thread src/ParallelTestRunner.jl

Add `X` worker processes, with additional keyword arguments passed to `addprocs`.
"""
test_exeflags = Base.julia_cmd()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is set at precompile time, which feels very wrong.

Comment thread src/ParallelTestRunner.jl
Comment on lines +225 to +227
push!(test_exeflags.exec, "--check-bounds=yes")
push!(test_exeflags.exec, "--startup-file=no")
push!(test_exeflags.exec, "--depwarn=yes")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think users may want to control at least --check-bounds or --depwarn?

Comment thread src/ParallelTestRunner.jl
push!(test_exeflags.exec, "--startup-file=no")
push!(test_exeflags.exec, "--depwarn=yes")
push!(test_exeflags.exec, "--project=$(Base.active_project())")
test_exename = popfirst!(test_exeflags.exec)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the point above that this is set at precompile time, this is going to point to the wrong environment when the package is used in multiple environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants