1.4 KiB
1.4 KiB
PR#144: Tests in One Locale
WARNING: This document describes only the change applied in this PR. It may already be outdated once the next PR is merged. Historic PR-documentation is not maintained along with new PRs — treat it as a snapshot, not as current documentation.
The Problem
The tests ran in whatever locale the host had, and so did the processes they start, bash and git among them.
On a host with a German LC_NUMERIC, bash writes EPOCHREALTIME as 1791625756,465101; $((…)) reads the comma as its comma operator.
That made a test of PR#143 fail locally, while it would have passed on another host.
Non-Goals
- No change to the locale of Werkator itself or of the builds it runs.
The Scenarios
Scenario#144.01: Tests run in the US English locale
- Given a host with another locale, e.g. a German
LC_NUMERIC - When a test runs, under Gradle or under PIT
- Then the test and the processes it starts use
en_US.UTF-8 - So that a test that formats or parses numbers, dates or messages behaves the same on every host.
Verified by
The Solution
- Every
Testtask setsLANGandLC_ALLtoen_US.UTF-8, anduser.languageanduser.countrytoenandUS. - The
pitesttask sets the same environment for its main process; PIT's test processes inherit it.