Skip to content

ts: cover remaining tcl/ line-coverage gaps - #673

Merged
xdelaruelle merged 5 commits into
envmodules:mainfrom
xdelaruelle:coverage-tcl-report
Aug 15, 2026
Merged

ts: cover remaining tcl/ line-coverage gaps#673
xdelaruelle merged 5 commits into
envmodules:mainfrom
xdelaruelle:coverage-tcl-report

Conversation

@xdelaruelle

@xdelaruelle xdelaruelle commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator
  • Cover the invalid-MODULES_COLOR env var override branch, and remove an unreachable intvallist guard found alongside it in the color config init proc.
  • Cover the eval [...]-wrapped topmost stack frame case in the error stack trace formatting proc, via a corrected synthetic siteconfig test (the existing one used an unquoted frame that never matched that shape).
  • Cover the comments-only modulespath init file case (present but yielding no path entries), distinct from the file being absent or containing real paths.
  • Drop the now-unnecessary CODECOV_TOKEN from the coverage upload steps, since fork-triggered PR runs never receive base repo secrets and the token was silently failing the upload for those.

The color config init proc ignores the Modules-specific env var
override when its value is not part of the valid value list for that
option, falling back to whatever value was already determined
(default or NO_COLOR/CLICOLOR derived). The existing MODULES_COLOR
coverage only ever set valid values (never/auto/always), so that
ignore branch was never exercised.

Add a case setting MODULES_COLOR to an invalid value and checking
color rendering matches the default configuration, confirming the
override is ignored.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
The color config value internal-representation conversion was
guarded by a check on intvallist length, but this proc is only ever
registered as the init callback for the color option, always with the
same non-empty intvallist. The guard can never evaluate false.

Drop the guard, keeping its body unconditional. This changes nothing
at runtime since the branch was unreachable, so no new test is needed.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
The error stack trace filtering proc special-cases a topmost frame
whose command is 'eval', extracting the second word of that frame to
compare it against the internal command filter list instead of the
literal word 'eval' -- needed since modulefile content is evaluated
through an 'eval [...]' wrapper around the proc that fetches it. The
existing synthetic siteconfig case for this proc used an unquoted,
hand-written frame that never matched this shape, leaving that branch
untested.

Add a second synthetic case whose topmost frame is a properly quoted
'eval [...]' wrapper, matching the real shape produced when evaluating
modulefile content.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
The startup logic that reads the site-wide modulespath init file
skips the module-use call entirely when every line is a comment (no
path collected), a case distinct from the file being absent or
containing actual paths -- both already covered. Add a case that
temporarily swaps the installed modulespath file for a comments-only
variant and checks a fresh autoinit adds no extra search path,
restoring the original content afterward.

Verified against a probe copy of the built interpreter that the skip
branch is reached and the expected output produced (a local coverage
run was inconclusive: other, pre-existing environment-dependent
failures elsewhere in this same test file abort the build before the
coverage markup step runs, on a checkout not fully installed to its
configured prefix).

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Base repo secrets aren't exposed to pull_request runs triggered from
forks, so CODECOV_TOKEN was always empty for fork PRs and the upload
silently failed. Codecov can identify public repos automatically via
GitHub's identity checks, so no token is needed and coverage now
uploads for fork PRs too.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
@xdelaruelle
xdelaruelle merged commit 87deb87 into envmodules:main Aug 15, 2026
30 checks passed
@xdelaruelle
xdelaruelle deleted the coverage-tcl-report branch August 15, 2026 13:11
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.

1 participant