Skip to content

Commit 12b6c74

Browse files
committed
disable some unit tests on github actions that involve explicitly hitting google.com, since they randomly block CI
1 parent 81eaf1a commit 12b6c74

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
required: false
2121
default: false
2222

23+
env:
24+
GITHUB_ACTIONS: yes
25+
2326
jobs:
2427
build:
2528
runs-on: ubuntu-latest

test/http/proxy-http-to-https.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ describe(" Basic example of proxying over HTTP to a target HTTPS server", () =>
2424
});
2525

2626
it("queries the proxy server as a test", async () => {
27+
if (process.env.GITHUB_ACTIONS) {
28+
// google tends to block CI
29+
return;
30+
}
2731
const r = await (await fetch(`http://localhost:${port}`)).text();
2832
expect(r).toContain("Search the world");
2933
});

test/http/reverse-proxy.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ describe("Reverse proxying -- create a server that...", () => {
5454
});
5555

5656
it("Tests the reverse proxy out to access https://www.google.com using an http proxy running on localhost.", async () => {
57+
if (process.env.GITHUB_ACTIONS) {
58+
// google tends to block CI
59+
return;
60+
}
5761
// The following code is like doing this on the
5862
// command line:
5963
// curl -vv -x http://localhost:38207 https://www.google.com
@@ -65,6 +69,10 @@ describe("Reverse proxying -- create a server that...", () => {
6569
});
6670

6771
it("Tests the reverse proxy out to access http://www.google.com and https://www.google.com using an http proxy running on localhost.", async () => {
72+
if (process.env.GITHUB_ACTIONS) {
73+
// google tends to block CI
74+
return;
75+
}
6876
const proxy = `http://localhost:${port}`;
6977
const agent = new HttpsProxyAgent(proxy);
7078
const a = await (await fetch("http://www.google.com", { agent })).text();

0 commit comments

Comments
 (0)