Skip to content

Commit

Permalink
fix performance test workflow issues
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bubbajoe committed Apr 15, 2024
1 parent 8fa7f2c commit 39aedd5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/performance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion config.dgate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions functional-tests/admin_tests/iphash_load_balancer_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down
4 changes: 2 additions & 2 deletions functional-tests/admin_tests/merge_responses_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down
4 changes: 2 additions & 2 deletions functional-tests/admin_tests/modify_request_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions functional-tests/admin_tests/modify_response_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions functional-tests/admin_tests/performance_test_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion functional-tests/admin_tests/url_shortener_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 39aedd5

Please sign in to comment.