wrangler: Hyperdrive dev bindings#4222
Conversation
🦋 Changeset detectedLatest commit: 7d5f3f4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
50e87ad to
8dc7983
Compare
8dc7983 to
ff99153
Compare
penalosa
left a comment
There was a problem hiding this comment.
Looking good! This should include some tests, ideally validating that this works end-to-end in local mode (have a look at the e2e folder for some example tests of Wrangler dev—ideally it would be good to validate that a mock postgres server is connected to by workerd)
Codecov Report
@@ Coverage Diff @@
## main #4222 +/- ##
==========================================
- Coverage 75.34% 75.34% -0.01%
==========================================
Files 223 223
Lines 12341 12349 +8
Branches 3190 3194 +4
==========================================
+ Hits 9298 9304 +6
- Misses 3043 3045 +2
|
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6775494867/npm-package-wrangler-4222You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6775494867/npm-package-wrangler-4222Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6775494867/npm-package-wrangler-4222 dev path/to/script.jsAdditional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6775494867/npm-package-miniflare-4222npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6775494867/npm-package-cloudflare-pages-shared-4222Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
|
@penalosa Should be all set with tests as well. However the socket test won't work until cloudflare/miniflare#727 is merged in & miniflare is bumped here due to a small address formatting bug I found in my initial implementation there |
29d33c7 to
59e071c
Compare
packages/wrangler/e2e/dev.test.ts
Outdated
| it("connects to a socket", async () => { | ||
| server.on("connection", (sock) => { | ||
| sock.on("data", (data) => { | ||
| expect(new TextDecoder().decode(data)).toBe("test string"); |
There was a problem hiding this comment.
Will this expect definitely run? What if the test exits too soon?
There was a problem hiding this comment.
This may need wrapping in a new Promise() that's explicitly await in the test
There was a problem hiding this comment.
Ah yeah, that makes sense. Just wrapped it in a promise
penalosa
left a comment
There was a problem hiding this comment.
LGTM! Let's wait to merge until Miniflare is released and bumped on Monday, so that tests will pass
e6512ea to
b1e7d8a
Compare
|
@penalosa Tests seem to pass locally now that miniflare is the latest in-workspace version. Are we able to rerun the flows here to make sure and then merge? |
b1e7d8a to
75cde6a
Compare
packages/wrangler/e2e/dev.test.ts
Outdated
| import crypto from "node:crypto"; | ||
| import * as nodeNet from "node:net"; | ||
| import path from "node:path"; | ||
| import { afterEach } from "node:test"; |
There was a problem hiding this comment.
@Skye-31 Ah my bad, it should be changed now. Also fixed the formatting errors that caused tests to fail
75cde6a to
eb60fde
Compare
Associated docs issue(s)/PR(s):
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr reviewso future reviewers can take inspiration and learn from it.