Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,83 @@ steps = [
], comment = "The details include why the token request failed." },
]

[[e2e]]
name = "pull_request_upload"
cfg = "not(windows)"
ignore = true
steps = [
[
"remote-cache-server",
"start",
],
{ argv = [
"remote-cache-server",
"run",
"--github-actions",
"vt",
"run",
"build",
], envs = [
[
"VP_REMOTE_CACHE",
"read-write",
],
[
"ACTIONS_ID_TOKEN_REQUEST_TOKEN",
"pull-request",
],
[
"VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS",
"1",
],
], comment = "The job runs for a pull request, so its token doesn't satisfy the write policy and the backend rejects the upload. The task succeeds." },
{ argv = [
"vt",
"run",
"--last-details",
], comment = "The details include the backend's message." },
[
"remote-cache-server",
"stop",
],
]

[[e2e]]
name = "upload_without_token"
cfg = "not(windows)"
ignore = true
steps = [
[
"remote-cache-server",
"start",
],
{ argv = [
"remote-cache-server",
"run",
"vt",
"run",
"build",
], envs = [
[
"VP_REMOTE_CACHE",
"read-write",
],
[
"VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS",
"1",
],
], comment = "Outside GitHub Actions, the upload has no token, so the backend rejects it. The task succeeds." },
{ argv = [
"vt",
"run",
"--last-details",
], comment = "The details include the backend's message." },
[
"remote-cache-server",
"stop",
],
]

[[e2e]]
name = "read_invalid_endpoint"
steps = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# pull_request_upload

## `remote-cache-server start`

```
```

## `VP_REMOTE_CACHE=read-write ACTIONS_ID_TOKEN_REQUEST_TOKEN=pull-request VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS=1 remote-cache-server run --github-actions vt run build`

The job runs for a pull request, so its token doesn't satisfy the write policy and the backend rejects the upload. The task succeeds.

```
$ vtt write-file dist/output.txt built

---
vt run: remote-cache#build not uploaded to the remote cache: HTTP status 403. (Run `vt run --last-details` for full details)
[remote-cache] POST /fetch 404
[remote-cache] POST /store 403
```

## `vt run --last-details`

The details include the backend's message.

```

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 task • 0 cache hits • 1 cache miss
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] remote-cache#build: $ vtt write-file dist/output.txt built ✓
→ Cache miss: no previous cache entry found
⚠ Not uploaded to the remote cache: HTTP status 403
↳ Write not permitted
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

## `remote-cache-server stop`

```
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# upload_without_token

## `remote-cache-server start`

```
```

## `VP_REMOTE_CACHE=read-write VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS=1 remote-cache-server run vt run build`

Outside GitHub Actions, the upload has no token, so the backend rejects it. The task succeeds.

```
$ vtt write-file dist/output.txt built

---
vt run: remote-cache#build not uploaded to the remote cache: HTTP status 401. (Run `vt run --last-details` for full details)
[remote-cache] POST /fetch 404
[remote-cache] POST /store 401
```

## `vt run --last-details`

The details include the backend's message.

```

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 task • 0 cache hits • 1 cache miss
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] remote-cache#build: $ vtt write-file dist/output.txt built ✓
→ Cache miss: no previous cache entry found
⚠ Not uploaded to the remote cache: HTTP status 401
↳ Invalid credentials
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

## `remote-cache-server stop`

```
```
Loading