Skip to content

Commit b23ed84

Browse files
Merge pull request #134 from codeflash-ai/live-connector-e2e
Add live connector e2e coverage
2 parents b2329db + 5017bf5 commit b23ed84

15 files changed

Lines changed: 4221 additions & 12 deletions

.github/workflows/connector-live-e2e.yml

Lines changed: 418 additions & 0 deletions
Large diffs are not rendered by default.

apps/oauth-service/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ enabled = true
88

99
[vars]
1010
LOCALITY_TOKEN_MODE = "handle"
11-
LOCALITY_NOTION_REDIRECT_URIS = "http://localhost:8757/oauth/notion/callback,http://127.0.0.1:8757/oauth/notion/callback"
11+
LOCALITY_NOTION_REDIRECT_URIS = "http://localhost:8757/oauth/notion/callback,http://127.0.0.1:8757/oauth/notion/callback,https://api.dev.locality.dev/v1/oauth/notion/callback"
1212
LOCALITY_GOOGLE_DOCS_REDIRECT_URIS = "http://localhost:8757/oauth/google-docs/callback,http://127.0.0.1:8757/oauth/google-docs/callback"
1313
LOCALITY_GMAIL_REDIRECT_URIS = "http://localhost:8757/oauth/gmail/callback,http://127.0.0.1:8757/oauth/gmail/callback"

docs/e2e-behavior-coverage.md

Lines changed: 140 additions & 11 deletions
Large diffs are not rendered by default.

docs/gmail-connector.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,32 @@ Locality removes that exact File Provider item and signals both the `draft/` and
172172
`sent/` containers. Remote or unconfirmed item deletion remains blocked. This
173173
does not require the user to run `loc pull` or refresh Finder.
174174

175+
## Live E2E
176+
177+
`tests/live_gmail_vfs_roundtrip.sh` exercises the live Gmail API, CLI
178+
mount/pull/diff/push, daemon, and Linux FUSE projection. It creates an unsent
179+
Gmail draft through the mounted `draft/` folder, verifies the draft projection,
180+
and deletes the Gmail draft through Gmail API cleanup.
181+
182+
Use a stored `connection:gmail-live` credential and a recipient address:
183+
184+
```bash
185+
secret_ref='connection:gmail-live'
186+
secret_hex="$(printf '%s' "$secret_ref" | od -An -tx1 -v | tr -d ' \n')"
187+
export LOCALITY_GMAIL_LIVE_CREDENTIAL_JSON="$(cat "$HOME/.loc/credentials/$secret_hex")"
188+
export LOCALITY_GMAIL_LIVE_TO_EMAIL='you@example.com'
189+
```
190+
191+
Use the full stored credential JSON. The live harness requires
192+
`access_token`, `oauth_broker_url`, `refresh_token_handle`, and numeric
193+
`expires_at` so it can exercise broker refresh when the token expires.
194+
195+
Run the gated live check:
196+
197+
```bash
198+
LOCALITY_LIVE_GMAIL_VFS=1 tests/live_gmail_vfs_roundtrip.sh
199+
```
200+
175201
## Useful Commands
176202

177203
Connect with the local broker:

docs/google-calendar-connector.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,32 @@ Agenda:
129129
with `sendUpdates=all`. Setting `google_calendar.conference: google_meet`
130130
requests a Google Meet link with `conferenceDataVersion=1`.
131131

132+
## Live E2E
133+
134+
`tests/live_google_calendar_vfs_roundtrip.sh` exercises the live Google
135+
Calendar API, CLI mount/pull/diff/push path, daemon, and Linux FUSE projection.
136+
It creates a scratch draft event through the mounted `draft/` directory,
137+
verifies the pushed event appears under `events/`, and deletes the event through
138+
Google Calendar API cleanup.
139+
140+
To reuse a stored `connection:google-calendar-live` credential:
141+
142+
```bash
143+
secret_ref='connection:google-calendar-live'
144+
secret_hex="$(printf '%s' "$secret_ref" | od -An -tx1 -v | tr -d ' \n')"
145+
export LOCALITY_GOOGLE_CALENDAR_LIVE_CREDENTIAL_JSON="$(cat "$HOME/.loc/credentials/$secret_hex")"
146+
```
147+
148+
Use the full stored credential JSON. The live harness requires
149+
`access_token`, `oauth_broker_url`, `refresh_token_handle`, and numeric
150+
`expires_at` so it can exercise broker refresh when the token expires.
151+
152+
Run the gated live test:
153+
154+
```bash
155+
LOCALITY_LIVE_GOOGLE_CALENDAR_VFS=1 tests/live_google_calendar_vfs_roundtrip.sh
156+
```
157+
132158
## Useful Commands
133159

134160
Connect with the local broker:

docs/google-docs-connector.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,36 @@ Live testing found and fixed several integration issues:
118118
- The OAuth broker project must have both Google Docs API and Google Drive API
119119
enabled.
120120

121+
## Live E2E
122+
123+
`tests/live_google_docs_vfs_roundtrip.sh` exercises the live Google Docs API,
124+
CLI mount/pull/diff/push paths, `localityd`, and the Linux FUSE projection. It
125+
uses isolated Locality state and a temporary shared root, creates one generated
126+
Google Docs page through the mounted filesystem, verifies the create marker
127+
survives a pull after push, edits the created document through mounted
128+
`page.md`, verifies the edit marker survives another pull, and trashes the
129+
created Drive file during cleanup.
130+
131+
Set the required environment from a stored `connection:google-docs-live`
132+
credential and choose a scratch workspace folder:
133+
134+
```bash
135+
secret_ref='connection:google-docs-live'
136+
secret_hex="$(printf '%s' "$secret_ref" | od -An -tx1 -v | tr -d ' \n')"
137+
export LOCALITY_GOOGLE_DOCS_LIVE_CREDENTIAL_JSON="$(cat "$HOME/.loc/credentials/$secret_hex")"
138+
export LOCALITY_GOOGLE_DOCS_LIVE_WORKSPACE_FOLDER='Locality Live E2E'
139+
```
140+
141+
Use the full stored credential JSON. The live harness requires
142+
`access_token`, `oauth_broker_url`, `refresh_token_handle`, and numeric
143+
`expires_at` so it can exercise broker refresh when the token expires.
144+
145+
Run the gated test explicitly:
146+
147+
```bash
148+
LOCALITY_LIVE_GOOGLE_DOCS_VFS=1 tests/live_google_docs_vfs_roundtrip.sh
149+
```
150+
121151
## Useful Commands
122152

123153
Connect with the local broker:

docs/linear-connector.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,27 @@ Sidecar remote ids use `linear-context:<issue_id>:comments`,
104104
`linear-context:<issue_id>:history`. Apply and concurrency checks reject these
105105
ids as read-only before any `issueUpdate` mutation is attempted.
106106

107+
## Live E2E
108+
109+
`tests/live_linear_vfs_roundtrip.sh` exercises the live Linear API, CLI
110+
mount/pull/diff/push flow, daemon, and Linux FUSE projection. It edits one
111+
existing scratch issue body through the mounted `page.md`, pushes the marker to
112+
Linear, pulls it back, and restores the original issue content before exiting.
113+
114+
Set the API key and scratch issue UUID before running it:
115+
116+
```bash
117+
export LINEAR_API_KEY='lin_api_...'
118+
export LOCALITY_LINEAR_LIVE_ISSUE_ID='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
119+
```
120+
121+
The issue should be scratch content because the test temporarily appends a
122+
unique marker to the issue body and then restores the saved original content.
123+
124+
```bash
125+
LOCALITY_LIVE_LINEAR_VFS=1 tests/live_linear_vfs_roundtrip.sh
126+
```
127+
107128
## Attachments
108129

109130
Linear issue attachments are external links. During hydration of

docs/slack-connector.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,37 @@ deletes, push writes, undo writes, and autosave writes under Slack mounts.
8888
V1 does not post messages, subscribe to Slack events, or store arbitrary Slack
8989
search results.
9090

91+
## Live E2E
92+
93+
`tests/live_slack_vfs_read.sh` exercises the live Slack API, CLI
94+
mount/pull/status, daemon, and Linux FUSE projection by reading a known
95+
conversation's `recent.md` and verifying Slack remains read-only through the
96+
mounted filesystem and product push validation. The live script refuses
97+
`public_channel` mounts because Slack public-channel reads can auto-join
98+
channels; use a private channel, DM, or group DM where the app is already
99+
present.
100+
101+
To reuse a stored `connection:slack-live` credential in isolated test state:
102+
103+
```bash
104+
secret_ref='connection:slack-live'
105+
secret_hex="$(printf '%s' "$secret_ref" | od -An -tx1 -v | tr -d ' \n')"
106+
export LOCALITY_SLACK_LIVE_CREDENTIAL_JSON="$(cat "$HOME/.loc/credentials/$secret_hex")"
107+
export LOCALITY_SLACK_LIVE_CONVERSATION_ID='G0123456789'
108+
```
109+
110+
Use the full stored credential JSON. The live harness requires
111+
`access_token`, `oauth_broker_url`, `refresh_token_handle`, and numeric
112+
`expires_at` so it can exercise broker refresh when the token expires.
113+
114+
Set `LOCALITY_SLACK_LIVE_TYPES` when the target conversation is not covered by
115+
the default `private_channel,im,mpim` type set. Do not set `public_channel` for
116+
this live test.
117+
118+
```bash
119+
LOCALITY_LIVE_SLACK_VFS=1 tests/live_slack_vfs_read.sh
120+
```
121+
91122
## Useful commands
92123

93124
```bash

0 commit comments

Comments
 (0)