mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
These had been failing on every run, and each turned out to be a different
fault rather than a broken assertion.
autopickReadLeavesNoTrace. snap-src/bin/database-autopick reads MongoDB's
data-file mtimes so that starting mongod to compare the two databases does not
make MongoDB look freshly written. It spelled that with `stat -c %Y` and
`touch -d @EPOCH`, which are GNU. On macOS the stat fails, every file is
skipped by the `|| continue` beside it, MONGO_MTIME_BEFORE stays 0, and the
restore returns having done nothing - silently, and only there. The snap runs
on Linux, but WeKan is developed on macOS and this test runs the real functions
wherever it is run. They now try the GNU spelling and fall back to the BSD one.
provenanceTable. releases/provenance-table.sh opened with
`shopt -s nullglob globstar`, and globstar arrived in bash 4 while macOS still
ships bash 3.2 as /bin/bash: "shopt: globstar: invalid shell option name", and
`set -e` took the script with it. The default file list is a single `find` now,
recursive as `**/` was, with -print0 so a path containing a space survives.
Then the empty case failed too - under `set -u`, bash 3.2 calls an empty array
an unbound variable where 4.4 does not - so the loop uses the
`${files[@]+"${files[@]}"}` form.
sesothoTranslationProgress. Two faults. The script's own `--list` output was
TRUNCATED whenever stdout was a pipe: it prints 128 KB with console.log and
then calls process.exit, which cuts off whatever has not drained, and a pipe
delivered 65,510 bytes - valid-looking JSON stopping mid-key, with status 0.
Redirecting to a file worked, because stdout to a file is synchronous, so this
only bit anything that read the output programmatically. It is written with
fs.writeSync in a loop now, EAGAIN retried, before the exit. The test's other
half asserted an EXACT count of untranslated strings, which went red when
ENGLISH gained the four history-change-* keys - a fact about English, not about
Sesotho. It is a ceiling now: still catches a translation being lost, and does
not demand editing for every new string.
Two of the three guards were updated rather than the code, and both times
because they pinned a spelling rather than a behaviour - the exact globstar
pattern, and an exact count. Both now assert the property that was wanted.
A note for the next one: two of these assertions had to be re-scoped to the
CODE because they matched the COMMENT explaining them. Prose satisfying an
assertion about code is how a guard passes while testing nothing.
Thanks to xet7 !