Skip to content

test: add host registry output golden#88

Closed
travis-hoover-glean wants to merge 1 commit into
mainfrom
test/configure-hosts-registry-golden
Closed

test: add host registry output golden#88
travis-hoover-glean wants to merge 1 commit into
mainfrom
test/configure-hosts-registry-golden

Conversation

@travis-hoover-glean

@travis-hoover-glean travis-hoover-glean commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Adds a focused Linux configureHosts characterization test that exercises the real registry builder and asserts representative JSON, TOML, and Goose YAML output, including Goose default fields.

Tested: npm test -- --run src/hosts/configure-hosts.spec.ts

@travis-hoover-glean travis-hoover-glean requested a review from a team as a code owner June 4, 2026 21:58
username: 'alice',
})

expect(results.every((result) => result.success)).toBe(true)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1/5 (nit, non-blocking)

It's usually better to map + then assert the array than to loop in this way and abort the test on the first failure.

Failures tend to be easier to understand in the array comparison approach.

type: 'http',
url: 'https://be.glean.com/mcp/default',
headers: { 'X-Glean-Metadata': 'mdm' },
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting that there's no inline snapshots here. I guess the view is inline snapshots aren't as relevant now that "manually" maintained complicated assertion objects can just be handled by agents?

Comment on lines +38 to +40
expect(codex).toContain('[mcp_servers.glean_default]')
expect(codex).toContain('url = "https://be.glean.com/mcp/default"')
expect(codex).toContain('X-Glean-Metadata = "mdm"')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1/5 (nit, non-blocking)

It's almost always better to assert the whole object than this one at a time stuff. It makes failures much easier to understand. If the object requires pre-processing (stripping dynamic things like dates &c.) it's still worth it so you can detect things like unexpected extra properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants