tests are now ran with https as we now use https with nginx as a frontend however:
The client tester is super scuffed and no longer in a pipeline ready state as a new docker image has to be created(again)
This commit is contained in:
parent
51fa07158f
commit
6bc8dd0d7d
@ -213,5 +213,5 @@ def run(worker: Worker):
|
||||
worker.logs()
|
||||
|
||||
if __name__ == '__main__':
|
||||
worker = Worker('http://localhost:4536', create_admin=True)
|
||||
worker = Worker('https://localhost', create_admin=True)
|
||||
run(worker)
|
||||
|
@ -4,6 +4,13 @@ import time
|
||||
import json
|
||||
from urllib.parse import quote
|
||||
|
||||
# TODO/NOTE: this isn't necessary for literally any server that doesn't self-sign
|
||||
# There's prolly a less retared way of doing this "safely" in testing pipelines
|
||||
# but im in no rush to figure that out right now
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
|
||||
|
||||
class RequestError(Exception):
|
||||
pass
|
||||
@ -139,13 +146,13 @@ class Request:
|
||||
url = self.url + self.query_string
|
||||
raw_params = (self.query_string, self.qs_dict)
|
||||
if method == 'get':
|
||||
resp = requests.get(url)
|
||||
resp = requests.get(url, verify=False)
|
||||
return Response('get', url, resp.text, resp.status_code, hope, p=raw_params)
|
||||
elif method == 'post':
|
||||
resp = requests.post(url, data=self.body)
|
||||
resp = requests.post(url, data=self.body, verify=False)
|
||||
return Response('post', url, resp.text, resp.status_code, hope, p=raw_params)
|
||||
elif method == 'delete':
|
||||
resp = requests.delete(url)
|
||||
resp = requests.delete(url, verify=False)
|
||||
return Response('delete', url, resp.text, resp.status_code, hope, p=raw_params)
|
||||
|
||||
else:
|
||||
|
15
json-api/ngninx.conf
Normal file
15
json-api/ngninx.conf
Normal file
@ -0,0 +1,15 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
# passing to json-api here
|
||||
location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
try_files $uri $uri/ =404;
|
||||
|
||||
# attempt to pass
|
||||
proxy_pass http://0.0.0.0:4536;
|
||||
#proxy_set_header: X-Real-IP $remote_addr;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user