Skip to content

fix(solidstart): Use production server for e2e tests #14033

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

andreiborza
Copy link
Member

Adds a small post-build script to copy over deps that are not correctly resolved in our yarn workspace/pnpm e2e test applications (but do work correctly in standalone projects). This allows us to finally use the vinxi production server to run e2e tests and is similar to what the Nuxt SDK has to do.

Also allows us to get rid of the double page loads for the first test to avoid hydration errors that were caused by the dev server previously.

Adds a small post-build script to copy over deps that are not correctly resolved
in our yarn workspace/pnpm e2e test applications (but do work correctly in
standalone projects). This allows us to finally use the vinxi production server
to run e2e tests and is similar to what the Nuxt SDK has to do.
"Cleaning the build output should be removed once we can use `vinxi start`."
],
"preview": "pnpm clean:build && HOST=localhost PORT=3030 NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi dev",
"start": "HOST=localhost PORT=3030 NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi start",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need the start command anymore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the playwright config has pnpm preview as a start command, so this is probably not necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, what @s1gr1d said. I had the start in there just for local testing but it's not necessary anymore.

Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, that you got this to work with SolidStart as well 👍

@andreiborza
Copy link
Member Author

Nice, that you got this to work with SolidStart as well 👍

I wish it would just be the import-in-the-middle hook that was missing, but in my case the solidrouter server file is also missing. I couldn't quite figure out why that was. But yea, happy we can run tests with a production server now, thanks for also looking into this issue and figuring it out for the Nuxt SDK :)

@andreiborza andreiborza merged commit 8b1f130 into develop Oct 21, 2024
123 checks passed
@andreiborza andreiborza deleted the ab/solidstart-e2e-production-server branch October 21, 2024 11:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants