Skip to content

tests.yml: set group env via shell: bash so GROUP propagates on Windows#100

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-windows-group-env-shell-bash
Draft

tests.yml: set group env via shell: bash so GROUP propagates on Windows#100
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-windows-group-env-shell-bash

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown

Problem

The Set test group env step in tests.yml writes <group-env-name>=<group> to $GITHUB_ENV using bash $VAR syntax but declares no shell:. On windows runners the default shell is PowerShell, which does not expand "$GITHUB_ENV" the bash way — it writes to a file literally named $GITHUB_ENV rather than appending to the runner environment file. Result: the group env var (e.g. GROUP) is silently never set on Windows.

With GROUP unset, a package's runtests.jl falls back to its default group (SciMLTesting's run_tests() defaults to "All"). So a matrix entry scheduled as Core on windows-latest actually ran every group folder, including groups that carry their own test/<Group>/Project.toml (e.g. an AD group depending on SciMLSensitivity) — inside the main test environment. Activating that second project mid-session upgrades already-loaded packages and triggers precompile conflicts.

Observed in SciML/DiffEqCallbacks.jl

tests / Core (julia 1|lts, windows-latest) failed with:

invalid method definition in OrdinaryDiffEqCorePolyesterExt: exported function OrdinaryDiffEqCore._polyester_batch does not exist

because the Core job leaked into the AD group (Activating project at ...\test\AD, OrdinaryDiffEqCore v4.3.0 [loaded: v3.33.1]) and using SciMLSensitivity failed to precompile against the stale loaded OrdinaryDiffEqCore. Linux/macOS Core jobs (bash default) ran only the Core folder and passed.

Fix

Add shell: bash to the Set test group env step so $GITHUB_ENV expands on every OS and the group is set correctly on Windows. This is the same shell the adjacent GITHUB_ENV/GITHUB_OUTPUT steps already use.

downgrade.yml is unaffected: it sets GROUP via the runtest step's env: map (shell-independent).

This fixes Windows grouped-tests for every SciML repo that uses grouped-tests.yml/tests.yml, not just DiffEqCallbacks.jl. v1 will need to be retagged to this commit for callers pinned at @v1 to pick it up.

Please ignore until reviewed by @ChrisRackauckas

The "Set test group env" step writes `<group-env-name>=<group>` to
$GITHUB_ENV with bash syntax but declared no `shell:`, so it ran under the
windows runners' default shell (PowerShell). PowerShell does not expand the
bash-style "$GITHUB_ENV"; the step wrote to a file literally named
$GITHUB_ENV instead of appending to the runner's environment file, so the
group env var (e.g. GROUP) was silently never set on Windows.

With GROUP unset, a package's runtests.jl falls back to its default group
(SciMLTesting's run_tests defaults to "All"), so a matrix entry scheduled as
"Core" on windows-latest actually ran every group's folder -- including
groups with their own test/<Group>/Project.toml (e.g. an AD group pulling
SciMLSensitivity) -- inside the main test environment. That activated a second
project mid-session and upgraded already-loaded packages, producing precompile
conflicts (observed in DiffEqCallbacks.jl: OrdinaryDiffEqCorePolyesterExt
referencing OrdinaryDiffEqCore._polyester_batch against a stale loaded
OrdinaryDiffEqCore) and a windows-only red. Linux/macOS runners default to bash
and were unaffected.

Add `shell: bash` so $GITHUB_ENV expands on every OS and the group is set
correctly on Windows. downgrade.yml is unaffected (it sets GROUP via the step
`env:` map, which is shell-independent).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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