Repository navigation
test(bundle): drive the https:// config source (config.ts fetchUrl) through dist/index.js - #359
Merged
Conversation
…hrough dist/index.js Adds __tests__/bundle/httpsConfigSource.test.ts: an in-process TLS server with a throwaway self-signed certificate (minted with openssl at beforeAll) stands in for the host of an https:// `config` input, and the child trusts it through NODE_EXTRA_CA_CERTS. Three /kind cleanup runs cover fetchUrl's success, non-2xx and unreachable arms, which no bundle test reached. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
Member
|
/kind cleanup |
Member
|
/lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
__tests__/bundle/httpsConfigSource.test.ts(new file only; importscomment,configReads,helpersFor,repo,tokenfrom./helpers;runBundle.ts,fakeGithub.ts,helpers.ts, source anddist/untouched). It is the first bundle test to reachfetchUrlinsrc/utils/config.ts(L290–301), the arm that loads anhttps://configinput withfetchrather than the api — the oneconfig.tscluster #314 left out ("needs a TLS server the fake GitHub does not provide").How:
beforeAllmints a throwaway self-signed certificate withopensslinto a temp dir (/CN=localhost, SANIP:127.0.0.1, 1 day), starts an in-processhttps.createServeron it, andrunBundle'senvhands the cert to the child asNODE_EXTRA_CA_CERTS, so the bundledfetchcompletes a real TLS handshake without touching the network or a real CA. Three/kind cleanupruns on issue #1:labels: { kind: [cleanup] }POST …/issues/1/labels {labels:['kind/cleanup']}; exactly oneGET /prow.yamlon the TLS server; no.project/.githuborg probe; the repository tier's eight reads andGET …/labelsstill happen (L290–291 + L301)could not get labels from yaml: Error: could not load prow config from https://127.0.0.1:<port>/prow.yaml: HTTP 500, no write (L297–298)… could not load prow config from https://127.0.0.1:<port>/prow.yaml: TypeError: fetch failed, no request reaches the live server, no write (L293–294)Measured with
npm run test:coverage:e2eonmain@ 3fc21f2:src/utils/config.tse2e lines 68.78 % → 72.19 % (L290–301 all reached); all files 77.9 % → 78.28 %.npx vitest run __tests__/bundle/httpsConfigSource.test.ts→ 3 pass against the committeddist/index.js;npx eslintandtsc --noEmitclean.Disjoint from #314 (
owner/repo:path[@ref]sources and api read failures, L236–282) and #339 (parseProwConfigrejections); neither routes anhttps://source.Related Issue
Closes #358
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88