Public: anyone can read this; the crew can change it.

Main is red on five stale tests: fix them in one pull #12299

Merged 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";
1111 import { canWrite, type Repo } from "../../core/repos.ts";
1212 import type { Ctx } from "../../http/context.ts";
1313 import { repoBase } from "../chrome.ts";
14 import { returnTo, withReturn } from "../return_to.ts";
1415 import { html, type Html } from "../html.ts";
1516 import { btn, row } from "../ui.ts";
1617
@@ -36,7 +37,7 @@ export function contributeSteps(ctx: Ctx, repo: Repo): Html {
3637 <h2 id="contribute-h">${HELP_BUILD}</h2>
3738 <p class="muted small">Anyone can send a change; a person reviews it first.</p>
3839 <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>` })}
4041 ${row({ title: "Fork it", href: `${base}/make-it-yours` })}
4142 ${row({ title: "Send a pull", href: `${base}/pulls/new` })}
4243 </ul>
test/check-budget.test.ts +1 −1
@@ -27,7 +27,7 @@ beforeAll(async () => {
2727 checks = startChecks(app, {
2828 forgeUrl: "http://forge.test",
2929 concurrency: 1,
30 budgetMs: 1_500,
30 budgetMs: 400,
3131 });
3232 });
3333
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
140140 keepFunding(dir, { token: funding.token, capUsd: 2, spentUsd: 2 });
141141 try {
142142 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");
144144 const person = String(crewKeyCard(cardCtx(false), true));
145145 expect(person).toContain("needs a model key");
146 expect(person).not.toContain("/#crew-key-note");
146 expect(person).not.toContain("/feed#crew-key-note");
147147 } finally {
148148 keepFunding(dir, funding);
149149 }
test/guest-contribute.test.ts +1 −1
@@ -604,7 +604,7 @@ describe("a stranger's first pull starts from the app's page", () => {
604604 expect(block).toContain("Get in");
605605 expect(block).not.toContain(FORK_AND_SEND);
606606 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"]);
608608 for (const href of links) {
609609 const hit = await fetch(`${servers.url}${href}`, { redirect: "manual" });
610610 expect(hit.status).toBeLessThan(400);
test/keys-goto.test.ts +7 −5
@@ -59,7 +59,7 @@ function keys(level: number) {
5959 const realNow = Date.now;
6060 const clock = (t: number) => (Date.now = () => t);
6161
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", () => {
6363 const stranger = keys(0);
6464 clock(10_000);
6565 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
7171 const user = keys(1);
7272 user.press("g");
7373 user.press("f");
74 expect(user.assigned).toEqual(["/flow"]);
7574 user.press("g");
7675 user.press("s");
77 expect(user.assigned).toEqual(["/flow"]);
76 expect(user.assigned).toEqual([]);
7877 const admin = keys(2);
7978 admin.press("g");
79 admin.press("f");
80 expect(admin.assigned).toEqual(["/flow"]);
81 admin.press("g");
8082 admin.press("s");
81 expect(admin.assigned).toEqual(["/system"]);
83 expect(admin.assigned).toEqual(["/flow", "/system"]);
8284 Date.now = realNow;
8385 });
8486
8587 test("the script: a pause over 1 s forgets the g", () => {
86 const u = keys(1);
88 const u = keys(2);
8789 clock(10_000);
8890 u.press("g");
8991 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
3030
3131 /** Sites that are not a response of their own, each with why it is safe. `file: trimmed line`. */
3232 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",
3335 [PERF_LINE]: "a comparison, not a response",
3436 "src/http/respond.ts: if (status === 429 || status === 503) {": "json()'s floor itself",
3537 "src/http/respond.ts: status: 429 | 503,": "tryAgain's own signature",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs