Skip to content

Commit

Permalink
chore: updates for undici fetch (#1496)
Browse files Browse the repository at this point in the history
## Description

Updates the journey tests and mocking for the undici fetch in KFC

## Related Issue

Fixes #1493 
<!-- or -->
Relates to #

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
cmwylie19 and dependabot[bot] authored Dec 3, 2024
1 parent 55b4e7d commit afdc893
Show file tree
Hide file tree
Showing 6 changed files with 1,576 additions and 1,005 deletions.
2 changes: 1 addition & 1 deletion journey/pepr-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function testStore() {
// Should have a key from the joke url and getItem should have worked
const key3 = await waitForPeprStoreKey(
"pepr-static-test-store",
`hello-pepr-v2-https://icanhazdadjoke.com/`,
`hello-pepr-v2-https://icanhazdadjoke.com`,
);
expect(key3).toBeTruthy();

Expand Down
17 changes: 11 additions & 6 deletions journey/pepr-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@

import { afterAll, expect, it } from "@jest/globals";
import { ChildProcessWithoutNullStreams, spawn } from "child_process";
import { Agent } from "https";
import { fetch } from "kubernetes-fluent-client";
import { RequestInit } from "node-fetch";
import { RequestInit, Agent } from "undici";
import { cwd } from "./entrypoint.test";
import { sleep } from "./k8s";

const fetchBaseUrl = "https://localhost:3000";
const fetchOpts: RequestInit = {
agent: new Agent({
// Avoid tls issues for self-signed certs
rejectUnauthorized: false,
method: "GET",
headers: {
"Content-Type": "application/json; charset=UTF-8",
},
dispatcher: new Agent({
// disable keep-alive https://github.com/nodejs/undici/issues/2522#issuecomment-1859213319
pipelining: 0,
connect: {
rejectUnauthorized: false,
},
}),
};

Expand Down Expand Up @@ -78,7 +84,6 @@ export function peprDev() {
} else {
// Abort all further processing
success = true;

// Finish the test
done();
}
Expand Down
Loading

0 comments on commit afdc893

Please sign in to comment.