Skip to content

Commit 2ef4bc1

Browse files
committed
Migrate distributables tests to the REST API too
1 parent f971b63 commit 2ef4bc1

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

test/distributables-test/unix.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,17 @@ curl $CURL_OPTIONS "$WITH_ORIGIN" "$AS_JSON" 'http://127.0.0.1:45456/start' \
2626
--data '{"plugins":{"http":{"options":{"cors":false,"suggestChanges":false,"http2":"fallback","https":{"tlsPassthrough":[]}}},"webrtc":{}}}'
2727

2828
echo "\nCan query the API server version?"
29-
curl $CURL_OPTIONS "$WITH_ORIGIN" "$AS_JSON" http://127.0.0.1:45457/ \
30-
--data '{"query": "query getVersion { version }"}'
29+
curl $CURL_OPTIONS "$WITH_ORIGIN" http://127.0.0.1:45457/version
3130

3231
echo "\nCan get config?"
33-
curl $CURL_OPTIONS "$WITH_ORIGIN" "$AS_JSON" http://127.0.0.1:45457/ \
34-
--data '{"query": "query getConfig { config { certificateContent certificatePath certificateFingerprint } }"}'
32+
curl $CURL_OPTIONS "$WITH_ORIGIN" http://127.0.0.1:45457/config
3533

3634
echo "\nCan query interceptors?"
37-
curl $CURL_OPTIONS "$WITH_ORIGIN" "$AS_JSON" http://127.0.0.1:45457/ \
38-
--data '{"query": "query getInterceptors { interceptors { id version, metadata isActivable isActive(proxyPort: 8000) } }"}'
35+
curl $CURL_OPTIONS "$WITH_ORIGIN" http://127.0.0.1:45457/interceptors
3936

4037
echo "\nCan trigger update?"
4138
# (can't test that it actually updates, unfortunately)
42-
curl $CURL_OPTIONS "$WITH_ORIGIN" "$AS_JSON" http://127.0.0.1:45457/ \
43-
--data '{"query": "mutation TriggerUpdate { triggerUpdate }"}'
39+
curl $CURL_OPTIONS "$WITH_ORIGIN" -X POST http://127.0.0.1:45457/update
4440

4541
# ^ This will fail if they receive anything but a 200 result.
4642
# This ensures that the server is startable, and has minimal functionality for launch.

test/distributables-test/windows.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ curl %CURL_OPTIONS% %WITH_ORIGIN% %AS_JSON% -X POST "http://127.0.0.1:45456/star
3737
echo:
3838
echo:
3939
echo Can query the API server version?
40-
curl %CURL_OPTIONS% %WITH_ORIGIN% %AS_JSON% http://127.0.0.1:45457/ -d "{\"query\": \"query getVersion { version }\"}" || goto :error
40+
curl %CURL_OPTIONS% %WITH_ORIGIN% http://127.0.0.1:45457/version || goto :error
4141

4242
echo:
4343
echo:
4444
echo Can get config?
45-
curl %CURL_OPTIONS% %WITH_ORIGIN% %AS_JSON% http://127.0.0.1:45457/ -d "{\"query\": \"query getConfig { config { certificateContent certificatePath certificateFingerprint } }\"}" || goto :error
45+
curl %CURL_OPTIONS% %WITH_ORIGIN% http://127.0.0.1:45457/config || goto :error
4646

4747
echo:
4848
echo:
4949
echo Can query interceptors?
50-
curl %CURL_OPTIONS% %WITH_ORIGIN% %AS_JSON% http://127.0.0.1:45457/ -d "{\"query\": \"query getInterceptors { interceptors { id version, metadata isActivable isActive(proxyPort: 8000) } }\"}" || goto :error
50+
curl %CURL_OPTIONS% %WITH_ORIGIN% http://127.0.0.1:45457/interceptors || goto :error
5151

5252
echo:
5353
echo:
5454
echo Can trigger update?
5555
REM (can't test that it actually updates, unfortunately)
56-
curl %CURL_OPTIONS% %WITH_ORIGIN% %AS_JSON% http://127.0.0.1:45457/ -d "{\"query\": \"mutation TriggerUpdate { triggerUpdate }\"}" || goto :error
56+
curl %CURL_OPTIONS% %WITH_ORIGIN% -X POST http://127.0.0.1:45457/update || goto :error
5757

5858
REM ^ This will fail if they receive anything but a 200 result.
5959
REM This ensures that the server is startable, and has minimal functionality for launch.

0 commit comments

Comments
 (0)