Skip to content

ci: Set TZ in coverage job to fix coveralls reporter - #1673

Merged
Kampfmoehre merged 1 commit into
mainfrom
fix/coveralls-timezone
Aug 28, 2026
Merged

ci: Set TZ in coverage job to fix coveralls reporter#1673
Kampfmoehre merged 1 commit into
mainfrom
fix/coveralls-timezone

Conversation

@Kampfmoehre

Copy link
Copy Markdown
Member

Problem

Every PR — and main itself — has been failing the coverage job since 2026-08-13. dotnet test passes; the failure is one step later, in the coveralls upload:

📄 Using coverage file: coverage/coverage.info
#<Time::Location::InvalidLocationNameError:Invalid location name: /UTC>
##[error]Process completed with exit code 1.

Root cause

The coverage job runs in container: mcr.microsoft.com/dotnet/sdk:10.0, which ships a malformed timezone config:

/etc/timezone            -> contains "/UTC"     (should be "UTC")
/etc/localtime  -> /usr/share/zoneinfo//UTC     (note the double slash)

The coveralls reporter is a Crystal binary. Time::Location.load_local reads /etc/timezone, gets /UTC, and raises InvalidLocationNameError — a location name may not start with /. Unhandled, so exit 1.

coverallsapp/github-action is pinned to v2.3.8, but the action downloads the latest reporter at run time, so this broke with no change in this repo:

Last green main.yml run 2026-08-13 20:06 UTC
coverage-reporter v0.6.18 released 2026-08-13 22:33 UTC

Fix

Set TZ: UTC on the job. Crystal short-circuits on TZ and never reads /etc/timezone.

Verification

Reproduced locally by running the reporter against a real coverage/coverage.info inside mcr.microsoft.com/dotnet/sdk:10.0:

  • without TZInvalidLocationNameError, exit 1 (identical to CI)
  • with TZ=UTC → proceeds all the way to the upload (fails only on a deliberately dummy repo token)

dotnet test /p:CollectCoverage=true also passes locally against a Postgres 17 container (67.88% total), confirming the test/DB path was never the problem.

Not covered by this PR

Two unrelated failures found while investigating — these stay red after this fix:

  1. chore: Bump the xunit group with 2 updates #1672 (xunit bump) fails inside dotnet test: microsoft.testing.platform.msbuild 2.3.3 errors with "Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later." This collides with test/Directory.Build.props, which opts out via TestingPlatformDotnetTestSupport=false / UseMicrosoftTestingPlatformRunner=false. Needs a real migration to the MTP dotnet test experience.

  2. A flaky testJobWorkerBaseTest.AddFailedProgressAsync_ShouldAddFailedProgres failed on chore: Bump Roslynator.Analyzers and 2 others #1667 with "Unable to set job items because no job repository is set." It's a race, not a roslynator problem: StartAsync returns as soon as ExecuteAsync hits its first await, so the test can call CallAddFailedProgressAsync(7) before the background loop has fetched the job and set the repo. The sibling SetTotalItemsAsync_ShouldThrowInvalidOperationException_WhenNoCurrentJobIsSet is already [Skip]ped for what looks like the same reason.

🤖 Generated with Claude Code

https://claude.ai/code/session_015BX2NY9ozmWKHsifii1KYP

The coverage job runs in mcr.microsoft.com/dotnet/sdk:10.0, which ships a
malformed timezone config: /etc/timezone contains "/UTC" and /etc/localtime
points at /usr/share/zoneinfo//UTC.

The coveralls reporter is a Crystal binary. Time::Location.load_local reads
/etc/timezone, gets "/UTC" and raises InvalidLocationNameError because a
location name may not start with "/", so the upload step aborts with exit 1:

  #<Time::Location::InvalidLocationNameError:Invalid location name: /UTC>

coverallsapp/github-action is pinned to v2.3.8, but it downloads the latest
reporter at run time, so this started without any change in this repo. The
last green run was 2026-08-13 20:06 UTC; coverage-reporter v0.6.18 was
published 2026-08-13 22:33 UTC. Every run since fails.

Setting TZ skips the /etc/timezone lookup entirely. Verified by running the
reporter against a real coverage.info inside the image: it crashes without TZ
and proceeds to upload with TZ=UTC.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015BX2NY9ozmWKHsifii1KYP
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 33165258633

Warning

No base build found for commit 278da99 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 85.393%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 582
Covered Lines: 507
Line Coverage: 87.11%
Relevant Branches: 130
Covered Branches: 101
Branch Coverage: 77.69%
Branches in Coverage %: Yes
Coverage Strength: 5.34 hits per line

💛 - Coveralls

@Kampfmoehre
Kampfmoehre merged commit cbfc23a into main Aug 28, 2026
4 checks passed
@Kampfmoehre
Kampfmoehre deleted the fix/coveralls-timezone branch August 28, 2026 11:30
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