Main is red on five stale tests: fix them in one pull #12299
Merged
scoutcrew
opened this
Check · Review · Land · Live done
— Landed and live in production.
Merged
scout/forge:scout/12286-main-is-red-on-five-stale-tests-fix-them → main
·
2 commits
·fork
-
Merged.
scout/12286-main-is-red-on-five-stale-tests-fix-them was merged into
main as ad44386.
Review
Sign in to review this change.
6 files
changed +15
−10
src/web/studio/contribute_steps.ts
+2
−1
|
|
@@ -11,6 +11,7 @@ import { HELP_BUILD } from "../../core/contribute.ts"; |
| 11 | 11 |
import { canWrite, type Repo } from "../../core/repos.ts"; |
| 12 | 12 |
import type { Ctx } from "../../http/context.ts"; |
| 13 | 13 |
import { repoBase } from "../chrome.ts"; |
| 14 |
import { returnTo, withReturn } from "../return_to.ts"; |
| 14 | 15 |
import { html, type Html } from "../html.ts"; |
| 15 | 16 |
import { btn, row } from "../ui.ts"; |
| 16 | 17 |
|
|
|
@@ -36,7 +37,7 @@ export function contributeSteps(ctx: Ctx, repo: Repo): Html { |
| 36 | 37 |
<h2 id="contribute-h">${HELP_BUILD}</h2> |
| 37 | 38 |
<p class="muted small">Anyone can send a change; a person reviews it first.</p> |
| 38 | 39 |
<ul class="list"> |
| 39 | |
${row({ title: "Get in", href: "/signup", after: html`<a class="muted small" href="/forges/new">or use your own forge</a>` })} |
| 40 |
${row({ title: "Get in", href: withReturn("/signup", returnTo(ctx)), after: html`<a class="muted small" href="/forges/new">or use your own forge</a>` })} |
| 40 | 41 |
${row({ title: "Fork it", href: `${base}/make-it-yours` })} |
| 41 | 42 |
${row({ title: "Send a pull", href: `${base}/pulls/new` })} |
| 42 | 43 |
</ul> |
test/check-budget.test.ts
+1
−1
|
|
@@ -27,7 +27,7 @@ beforeAll(async () => { |
| 27 | 27 |
checks = startChecks(app, { |
| 28 | 28 |
forgeUrl: "http://forge.test", |
| 29 | 29 |
concurrency: 1, |
| 30 | |
budgetMs: 1_500, |
| 30 |
budgetMs: 400, |
| 31 | 31 |
}); |
| 32 | 32 |
}); |
| 33 | 33 |
|
test/first-ask-new-app.test.ts
+2
−2
|
|
@@ -140,10 +140,10 @@ test("with the credit spent an app's page says a key is needed, with the link fo |
| 140 | 140 |
keepFunding(dir, { token: funding.token, capUsd: 2, spentUsd: 2 }); |
| 141 | 141 |
try { |
| 142 | 142 |
expect(String(crewKeyCard(cardCtx(true), true))).toContain("needs a model key"); |
| 143 | |
expect(String(crewKeyCard(cardCtx(true), true))).toContain("/#crew-key-note"); |
| 143 |
expect(String(crewKeyCard(cardCtx(true), true))).toContain("/feed#crew-key-note"); |
| 144 | 144 |
const person = String(crewKeyCard(cardCtx(false), true)); |
| 145 | 145 |
expect(person).toContain("needs a model key"); |
| 146 | |
expect(person).not.toContain("/#crew-key-note"); |
| 146 |
expect(person).not.toContain("/feed#crew-key-note"); |
| 147 | 147 |
} finally { |
| 148 | 148 |
keepFunding(dir, funding); |
| 149 | 149 |
} |
test/guest-contribute.test.ts
+1
−1
|
|
@@ -604,7 +604,7 @@ describe("a stranger's first pull starts from the app's page", () => { |
| 604 | 604 |
expect(block).toContain("Get in"); |
| 605 | 605 |
expect(block).not.toContain(FORK_AND_SEND); |
| 606 | 606 |
const links = [...block.slice(0, block.indexOf("</section>")).matchAll(/href="([^"]+)"/g)].map((m) => m[1]!); |
| 607 | |
expect(links).toEqual(["/signup", "/forges/new", "/olive/game/make-it-yours", "/olive/game/pulls/new"]); |
| 607 |
expect(links).toEqual(["/signup?next=%2Folive%2Fgame", "/forges/new", "/olive/game/make-it-yours", "/olive/game/pulls/new"]); |
| 608 | 608 |
for (const href of links) { |
| 609 | 609 |
const hit = await fetch(`${servers.url}${href}`, { redirect: "manual" }); |
| 610 | 610 |
expect(hit.status).toBeLessThan(400); |
test/keys-goto.test.ts
+7
−5
|
|
@@ -59,7 +59,7 @@ function keys(level: number) { |
| 59 | 59 |
const realNow = Date.now; |
| 60 | 60 |
const clock = (t: number) => (Date.now = () => t); |
| 61 | 61 |
|
| 62 | |
test("the script: a stranger's g f does nothing, a user's goes to /flow, g h and g e work for all", () => { |
| 62 |
test("the script: a stranger's or a user's g f does nothing, an admin's goes to /flow, g h and g e work for all", () => { |
| 63 | 63 |
const stranger = keys(0); |
| 64 | 64 |
clock(10_000); |
| 65 | 65 |
stranger.press("g"); |
|
|
@@ -71,19 +71,21 @@ test("the script: a stranger's g f does nothing, a user's goes to /flow, g h and |
| 71 | 71 |
const user = keys(1); |
| 72 | 72 |
user.press("g"); |
| 73 | 73 |
user.press("f"); |
| 74 | |
expect(user.assigned).toEqual(["/flow"]); |
| 75 | 74 |
user.press("g"); |
| 76 | 75 |
user.press("s"); |
| 77 | |
expect(user.assigned).toEqual(["/flow"]); |
| 76 |
expect(user.assigned).toEqual([]); |
| 78 | 77 |
const admin = keys(2); |
| 79 | 78 |
admin.press("g"); |
| 79 |
admin.press("f"); |
| 80 |
expect(admin.assigned).toEqual(["/flow"]); |
| 81 |
admin.press("g"); |
| 80 | 82 |
admin.press("s"); |
| 81 | |
expect(admin.assigned).toEqual(["/system"]); |
| 83 |
expect(admin.assigned).toEqual(["/flow", "/system"]); |
| 82 | 84 |
Date.now = realNow; |
| 83 | 85 |
}); |
| 84 | 86 |
|
| 85 | 87 |
test("the script: a pause over 1 s forgets the g", () => { |
| 86 | |
const u = keys(1); |
| 88 |
const u = keys(2); |
| 87 | 89 |
clock(10_000); |
| 88 | 90 |
u.press("g"); |
| 89 | 91 |
clock(11_500); |
test/retry-after.test.ts
+2
|
|
@@ -30,6 +30,8 @@ const PERF_LINE = `src/http/server.ts: ${readFileSync("src/http/server.ts", "utf |
| 30 | 30 |
|
| 31 | 31 |
|
| 32 | 32 |
const EXEMPT: Record<string, string> = { |
| 33 |
"src/http/api/user.ts: return json({ ...said, ...blockedFields(noMailBlocked(ctx.auth.user)) }, 503, Object.fromEntries(refused.headers));": |
| 34 |
"the headers are tryAgain's own, spread from refused.headers", |
| 33 | 35 |
[PERF_LINE]: "a comparison, not a response", |
| 34 | 36 |
"src/http/respond.ts: if (status === 429 || status === 503) {": "json()'s floor itself", |
| 35 | 37 |
"src/http/respond.ts: status: 429 | 503,": "tryAgain's own signature", |