;dev:web: don't let the add-form tests depend on post param order - #2713
Draft
acinader wants to merge 1 commit into
Draft
;dev:web: don't let the add-form tests depend on post param order#2713acinader wants to merge 1 commit into
acinader wants to merge 1 commit into
Conversation
The add form pairs the repeated account and amount params by position. yesod-test before 1.7.0 renders post params in reverse addition order (fixed by yesodweb/yesod#1867), so the second posting's blank amount arrived first, leaving an account with no amount. The post then failed validation. Sending an explicit amount for both postings makes the pairing correct in either order. Reported by hseg on stack98.yaml; stack96.yaml (yesod-test 1.6.16) and stack910.yaml (1.6.19) are affected too. stack.yaml has 1.7.0.2, which is why ci.yml is green. AI usage: Claude Opus 5, ~25k output tokens
Contributor
Author
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.
Reported by @hseg in #2700: two write tests fail on stack98.yaml.
yesod-test before 1.7.0 renders post params in reverse addition order (fixed by
yesodweb/yesod#1867). The add form pairs the repeated
account/amountparams byposition, so on those snapshots the second posting's blank amount arrives first and leaves
an account with no amount. The post fails validation, and "adds a transaction when the CSRF
token is present" and "does not let the add form write a newline into the journal" fail.
Sending an explicit amount for both postings makes the pairing correct in either order.
hledger-web itself is unaffected — a browser sends form fields in document order.
Affected: stack96.yaml (yesod-test 1.6.16), stack98.yaml (1.6.16), stack910.yaml (1.6.19).
Fine on stack.yaml (1.7.0.2) and stack912.yaml (1.7.0.1), which is why ci.yml is green.
oldest.yml (stack96.yaml) runs the suites too, but its head is 36740f0, before these
tests landed — so it would go red as it stands.
Verified with
stack test hledger-web, and by posting the paramsin reverse order on the current stack.yaml to simulate the older yesod-test — that
reproduces the reported failure, and passes with this change.
AI usage: Claude Opus 5, ~25k output tokens