ts: cover remaining tcl/ line-coverage gaps - #673
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MODULES_COLORenv var override branch, and remove an unreachableintvallistguard found alongside it in the color config init proc.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).CODECOV_TOKENfrom the coverage upload steps, since fork-triggered PR runs never receive base repo secrets and the token was silently failing the upload for those.