Skip to content

Commit fe7f371

Browse files
committed
test(vt): drop the cmp dependency from the release-notes contract
Wiring this contract into scripts/test.sh Step 0l made it run on the Windows VM for the first time, where it failed with 'cmp: command not found' -- MSYS2 does not ship cmp, and diff is not guaranteed either. The script already requires python3, so compare the bytes there instead. The failure was real coverage working as intended: the contract had never run on Windows before, because it was registered only in the test.sh version that this branch replaces. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 17f4f6d commit fe7f371

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tests/test_vt_release_notes_contract.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ done
118118
! grep -q '70+' "$FIX/first.md" || fail "unmeasured engine claim returned"
119119

120120
run_notes "$FIX/first.md" "$FIX/second.md"
121-
cmp -s "$FIX/first.md" "$FIX/second.md" || fail "marked release-note update is not idempotent"
121+
# python3 rather than cmp/diff: this contract runs on the Windows VM's MSYS2
122+
# shell too, where neither is guaranteed to be on PATH (cmp is not).
123+
python3 -c 'import sys;sys.exit(0 if open(sys.argv[1],"rb").read()==open(sys.argv[2],"rb").read() else 1)' \
124+
"$FIX/first.md" "$FIX/second.md" || fail "marked release-note update is not idempotent"
122125

123126
cp "$FIX/binaries/vt-results.tsv" "$FIX/binaries/vt-results.clean.tsv"
124127
printf '\textra-cell\n' >> "$FIX/binaries/vt-results.tsv"

0 commit comments

Comments
 (0)