Repository navigation
conformance: fixed timestamps in the table golden tests (flaky byte comparison) - #216
Merged
Merged
Conversation
Without document properties, docProps/core.xml holds the time of each write, so the byte comparison of the table golden files failed whenever the two writes fell in different seconds (seen on #215: Node 24 / React 19 and Node 26 / React 17). Write both sides with fixed created/modified dates, as the corpus files already are.
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.
The table golden tests in
test/conformance/golden.test.tsx(from #213) compare react-data-export's file with javascript-excel's byte for byte. They didn't set document properties, sodocProps/core.xmlcarried the time of each write. The two files then differed whenever the two writes fell in different seconds. This is now a required check, and it failed on #215:<ExportTableButton> is byte-identicalon Node 24 / React 19 and Node 26 / React 17.Fix: both sides are written with fixed
created/modifieddates (propertiesforexportTable,useTableExportand<ExportTableButton>;propertiesin thetoUint8Arrayreference). The corpus and builder tests already use fixed dates.Cause checked locally: two
toUint8Arraywrites of the same workbook 1.1 s apart differ without properties and are identical with fixed ones. After the fix, the golden file passes 5 runs out of 5, andnpm testandnpm run typecheckpass.Tests only; no changeset.