test: build the oversized hook-test input in bash, not python3 #865
No reviewers
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea!865
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-627-hook-test-drop-python3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
What was wrong
The test
hooks/tests/surface-tool-error.test.shbuilt its oversized error text with apython3one-liner. The test needs this text to check that the hook cuts long errors to 500 characters.The fallback was
printf '%0.s x' {1..600}. That command prints 600 copies of " x", which is 1200 characters, not 600. The test passed with either string because both are longer than 500 characters. But the fallback did not match the code it replaced, and the test needed no Python.What changed
hooks/tests/surface-tool-error.test.sh,long_textnow comes fromprintf 'x%.0s' {1..600}alone. Thepython3call and the wrong fallback are gone.long_textis exactly 600 characters. It printsPASS [oversized input is 600 chars]orFAIL [oversized input is N chars, expected 600]and updates the pass and fail counters like the other checks in the file.No hook code changed. Only the test file changed.
What the tests cover
Refs #627
./scripts/gate.shpasses on this commit.Closes #627