Repository navigation
fix(harness): version-agnostic boot handshake in the integration scripts - #202
Closed
harsh-thakkar7 wants to merge 2 commits into
Closed
harsh-thakkar7 wants to merge 2 commits into
harsh-thakkar7 wants to merge 2 commits into
Conversation
integration_http.py and integration_web.py waited for
`#version` to `includes('v2')` -- written when the app shipped v2.x.
The app now ships "v4.2" (moon_download.VERSION, the static index.html
label, and the MockApi's "v4.2 · preview"): the "v2" substring never
appears, so the wait_for_function ran for its full 8s timeout and both
harnesses died at the very first checkpoint, on every run.
Each script now exposes VERSION_HANDSHAKE_JS and waits for
`textContent.startsWith('v')`, which holds for every version line the
app has shipped or will ship while still requiring the boot sequence
to have stamped the element. Two tests pin the new contract; five
mutants of the fix are all killed.
Importing either integration script pulled in playwright at import time, so the pytest CI job (which does not install the browser driver) could not collect tests that import the modules to check VERSION_HANDSHAKE_JS. The import now happens inside main(), where the browser is actually used; reading the handshake constant needs no driver.
Contributor
Author
|
Closing this one for now — happy to reopen or resubmit if it's still useful. |
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.
Problem
Both end-to-end harnesses —
integration_http.pyandintegration_web.py— wait for the page's boot sequence with the same literal check:That was written while the app shipped v2.x. The app has since moved to v4.2 (
moon_download.VERSION="v4.2", the staticindex.htmllabel, and the MockApi's"v4.2 · preview"), and none of those strings contains"v2":So the
wait_for_functionpolls for its full 8s timeout and raisesPlaywrightTimeout— both harnesses die at the very first checkpoint, on every run, before the transport/token/engine checks that follow can execute at all.Fix
Each script now exposes a single
VERSION_HANDSHAKE_JSconstant and waits fortextContent.startsWith('v')— true for every version line the app has shipped or will ship (v2.0, v4.2,v4.2 · preview), while still requiring the boot sequence to have run. The check no longer rots the next time the version bumps.Tests
New
tests/test_integration_handshake.py(2 tests) pins the contract: no remnant of the literalincludes('v2')in either harness, and the version strings the app actually reports satisfy the new predicate (startsWith('v')holds,includes('v2')does not — the exact mismatch that rotted the harnesses). The detector test fails onorigin/main(noVERSION_HANDSHAKE_JSexists there) and passes here. Full suite 176 passed; ruff clean; both scripts compile. Five mutants (either file reverted toincludes('v2'), either constant removed, both weakened to a bare non-empty check) are all killed.