From 39aedd54eb619985e93acd46c66b6c06ea32b31c Mon Sep 17 00:00:00 2001 From: bubbajoe Date: Sun, 14 Apr 2024 22:25:06 +0900 Subject: [PATCH] fix performance test workflow issues fix script bug fix: add ssl port to avoid permission errors change sleep time back to 5 increase sleep time fix: add --ignore-stdin in httpie scripts add keyring information to httpie install script fix perf workflow test --- .github/workflows/performance_test.yml | 15 +++++++++++++-- config.dgate.yaml | 2 +- .../admin_tests/iphash_load_balancer_test.sh | 4 ++-- .../admin_tests/merge_responses_test.sh | 4 ++-- .../admin_tests/modify_request_test.sh | 4 ++-- .../admin_tests/modify_response_test.sh | 4 ++-- .../admin_tests/performance_test_prep.sh | 4 ++-- .../admin_tests/url_shortener_test.sh | 2 +- 8 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/performance_test.yml b/.github/workflows/performance_test.yml index c7321d0..e77f00e 100644 --- a/.github/workflows/performance_test.yml +++ b/.github/workflows/performance_test.yml @@ -17,13 +17,24 @@ jobs: with: go-version-file: 'go.mod' + - run: | + curl -SsL https://packages.httpie.io/deb/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/httpie.gpg + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" | sudo tee /etc/apt/sources.list.d/httpie.list > /dev/null + sudo apt update + sudo apt install httpie + - run: go mod download - - run: go run cmd/dgate-server/main.go & + - run: | + export PORT=8080 + export PORT_SSL=8443 + go run cmd/dgate-server/main.go & - name: Wait for server to start run: sleep 5 - - run: ./functional-tests/admin_tests/performance_test_prep.sh + - run: | + export PROXY_URL=http://localhost:8080 + ./functional-tests/admin_tests/performance_test_prep.sh - name: Run local k6 test uses: grafana/k6-action@v0.3.1 diff --git a/config.dgate.yaml b/config.dgate.yaml index 44c309e..daffd24 100644 --- a/config.dgate.yaml +++ b/config.dgate.yaml @@ -35,7 +35,7 @@ proxy: namespace: "admin" patterns: ["admin.*"] tls: - port: 443 + port: ${PORT_SSL:-443} auto_generate: true cert_file: .lego/certificates/ufosoup.com.crt key_file: .lego/certificates/ufosoup.com.key diff --git a/functional-tests/admin_tests/iphash_load_balancer_test.sh b/functional-tests/admin_tests/iphash_load_balancer_test.sh index 4bd846a..1dacf4f 100755 --- a/functional-tests/admin_tests/iphash_load_balancer_test.sh +++ b/functional-tests/admin_tests/iphash_load_balancer_test.sh @@ -7,7 +7,7 @@ PROXY_URL=${PROXY_URL:-"http://localhost"} DIR="$( cd "$( dirname "$0" )" && pwd )" -CALL='http --check-status -p=mb -F' +CALL='http --ignore-stdin --check-status -p=mb -F' $CALL PUT ${ADMIN_URL}/namespace \ name=test-lb-ns @@ -22,7 +22,7 @@ $CALL ${ADMIN_URL}/domain MOD_B64="$(base64 < $DIR/iphash_load_balancer.ts)" $CALL PUT ${ADMIN_URL}/module \ name=printer \ - payload=$MOD_B64 \ + payload="$MOD_B64" \ namespace=test-lb-ns diff --git a/functional-tests/admin_tests/merge_responses_test.sh b/functional-tests/admin_tests/merge_responses_test.sh index 0f217c8..3d2eeba 100755 --- a/functional-tests/admin_tests/merge_responses_test.sh +++ b/functional-tests/admin_tests/merge_responses_test.sh @@ -7,7 +7,7 @@ PROXY_URL=${PROXY_URL:-"http://localhost"} DIR="$( cd "$( dirname "$0" )" && pwd )" -CALL='http --check-status -p=mb -F' +CALL='http --ignore-stdin --check-status -p=mb -F' $CALL PUT ${ADMIN_URL}/namespace \ name=test-ns @@ -22,7 +22,7 @@ $CALL ${ADMIN_URL}/domain MOD_B64="$(base64 < $DIR/merge_responses.ts)" $CALL PUT ${ADMIN_URL}/module \ name=printer \ - payload=$MOD_B64 \ + payload="$MOD_B64" \ namespace=test-ns diff --git a/functional-tests/admin_tests/modify_request_test.sh b/functional-tests/admin_tests/modify_request_test.sh index c8fb616..dd9b89f 100755 --- a/functional-tests/admin_tests/modify_request_test.sh +++ b/functional-tests/admin_tests/modify_request_test.sh @@ -7,7 +7,7 @@ PROXY_URL=${PROXY_URL:-"http://localhost"} DIR="$( cd "$( dirname "$0" )" && pwd )" -CALL='http --check-status -p=mb -F' +CALL='http --ignore-stdin --check-status -p=mb -F' $CALL PUT ${ADMIN_URL}/namespace \ name=modify_request_test-ns @@ -19,7 +19,7 @@ $CALL PUT ${ADMIN_URL}/domain \ MOD_B64="$(base64 < $DIR/modify_request.ts)" $CALL PUT ${ADMIN_URL}/module \ - name=printer payload=$MOD_B64 \ + name=printer payload="$MOD_B64" \ namespace=modify_request_test-ns $CALL PUT ${ADMIN_URL}/service \ diff --git a/functional-tests/admin_tests/modify_response_test.sh b/functional-tests/admin_tests/modify_response_test.sh index 8815741..2f500a4 100755 --- a/functional-tests/admin_tests/modify_response_test.sh +++ b/functional-tests/admin_tests/modify_response_test.sh @@ -7,7 +7,7 @@ PROXY_URL=${PROXY_URL:-"http://localhost"} DIR="$( cd "$( dirname "$0" )" && pwd )" -CALL='http --check-status -p=mb -F' +CALL='http --ignore-stdin --check-status -p=mb -F' $CALL PUT ${ADMIN_URL}/namespace \ name=test-ns @@ -19,7 +19,7 @@ $CALL PUT ${ADMIN_URL}/domain \ MOD_B64="$(base64 < $DIR/modify_response.ts)" $CALL PUT ${ADMIN_URL}/module \ - name=printer payload=$MOD_B64 \ + name=printer payload="$MOD_B64" \ namespace=test-ns $CALL PUT ${ADMIN_URL}/service \ diff --git a/functional-tests/admin_tests/performance_test_prep.sh b/functional-tests/admin_tests/performance_test_prep.sh index b32b642..bd9706c 100755 --- a/functional-tests/admin_tests/performance_test_prep.sh +++ b/functional-tests/admin_tests/performance_test_prep.sh @@ -9,7 +9,7 @@ DIR="$( cd "$( dirname "$0" )" && pwd )" # SETUP BASE -CALL='http --check-status -p=mb -F' +CALL='http --ignore-stdin --check-status -p=mb -F' # domain setup @@ -26,7 +26,7 @@ $CALL PUT ${ADMIN_URL}/service \ MOD_B64="$(base64 < $DIR/performance_test_prep.ts)" $CALL PUT ${ADMIN_URL}/module \ - name=test-mod payload=$MOD_B64 \ + name=test-mod payload="$MOD_B64" \ namespace=test-ns1 $CALL PUT ${ADMIN_URL}/route \ diff --git a/functional-tests/admin_tests/url_shortener_test.sh b/functional-tests/admin_tests/url_shortener_test.sh index 13414a8..228081c 100755 --- a/functional-tests/admin_tests/url_shortener_test.sh +++ b/functional-tests/admin_tests/url_shortener_test.sh @@ -26,7 +26,7 @@ $CALL PUT ${ADMIN_URL}/collection \ MOD_B64="$(base64 < $DIR/url_shortener.ts)" $CALL PUT ${ADMIN_URL}/module \ name=printer \ - payload=$MOD_B64 \ + payload="$MOD_B64" \ namespace=url_shortener-ns $CALL PUT ${ADMIN_URL}/route \