Skip to content

Commit f18ea45

Browse files
jmecomcodex
andauthored
Replace personal and internal data in desktop test fixtures (#7748)
Replace personal contributor identities, copied internal image content, and production Databricks hostnames in desktop tests and mocks with synthetic fixtures. The related path and mock-profile fixtures use the same example identity, and the image regression still verifies reserved layout space while its mocked request remains pending. Contributor matching and configuration decoding behavior are preserved. Checked on Blox: 36 targeted JavaScript tests, 30 focused Rust tests, the Playwright image-height regression, TypeScript/Biome, formatting, security/file-size gates, 6,508 desktop tests, the full Tauri test workspace (including 3,204 main-crate tests), and desktop/web builds. The full `just ci` run could not finish mobile checks because Blox connections to `pub.dev` were reset and a locked dependency was missing from its offline cache. The broader Rust unit run passed 16 lanes but hit an unrelated catalog timeout in `buzz-agent`; that exact test passed in isolation. Signed-off-by: jm <[email protected]> Co-authored-by: Codex <[email protected]>
1 parent 4e1770a commit f18ea45

7 files changed

Lines changed: 57 additions & 56 deletions

File tree

‎desktop/src-tauri/src/managed_agents/agent_env.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,17 @@ mod tests {
320320
#[test]
321321
fn build_env_map_agent_env_blob_is_decoded_and_folded() {
322322
use base64::Engine as _;
323-
let raw = "DATABRICKS_HOST=https://block-lakehouse-production.cloud.databricks.com/\nDATABRICKS_MODEL=goose-claude-opus-4-8";
323+
let raw =
324+
"DATABRICKS_HOST=https://workspace.example.com/\nDATABRICKS_MODEL=synthetic-chat-model";
324325
let blob = base64::engine::general_purpose::STANDARD.encode(raw.as_bytes());
325326
let map = build_env_map(None, None, Some(&blob));
326327
assert_eq!(
327328
map.get("DATABRICKS_HOST").map(String::as_str),
328-
Some("https://block-lakehouse-production.cloud.databricks.com/")
329+
Some("https://workspace.example.com/")
329330
);
330331
assert_eq!(
331332
map.get("DATABRICKS_MODEL").map(String::as_str),
332-
Some("goose-claude-opus-4-8")
333+
Some("synthetic-chat-model")
333334
);
334335
}
335336

‎desktop/src-tauri/src/managed_agents/config_bridge/goose.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,17 @@ extensions:
268268
#[test]
269269
fn databricks_host_without_explicit_provider_infers_databricks() {
270270
let yaml = r#"
271-
DATABRICKS_HOST: https://block-lakehouse-production.cloud.databricks.com/
271+
DATABRICKS_HOST: https://workspace.example.com/
272272
GOOSE_TELEMETRY_ENABLED: false
273273
"#;
274274
let cfg = parse_goose_config(yaml).unwrap();
275275
assert_eq!(cfg.provider.as_deref(), Some("databricks"));
276276
// The flat DATABRICKS_HOST key must be canonical in extra so that
277-
// `file_key_present("DATABRICKS_HOST")` returns true. This is Will's
278-
// typical config — flat key, no active_provider.
277+
// `file_key_present("DATABRICKS_HOST")` returns true for a flat key
278+
// with no active_provider.
279279
assert_eq!(
280280
cfg.extra.get("DATABRICKS_HOST").map(|s| s.as_str()),
281-
Some("https://block-lakehouse-production.cloud.databricks.com/"),
281+
Some("https://workspace.example.com/"),
282282
"flat DATABRICKS_HOST must be stored as 'DATABRICKS_HOST' in extra"
283283
);
284284
}
@@ -304,7 +304,7 @@ DATABRICKS_HOST: https://dbc.example.com
304304
fn explicit_provider_wins_over_databricks_inference() {
305305
let yaml = r#"
306306
GOOSE_PROVIDER: anthropic
307-
DATABRICKS_HOST: https://block-lakehouse-production.cloud.databricks.com/
307+
DATABRICKS_HOST: https://workspace.example.com/
308308
"#;
309309
let cfg = parse_goose_config(yaml).unwrap();
310310
assert_eq!(cfg.provider.as_deref(), Some("anthropic"));

‎desktop/src/features/agents/ui/agentSessionToolSummary.test.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ test("buildCompactToolSummary formats shell command preview", () => {
8888

8989
test("buildCompactToolSummary formats view_image thumbnail source", () => {
9090
const source =
91-
"https://sprout-oss.stage.blox.sqprod.co/media/ffd1b2721f2d52e19f0ca2be9aa7842cdec5b4e0215aaab2a67c26a2a76a6a83.png";
91+
"https://media.example.com/media/abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789.png";
9292
const summary = buildCompactToolSummary(
9393
makeTool({
9494
toolName: "buzz-dev-mcp__view_image",

‎desktop/src/features/projects/lib/projectContributorMatching.test.mjs‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ const PROFILES = {
2020
isAgent: true,
2121
},
2222
[USER_PUBKEY]: {
23-
displayName: "Thomas P",
24-
avatarUrl: "https://example.com/thomas.png",
25-
nip05Handle: "thomasp@example.com",
23+
displayName: "Avery E",
24+
avatarUrl: "https://example.com/avatars/avery.png",
25+
nip05Handle: "avery@example.com",
2626
},
2727
};
2828

2929
function makeCommit(overrides = {}) {
3030
return {
31-
hash: "fed2b2c993896352400f3d8c574fa31a84188f18",
32-
shortHash: "fed2b2c",
33-
authorName: "Thomas Petersen",
34-
authorEmail: "[email protected]",
31+
hash: "0123456789abcdef0123456789abcdef01234567",
32+
shortHash: "0123456",
33+
authorName: "Avery Example",
34+
authorEmail: "[email protected]",
3535
timestamp: 1_700_000_000,
36-
subject: "Add simple score HUD",
36+
subject: "Add sample status widget",
3737
...overrides,
3838
};
3939
}
@@ -191,7 +191,7 @@ test("profileForCommit prefers the signed PR-event mapping", () => {
191191

192192
test("profileForCommit falls back to exact git author matching", () => {
193193
// No mapping entry — the git author email matches the user's NIP-05.
194-
const commit = makeCommit({ authorEmail: "thomasp@example.com" });
194+
const commit = makeCommit({ authorEmail: "avery@example.com" });
195195
const matched = profileForCommit(commit, PROFILES, new Map());
196196
assert.equal(matched?.pubkey, USER_PUBKEY);
197197
});
@@ -200,7 +200,7 @@ test("profileForCommit resolves an npub git author to its profile", () => {
200200
const commit = makeCommit({ authorName: pubkeyToNpub(USER_PUBKEY) });
201201
const matched = profileForCommit(commit, PROFILES, new Map());
202202
assert.equal(matched?.pubkey, USER_PUBKEY);
203-
assert.equal(matched?.profile.displayName, "Thomas P");
203+
assert.equal(matched?.profile.displayName, "Avery E");
204204
});
205205

206206
test("profileForCommit ignores malformed npub git authors", () => {
@@ -217,23 +217,23 @@ test("profileForCommit returns null when nothing matches", () => {
217217
});
218218

219219
test("mapped pubkey without a fetched profile falls back to git author", () => {
220-
const commit = makeCommit({ authorEmail: "thomasp@example.com" });
220+
const commit = makeCommit({ authorEmail: "avery@example.com" });
221221
const map = new Map([[commit.hash, "f".repeat(64)]]);
222222
const matched = profileForCommit(commit, PROFILES, map);
223223
assert.equal(matched?.pubkey, USER_PUBKEY);
224224
});
225225

226226
test("viewer git identity attributes their own commits", () => {
227-
// Git author "Thomas Petersen <[email protected]>" matches no profile
227+
// The commit author's example.org address matches no profile
228228
// field, but it is the viewer's own git config identity.
229229
const commit = makeCommit();
230230
const matched = profileForCommit(commit, PROFILES, new Map(), {
231231
pubkey: USER_PUBKEY,
232-
name: "Thomas Petersen",
233-
232+
name: "Avery Example",
233+
234234
});
235235
assert.equal(matched?.pubkey, USER_PUBKEY);
236-
assert.equal(matched?.profile.displayName, "Thomas P");
236+
assert.equal(matched?.profile.displayName, "Avery E");
237237
});
238238

239239
test("viewer git identity does not claim other authors' commits", () => {
@@ -243,8 +243,8 @@ test("viewer git identity does not claim other authors' commits", () => {
243243
});
244244
const matched = profileForCommit(commit, PROFILES, new Map(), {
245245
pubkey: USER_PUBKEY,
246-
name: "Thomas Petersen",
247-
246+
name: "Avery Example",
247+
248248
});
249249
assert.equal(matched, null);
250250
});
@@ -254,13 +254,13 @@ test("a shared display name alone never borrows the viewer's identity", () => {
254254
// the viewer's own commits actually carry — may attribute a commit to the
255255
// viewer's pubkey.
256256
const commit = makeCommit({
257-
authorName: "Thomas Petersen",
257+
authorName: "Avery Example",
258258
authorEmail: "[email protected]",
259259
});
260260
const matched = profileForCommit(commit, PROFILES, new Map(), {
261261
pubkey: USER_PUBKEY,
262-
name: "Thomas Petersen",
263-
262+
name: "Avery Example",
263+
264264
});
265265
assert.equal(matched, null);
266266
});
@@ -270,8 +270,8 @@ test("signed PR mapping wins over the viewer git identity", () => {
270270
const map = new Map([[commit.hash, AGENT_PUBKEY]]);
271271
const matched = profileForCommit(commit, PROFILES, map, {
272272
pubkey: USER_PUBKEY,
273-
name: "Thomas Petersen",
274-
273+
name: "Avery Example",
274+
275275
});
276276
assert.equal(matched?.pubkey, AGENT_PUBKEY);
277277
});

‎desktop/src/features/projects/lib/projectPathDisplay.test.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ test("keeps short repository paths intact", () => {
99

1010
test("shortens long repository paths to their trailing segments", () => {
1111
assert.equal(
12-
shortenProjectPath("/Users/thomasp/sprout/projects/buzz"),
12+
shortenProjectPath("/Users/sample-user/sprout/projects/buzz"),
1313
"…/sprout/projects/buzz",
1414
);
1515
});
1616

1717
test("normalizes Windows separators for display", () => {
1818
assert.equal(
19-
shortenProjectPath("C:\\Users\\thomasp\\repos\\buzz"),
20-
"…/thomasp/repos/buzz",
19+
shortenProjectPath("C:\\Users\\sample-user\\repos\\buzz"),
20+
"…/sample-user/repos/buzz",
2121
);
2222
});

‎desktop/src/testing/e2eBridge.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12895,9 +12895,9 @@ export function maybeInstallE2eTauriMocks() {
1289512895
// to in-app activity tracking.
1289612896
return null;
1289712897
case "get_git_identity":
12898-
// Matches the "Thomas P" author on a mock snapshot commit so the
12898+
// Matches the synthetic human author on a mock snapshot commit so the
1289912899
// viewer-identity avatar attribution is exercised in e2e.
12900-
return { name: "Thomas P", email: "thomasp@example.com" };
12900+
return { name: "Avery E", email: "avery@example.com" };
1290112901
case "get_project_repo_snapshot":
1290212902
if (activeConfig?.mock?.projectRepoSnapshotDelayMs) {
1290312903
await new Promise((resolve) =>
@@ -12931,8 +12931,8 @@ export function maybeInstallE2eTauriMocks() {
1293112931
{
1293212932
hash: "123456789abcdef0123456789abcdef012345678",
1293312933
short_hash: "1234567",
12934-
author_name: "Thomas P",
12935-
author_email: "thomasp@example.com",
12934+
author_name: "Avery E",
12935+
author_email: "avery@example.com",
1293612936
timestamp: Math.floor(Date.now() / 1000) - 1_800,
1293712937
subject: "Point project repository details at active branch",
1293812938
},
@@ -12961,8 +12961,8 @@ export function maybeInstallE2eTauriMocks() {
1296112961
last_commit_at: Math.floor(Date.now() / 1000) - 600,
1296212962
},
1296312963
{
12964-
name: "Thomas P",
12965-
email: "thomasp@example.com",
12964+
name: "Avery E",
12965+
email: "avery@example.com",
1296612966
commit_count: 3,
1296712967
last_commit_at: Math.floor(Date.now() / 1000) - 1_800,
1296812968
},

‎desktop/tests/e2e/scroll-history.spec.ts‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -553,23 +553,23 @@ test("does not teleport upward when user abandons fetch by jumping to bottom", a
553553
expect(lastRowOffset as number).toBeLessThanOrEqual(200);
554554
});
555555

556-
const REAL_BUZZ_BUGS_IMAGE_SHA =
557-
"ff2862080bac3d009f97cad4bb94e6efec328eaaee058a405e854acd49fc1483";
558-
const REAL_BUZZ_BUGS_IMAGE_URL = `https://sprout-oss.stage.blox.sqprod.co/media/${REAL_BUZZ_BUGS_IMAGE_SHA}.png`;
559-
const REAL_BUZZ_BUGS_IMAGE_TAG = [
556+
const SYNTHETIC_WIDE_IMAGE_SHA =
557+
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";
558+
const SYNTHETIC_WIDE_IMAGE_URL = `https://media.example.com/media/${SYNTHETIC_WIDE_IMAGE_SHA}.png`;
559+
const SYNTHETIC_WIDE_IMAGE_TAG = [
560560
"imeta",
561-
`url ${REAL_BUZZ_BUGS_IMAGE_URL}`,
561+
`url ${SYNTHETIC_WIDE_IMAGE_URL}`,
562562
"m image/png",
563-
`x ${REAL_BUZZ_BUGS_IMAGE_SHA}`,
564-
"size 26257",
565-
"dim 951x244",
566-
"filename image.png",
563+
`x ${SYNTHETIC_WIDE_IMAGE_SHA}`,
564+
"size 24576",
565+
"dim 960x240",
566+
"filename sample-banner.png",
567567
] as string[];
568568

569-
test("reserves real buzz-bugs imeta image height before image loads", async ({
569+
test("reserves imeta image height before a synthetic image loads", async ({
570570
page,
571571
}) => {
572-
await page.route("**/media/**", () => new Promise(() => {}));
572+
await page.route(SYNTHETIC_WIDE_IMAGE_URL, () => new Promise(() => {}));
573573
await installMockBridge(page);
574574
await page.goto("/");
575575
await page.waitForFunction(
@@ -585,15 +585,15 @@ test("reserves real buzz-bugs imeta image height before image loads", async ({
585585
});
586586
},
587587
{
588-
content: `this setting gets reverted on every update\n![image](${REAL_BUZZ_BUGS_IMAGE_URL})`,
589-
extraTags: [REAL_BUZZ_BUGS_IMAGE_TAG],
588+
content: `Synthetic wide image fixture\n![sample banner](${SYNTHETIC_WIDE_IMAGE_URL})`,
589+
extraTags: [SYNTHETIC_WIDE_IMAGE_TAG],
590590
},
591591
);
592592

593593
await page.getByTestId("channel-general").click();
594594
await expect(page.getByTestId("chat-title")).toHaveText("general");
595595

596-
const image = page.getByAltText("image").last();
596+
const image = page.getByAltText("sample banner").last();
597597
const rect = await image.evaluate((element) => {
598598
const img = element as HTMLImageElement;
599599
const box = img.getBoundingClientRect();
@@ -606,8 +606,8 @@ test("reserves real buzz-bugs imeta image height before image loads", async ({
606606
width: box.width,
607607
};
608608
});
609-
expect(rect.attrWidth).toBe("951");
610-
expect(rect.attrHeight).toBe("244");
609+
expect(rect.attrWidth).toBe("960");
610+
expect(rect.attrHeight).toBe("240");
611611
expect(rect.offsetHeight).toBeGreaterThan(80);
612612
});
613613

0 commit comments

Comments
 (0)