Skip to content

Commit 894c8a0

Browse files
committed
docs: add Globus user integration test plan
1 parent f0e1c08 commit 894c8a0

2 files changed

Lines changed: 316 additions & 0 deletions

File tree

tests/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Developer test suites for `git-drs` (local and remote integration). These are in
44

55
See also: [E2E Modes + Local Setup](../docs/e2e-modes-and-local-setup.md)
66

7+
For a browser-driven test against real Globus Auth and Transfer services, see
8+
the [Globus User-Driven Integration Test Plan](globus-user-integration-test-plan.md).
9+
710
## Prerequisites
811

912
- `git`
Lines changed: 313 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
# Globus User-Driven Integration Test Plan
2+
3+
## Purpose
4+
5+
Verify, using real Globus Auth and Transfer services, that a user can hydrate
6+
DRS-backed files through Globus and that git-drs applies access-method policy,
7+
credential refresh, fallback, diagnostics, cache placement, and file validation
8+
correctly.
9+
10+
This is a manual integration test. It is not run in CI because it requires a
11+
browser login, real collections, and a DRS server with controlled fixtures.
12+
13+
## Required environment
14+
15+
- A build of `git-drs` from the revision under test on `PATH`.
16+
- Git and Git LFS. The separate `globus-cli` utility is not required.
17+
- A registered Globus native application client ID.
18+
- A readable source collection and a writable destination collection.
19+
- The destination collection root must expose the root of the test repository.
20+
- A DRS remote and test repository prepared with the fixture objects below.
21+
- A user authorized to discover and resolve every fixture object.
22+
23+
Use dedicated, non-production collections and test data. Do not display, copy,
24+
or commit token files. Record collection IDs, task IDs, object IDs, command
25+
output, and checksums; do not record credentials.
26+
27+
## Fixture data
28+
29+
The test administrator prepares four small files with distinct content and
30+
published SHA-256 checksums:
31+
32+
| Fixture | DRS access methods | Purpose |
33+
| --- | --- | --- |
34+
| `globus-only.bin` | valid Globus | successful Globus transfer |
35+
| `https-globus.bin` | valid public HTTPS and valid Globus | selection and fallback |
36+
| `https-only.bin` | valid public HTTPS | strict-policy diagnostic |
37+
| `broken-globus.bin` | valid public HTTPS and a Globus URL whose source path cannot be read | execution failure and fallback boundary |
38+
39+
Commit pointers for all four files to the test repository. The valid Globus
40+
URLs must use this form:
41+
42+
```text
43+
globus://<source-collection-id>/<source-path>
44+
```
45+
46+
Record the expected checksum and size for each file before testing. Confirm the
47+
HTTPS and Globus copies of `https-globus.bin` contain identical bytes.
48+
49+
## Initial setup
50+
51+
Start from a fresh clone so existing cache entries cannot hide transfers:
52+
53+
```bash
54+
git clone <test-repository-url> globus-integration
55+
cd globus-integration
56+
git drs remote add <remote-name> <remote-configuration-arguments>
57+
58+
export GIT_DRS_GLOBUS_CLIENT_ID='<native-application-client-id>'
59+
export GIT_DRS_GLOBUS_DESTINATION_COLLECTION='<destination-collection-id>'
60+
unset GIT_DRS_GLOBUS_TRANSFER_TOKEN
61+
unset GIT_DRS_ACCESS_METHOD
62+
unset GIT_DRS_TRANSFER_PROVIDER
63+
```
64+
65+
If the remote is already committed or otherwise provisioned for the clone,
66+
omit `remote add`. Keep the clone until all cases are complete.
67+
68+
## Test cases
69+
70+
### 1. Interactive login and stored credentials
71+
72+
1. Run `git drs auth globus logout` to remove prior git-drs Globus tokens.
73+
2. Run `git drs auth globus login`.
74+
3. Open the printed URL, approve access, and paste the authorization code.
75+
4. If Globus reports required collection `data_access` scopes, repeat login
76+
with one `--scope '<scope>'` option per required scope.
77+
5. Run `git drs auth globus status`.
78+
6. Confirm `globus-cli` is not installed or is not used by any step.
79+
80+
Expected:
81+
82+
- Login reports success and the local token-storage path.
83+
- Status reports `Globus Transfer API authentication OK`.
84+
- The credential directory and token file are owner-only (`0700` and `0600`
85+
on systems that expose POSIX permissions).
86+
87+
### 2. Strict Globus transfer
88+
89+
Run:
90+
91+
```bash
92+
git drs pull --include globus-only.bin --access-method globus
93+
git drs ls-files --long globus-only.bin
94+
shasum -a 256 globus-only.bin
95+
```
96+
97+
Inspect the most recent task in the Globus web application.
98+
99+
Expected:
100+
101+
- One Globus task succeeds with label `git-drs pull`.
102+
- Its source collection/path match the DRS `globus://` URL.
103+
- Its destination collection is the configured user collection.
104+
- The destination is under `/.git/lfs/objects/`.
105+
- The worktree file is hydrated and its size and SHA-256 match the fixture.
106+
- `git status --short` reports no content change caused by hydration.
107+
108+
### 3. Deterministic automatic selection
109+
110+
Remove the hydrated file and its corresponding LFS cache object by using a new
111+
fresh clone, then run:
112+
113+
```bash
114+
git drs pull --include https-globus.bin
115+
```
116+
117+
Expected:
118+
119+
- Automatic policy selects HTTPS before Globus.
120+
- The file checksum matches.
121+
- No new Globus transfer task is created for this file.
122+
123+
### 4. Preferred Globus and persistent remote preference
124+
125+
In a fresh clone or after clearing this fixture from the cache, run:
126+
127+
```bash
128+
GIT_DRS_ACCESS_METHOD=prefer:globus \
129+
git drs pull --include https-globus.bin
130+
```
131+
132+
Then repeat from a fresh clone using repository-local configuration:
133+
134+
```bash
135+
git config --local drs.remote.<remote-name>.access-method prefer:globus
136+
git drs pull --include https-globus.bin
137+
```
138+
139+
Expected for both runs:
140+
141+
- A Globus task succeeds.
142+
- The hydrated checksum matches the common HTTPS/Globus fixture checksum.
143+
144+
### 5. Preference precedence
145+
146+
With the remote still configured as `prefer:globus`, run from a fresh clone or
147+
empty cache:
148+
149+
```bash
150+
GIT_DRS_ACCESS_METHOD=prefer:https \
151+
git drs pull --include https-globus.bin
152+
```
153+
154+
Then run again with both the environment preference and a strict CLI option:
155+
156+
```bash
157+
GIT_DRS_ACCESS_METHOD=prefer:https \
158+
git drs pull --include https-globus.bin --access-method globus
159+
```
160+
161+
Expected:
162+
163+
- The environment preference overrides remote configuration and uses HTTPS.
164+
- The command option overrides the environment and uses Globus.
165+
166+
### 6. Missing destination configuration
167+
168+
Run:
169+
170+
```bash
171+
unset GIT_DRS_GLOBUS_DESTINATION_COLLECTION
172+
git drs pull --include https-globus.bin --access-method globus
173+
```
174+
175+
Expected:
176+
177+
- Planning fails before a transfer task is submitted.
178+
- The diagnostic identifies `globus=disabled` and names
179+
`GIT_DRS_GLOBUS_DESTINATION_COLLECTION`.
180+
- The file remains a pointer and no partial cache file remains.
181+
182+
Restore the destination variable. Repeat with
183+
`GIT_DRS_ACCESS_METHOD=prefer:globus` and no strict command option.
184+
185+
Expected: HTTPS fallback succeeds and no Globus task is submitted.
186+
187+
### 7. Missing Globus credential
188+
189+
Run `git drs auth globus logout`, ensure
190+
`GIT_DRS_GLOBUS_TRANSFER_TOKEN` is unset, and require Globus for
191+
`https-globus.bin`.
192+
193+
Expected:
194+
195+
- Planning fails with `globus=disabled` and login guidance.
196+
- `GIT_DRS_ACCESS_METHOD=prefer:globus` falls back to HTTPS.
197+
- No Globus task is submitted.
198+
199+
Log in again before continuing.
200+
201+
### 8. Rejected transfer credential
202+
203+
Preserve the stored login, temporarily set an invalid override, and require
204+
Globus:
205+
206+
```bash
207+
GIT_DRS_GLOBUS_TRANSFER_TOKEN='invalid-test-token' \
208+
git drs pull --include globus-only.bin --access-method globus
209+
```
210+
211+
Expected:
212+
213+
- Local readiness passes because a token is configured.
214+
- Transfer API authentication rejects the token before task submission.
215+
- The error identifies Globus Transfer API authentication, not DRS discovery.
216+
- No HTTPS fallback occurs after execution begins.
217+
- Removing the override restores use of the stored credential.
218+
219+
### 9. No fallback after transfer starts
220+
221+
Run:
222+
223+
```bash
224+
GIT_DRS_ACCESS_METHOD=prefer:globus \
225+
git drs pull --include broken-globus.bin
226+
```
227+
228+
Expected:
229+
230+
- Globus is selected and a task is submitted.
231+
- The task fails or becomes inactive with an actionable source-access error.
232+
- git-drs returns that Globus failure and does not retry through HTTPS.
233+
- The worktree remains a pointer and no invalid completed cache object remains.
234+
235+
Then require HTTPS for the same fixture. Expected: HTTPS succeeds, proving the
236+
first failure tested the execution fallback boundary rather than fixture data.
237+
238+
### 10. Aggregate selection diagnostics
239+
240+
Remove the destination variable and request both `globus-only.bin` and
241+
`https-only.bin` with strict Globus selection:
242+
243+
```bash
244+
unset GIT_DRS_GLOBUS_DESTINATION_COLLECTION
245+
git drs pull \
246+
--include globus-only.bin \
247+
--include https-only.bin \
248+
--access-method globus
249+
```
250+
251+
Expected:
252+
253+
- Planning fails before any transfer begins.
254+
- The output identifies both object IDs.
255+
- `globus-only.bin` reports Globus as disabled.
256+
- `https-only.bin` reports required Globus as not advertised.
257+
- No credentials or token values appear in output.
258+
259+
### 11. Stored-token refresh soak test
260+
261+
This case is optional because it must cross a real access-token expiry. Log in
262+
with stored refreshable credentials, leave the static token override unset, and
263+
record the token file modification time without opening or copying its content.
264+
Wait until the access token has expired, then run:
265+
266+
```bash
267+
git drs auth globus status
268+
git drs pull --include globus-only.bin --access-method globus
269+
```
270+
271+
Expected:
272+
273+
- Status and transfer succeed without another browser login.
274+
- The token file modification time advances after refresh.
275+
- A later command succeeds using the refreshed stored credential.
276+
277+
Do not simulate expiry by corrupting a real credential file. Use a disposable
278+
test token store via `GIT_DRS_GLOBUS_TOKEN_FILE` if controlled token mutation is
279+
required.
280+
281+
### 12. Logout cleanup
282+
283+
Run:
284+
285+
```bash
286+
git drs auth globus logout
287+
git drs auth globus status
288+
```
289+
290+
Expected:
291+
292+
- Logout reports success.
293+
- Status fails with login guidance.
294+
- Requiring Globus fails during planning; public HTTPS remains usable under
295+
`auto` or `prefer:globus`.
296+
297+
## Pass criteria
298+
299+
The integration passes when all mandatory cases meet their expected results,
300+
every successful hydration matches its published checksum and size, no secret
301+
appears in logs, and failures leave neither a falsely hydrated worktree file nor
302+
a completed invalid LFS cache object. Record any skipped optional refresh case.
303+
304+
## Cleanup
305+
306+
1. Run `git drs auth globus logout` if the credentials were created solely for
307+
this test.
308+
2. Delete the test clone and any disposable token file.
309+
3. Remove transferred test objects from the destination collection if deleting
310+
the clone does not remove them.
311+
4. Ask the test administrator to remove temporary DRS fixtures and source data.
312+
5. Retain only sanitized command output, task IDs, checksums, and the tested
313+
git-drs revision.

0 commit comments

Comments
 (0)