Skip to content
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

test(client): run functional tests in Data Proxy simulator #15010

Merged
merged 52 commits into from Sep 9, 2022
Merged

Conversation

aqrln
Copy link
Member

@aqrln aqrln commented Aug 25, 2022

It is now possible to use pnpm test:functional --data-proxy or pnpm test:functional --data-proxy --edge-client to run the functional tests in Mini-Proxy — the local Data Proxy simulator specifically made for use in tests (internal: repo).

It is similar to how, e.g., Cloudflare has Miniflare, but is an internal tool for now.

Although it doesn't share any code or architecture with the actual Data Proxy and is significantly simpler implementation of the Data Proxy API, the expectation is it should be a reasonable approximation for use in Prisma Client tests and allow us to have more confidence in the DataProxyEngine code and faster feedback loop. However, it is still essential to have ecosystem-tests running with the real Data Proxy.

Note: bash and openssl need to be installed and available in PATH for this to work on Windows.

Closes https://github.com/prisma/client-planning/issues/80


Use this to make some diffs in tests manageable to read:

.eslintignore Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
.prettierignore Outdated Show resolved Hide resolved
@aqrln aqrln marked this pull request as ready for review August 26, 2022 10:21
@aqrln aqrln requested a review from a team August 26, 2022 10:21
@aqrln aqrln requested review from danstarns, SevInf and millsp and removed request for a team August 26, 2022 10:21
@Jolg42
Copy link
Member

Jolg42 commented Aug 26, 2022

Note:

  • packages/client/helpers/mini-proxy/index.js
  • packages/client/helpers/mini-proxy/mini-proxy.js

Seems to be build artifacts and could be removed from git? But maybe it's only possible once it's moved in a separate package?

Copy link
Member

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

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

@aqrln
Copy link
Member Author

aqrln commented Aug 26, 2022

@Jolg42 they are build artifacts, yes. I left comments about them above. They will be removed once mini-proxy is on npm.

@aqrln
Copy link
Member Author

aqrln commented Aug 26, 2022

@Jolg42

Could you run the tests here too?
https://github.com/prisma/prisma/blob/main/.buildkite/publish/run.sh#L24-L32
https://github.com/prisma/prisma/blob/main/.buildkite/test/run.sh#L40-L45

Good point about the publish pipeline.

I didn't run it in the test pipeline on Buildkite intentionally and added Node.js 14 to the matrix on GitHub Actions instead to avoid running it twice (once with PRISMA_CLIENT_ENGINE_TYPE=binary and once with PRISMA_CLIENT_ENGINE_TYPE=library, which would be irrelevant and only waste CPU time). But it still needs to be run in the publish pipeline I think.

@Jolg42
Copy link
Member

Jolg42 commented Aug 26, 2022

Discussed offline:
We can ignore adding it to Buildkite, the only benefit would be that we run Node.js 14 on Buildkite but this will be tested on Node.js 14 on GitHub actions.

This reverts commit bfd9395 because it
breaks TEST_SKIP_* logic.
@aqrln aqrln merged commit a24c46c into main Sep 9, 2022
@aqrln aqrln deleted the data-proxy-tests branch September 9, 2022 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants