Skip to content

Commit a1b4473

Browse files
committed
Remove old WPAD/DHCP test harness.
1 parent 109f27a commit a1b4473

File tree

10 files changed

+14
-2724
lines changed

10 files changed

+14
-2724
lines changed

.github/workflows/macos.yaml

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Build - macOS
22
on: [workflow_dispatch, push, pull_request]
33
env:
44
TERM: xterm-256color
5+
PAC_URL: https://raw.githubusercontent.com/snxd/proxyres/refs/heads/master/test/pac.js
56
concurrency:
67
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
78
cancel-in-progress: true
@@ -44,45 +45,12 @@ jobs:
4445
- name: Build project
4546
run: cmake --build build --config RelWithDebInfo
4647

47-
- name: Setup node version
48-
uses: actions/setup-node@v6
49-
with:
50-
node-version: 20
51-
52-
- name: Install test dependencies
53-
run: |
54-
corepack enable
55-
yarn install
56-
working-directory: test
57-
58-
- name: Run test http server
59-
run: |
60-
npx pm2 start http_server_cmd.js
61-
sleep 15
62-
working-directory: test
63-
6448
- name: Run tests
65-
run: ctest --verbose -C RelWithDebInfo -E ".*wpad.*"
49+
run: ctest --verbose -C RelWithDebInfo
6650
working-directory: build
6751

68-
- name: Run test dhcp server
69-
# Used by wpad.dhcp googletest
70-
run: |
71-
npx pm2 start dhcp_server_cmd.js --output dhcp_server.log
72-
sleep 5
73-
working-directory: test
74-
75-
# Exclude wpad.dhcp tests that fail due to restricted environment on GH CI
76-
- name: Run wpad tests
77-
run: ctest --verbose -C RelWithDebInfo -R ".*wpad.*" -E "gtest_proxyres-wpad.dhcp"
78-
working-directory: build
79-
80-
- name: Stop test dhcp server
81-
run: npx pm2 stop dhcp_server_cmd
82-
working-directory: test
83-
8452
- name: Download pac from http server
85-
run: curl -v http://127.0.0.1:8080/pac.js
53+
run: curl -v ${{ env.PAC_URL }}
8654
working-directory: test
8755

8856
- name: Dump proxy info
@@ -161,15 +129,15 @@ jobs:
161129

162130
- name: Set proxy auto config url setting (networksetup)
163131
run: |
164-
networksetup -setautoproxyurl Ethernet http://127.0.0.1:8080/pac.js
132+
networksetup -setautoproxyurl Ethernet ${{ env.PAC_URL }}
165133
networksetup -setautoproxystate Ethernet on
166134
167135
- name: Check proxy resolution (networksetup)
168136
shell: bash
169137
run: |
170138
out=$(./proxycli config auto_config_url)
171139
echo "Auto config url: $out"
172-
if [ "$out" = "http://127.0.0.1:8080/pac.js" ]; then
140+
if [ "$out" = "${{ env.PAC_URL }}" ]; then
173141
echo "Auto config url set successfully"
174142
else
175143
echo "Auto config url set failed"

.github/workflows/ubuntu.yaml

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Build - Ubuntu
22
on: [workflow_dispatch, push, pull_request]
33
env:
44
TERM: xterm-256color
5+
PAC_URL: https://raw.githubusercontent.com/snxd/proxyres/refs/heads/master/test/pac.js
56
concurrency:
67
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
78
cancel-in-progress: true
@@ -80,51 +81,13 @@ jobs:
8081
- name: Build project
8182
run: cmake --build build --config RelWithDebInfo
8283

83-
- name: Setup node version
84-
uses: actions/setup-node@v6
85-
with:
86-
node-version: 20
87-
88-
- name: Install test dependencies
89-
run: |
90-
corepack enable
91-
yarn install
92-
working-directory: test
93-
94-
- name: Run test http server
95-
run: |
96-
npx pm2 start http_server_cmd.js --output http_server.log
97-
sleep 15
98-
working-directory: test
9984

