-
-
Notifications
You must be signed in to change notification settings - Fork 159
Adds end to end server-client testing to miso-tests #1402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Zer0-
wants to merge
25
commits into
dmjio:master
Choose a base branch
from
Zer0-:miso-testing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Lower the test to mount 10k components to 10 so it won't take forever - so far only js version
- add executable integration-tests-server section to tests/miso-tests.cabal - remove tests/CHANGELOG.md and it's mention in the cabal file because it was making the build fail
- vibe code a generator
- missing some sections
- see how we can generate an explicit seed in QuickCheck
- compiles - adds missing sections - might throw this out
- quickcheck, even when using the exact same seed (which had to be generated as an Int32 because haskell's Int range is a lot larger than javascript's Number), does not generate the same view.
- have an intermediate html representation we can ship to the client - this time it's hand written and cleaner
- no errors according to w3c validator
- except for the defer attribute on the script tag for loading the
app, but that can't be the issue otherwise the app wouldn't even
boot (defer should be present or not present, it shouldn't have a
value)
- even the simplified html generation causes hydration issues (need to
investigate this)
- javascript backend only, wasm is TODO
- tests pass - There's a change to nix/haskell/packages/ghc/default.nix where I added the -fssr flag to miso, this fixes my test but i'm not sure if it breaks something else.
- also commit a js file to load the wasm script
- need to make client work with new test, which means being able to hydrate different kinds of data.
- should this work? This may be a failing test case - missing assertions that should run clientside
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.
This PR adds two tests:
- TestApp: generates a random html page with a link, clicks the link and
makes sure the app reacts to it (which implies hydration was successful)
- TestBindingsApp: Creates a variable-length chain of components with
variables bound to one another. The expectation is a change to
the value of the first component will propagate all the way down each component
and come back up to change a second value in the first component.
In order to test end-to-end playwright.ts was changed to be an http endpoint, that
way our haskell test server can control playwrite, which in turn points a browser at
the test server.
- Note: The changes to playwright.ts were almost entirely vibe-coded and then
tested by hand. It could definitely be slimmed down but I lack the motivation
atm.
There is also the server module TestServer that uses environment variables
to determine whether to link to the ghcjs or wasm payloads in the html, as well
as serving the initial html for each test. The tests rely on quickcheck's ioProperty,
for each iteration the actual http server is started in the background and the
test makes an http request to the playwright server to hit the server.
TODO:
I definitely expect a good amount of comments but I do think this way of testing is necessary.