10085
- name: Run tests
101-
run: ctest --verbose -C RelWithDebInfo -E ".*wpad.*"
102-
working-directory: build
103-
104-
- name: Run test dhcp server
105-
# Used by wpad.dhcp googletest
106-
run: |
107-
npx pm2 start dhcp_server_cmd.js --output dhcp_server.log
108-
sleep 15
109-
working-directory: test
110-
111-
# Run as sudo to be able to bind to DHCP client port
112-
# TOOD: Fix dhcp test
113-
- name: Run wpad tests
114-
run: sudo ctest --verbose -C RelWithDebInfo -R ".*wpad.*:-wpad.dhcp.*"
115-
working-directory: build
116-
117-
- name: Stop test dhcp server
118-
run: npx pm2 stop dhcp_server_cmd
119-
working-directory: test
120-
121-
# Reset permissions to code coverage files if necessary
122-
- name: Reset coverage file permissions
123-
run: sudo chmod -R a+rw .
86+
run: ctest --verbose -C RelWithDebInfo
12487
working-directory: build
12588

12689
- name: Download pac from http server
127-
run: curl -v http://127.0.0.1:8080/pac.js
90+
run: curl -v ${{ env.PAC_URL }}
12891
working-directory: test
12992

13093
- name: Dump proxy info (gsettings)
@@ -139,7 +102,7 @@ jobs:
139102
140103
- name: Set auto proxy settings (gsettings)
141104
run: |
142-
gsettings set org.gnome.system.proxy autoconfig-url 'http://127.0.0.1:8080/pac.js'
105+
gsettings set org.gnome.system.proxy autoconfig-url '${{ env.PAC_URL }}'
143106
gsettings set org.gnome.system.proxy mode 'auto'
144107
145108
- name: Check auto proxy settings (gsettings)
@@ -155,7 +118,7 @@ jobs:
155118
fi
156119
out=$(./proxycli config auto_config_url)
157120
echo "Auto config url: $out"
158-
if [ "$out" = "http://127.0.0.1:8080/pac.js" ]; then
121+
if [ "$out" = "${{ env.PAC_URL }}" ]; then
159122
echo "Auto config url set successfully"
160123
else
161124
echo "Auto config url set failed"

.github/workflows/win32.yaml

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Build - Windows
22
on: [workflow_dispatch, push, pull_request]
33
env:
44
TERM: xterm-256color
5+
PAC_URL: https://raw.githubusercontent.com/snxd/proxyres/refs/heads/master/test/pac.js
56
concurrency:
67
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
78
cancel-in-progress: true
@@ -69,45 +70,12 @@ jobs:
6970
- name: Build project
7071
run: cmake --build build --config RelWithDebInfo
7172

72-
- name: Setup node version
73-
uses: actions/setup-node@v6
74-
with:
75-
node-version: 20
76-
77-
- name: Install test dependencies
78-
run: |
79-
corepack enable
80-
yarn install
81-
working-directory: test
82-
83-
- name: Run test http server
84-
shell: bash
85-
run: |
86-
npx pm2 start http_server_cmd.js
87-
sleep 15
88-
working-directory: test
89-
9073
- name: Run tests
91-
run: ctest --verbose -C RelWithDebInfo -E ".*wpad.*"
92-
working-directory: build
93-
94-
- name: Run test dhcp server
95-
# Used by wpad.dhcp googletest
96-
run: |
97-
npx pm2 start dhcp_server_cmd.js --output dhcp_server.log
98-
sleep 15
99-
working-directory: test
100-
101-
- name: Run wpad tests
102-
run: ctest --verbose -C RelWithDebInfo -R ".*wpad.*"
74+
run: ctest --verbose -C RelWithDebInfo
10375
working-directory: build
10476

105-
- name: Stop test dhcp server
106-
run: npx pm2 stop dhcp_server_cmd
107-
working-directory: test
108-
10977
- name: Download pac from http server
110-
run: curl -v http://127.0.0.1:8080/pac.js
78+
run: curl -v ${{ env.PAC_URL }}
11179
working-directory: test
11280

11381
- name: Dump proxy info
@@ -173,7 +141,7 @@ jobs:
173141
174142
- name: Set proxy auto config setting (IE)
175143
run: |
176-
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "http://127.0.0.1:8080/pac.js" /f
144+
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /t REG_SZ /d "${{ env.PAC_URL }}" /f
177145
178146
- name: Check proxy resolution (IE)
179147
shell: bash

test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ if(PROXYRES_BUILD_TESTS)
100100
list(APPEND TEST_SRCS
101101
test_execute.cc
102102
test_fetch.cc
103-
test_wpad.cc
104103
test_wpad_dhcp.cc
105104
test_wpad_dns.cc
106105
test_wpad_dns_fetch.cc)

test/dhcp_server.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

test/dhcp_server_cmd.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/http_server_cmd.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/package.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/test_wpad.cc

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)