-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve extractor promise wait timeout add prevotereq to rafthttp optimize promise waiting change example domains so they work on raft instances add admin test * code cleaning and make uuid optional * create directory if it doesnt exists * change all commands to use redirect forwarding and version logging * feat: Add TEST_URL for functional tests * refactor: WaitForChanges, SetReady * refactor: Update methods in MockChangeState for better error handling. * Add tests, refactor storage, optimize start up time for raft * update test to be inclusive for distributed nodes as well, service url validation, improve document loading and storing * fix e2e pipeline * refactor admin, raft, and tests: fix deadlocks, slow startup, and * remove distributed tests
- Loading branch information
Showing
80 changed files
with
2,042 additions
and
1,405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,22 +36,29 @@ jobs: | |
dgate-cli --version | ||
go install github.com/dgate-io/dgate/cmd/dgate-server | ||
dgate-server --version | ||
- run: go run cmd/dgate-server/main.go & | ||
|
||
- name: Wait for server to start | ||
run: sleep 5 | ||
- name: Install jq | ||
run: | | ||
sudo apt install -y jq | ||
jq --version | ||
- name: Functional Tests | ||
- name: Install goreman | ||
run: | | ||
go install github.com/mattn/goreman@latest | ||
goreman version | ||
- run: go run cmd/dgate-server/main.go & | ||
|
||
- run: cd functional-tests/raft_tests && goreman start & | ||
|
||
- name: Wait for server to start | ||
run: sleep 10 | ||
|
||
- name: Functional Standalone Tests | ||
run: | | ||
for i in functional-tests/admin_tests/*.sh; \ | ||
do bash -c $i; done | ||
- name: Run local k6 test | ||
uses: grafana/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
set -eo xtrace | ||
|
||
ADMIN_URL=${ADMIN_URL:-"http://localhost:9080"} | ||
PROXY_URL=${PROXY_URL:-"http://localhost"} | ||
TEST_URL=${TEST_URL:-"http://localhost:8888"} | ||
|
||
DIR="$( cd "$( dirname "$0" )" && pwd )" | ||
|
||
export DGATE_ADMIN_API=$ADMIN_URL | ||
|
||
# check if uuid is available | ||
if ! command -v uuid > /dev/null; then | ||
id=X$RANDOM-$RANDOM-$RANDOM | ||
else | ||
id=$(uuid) | ||
fi | ||
|
||
dgate-cli -Vf namespace create name=ns-$id | ||
|
||
dgate-cli -Vf domain create name=dm-$id \ | ||
namespace=ns-$id priority:=$RANDOM patterns="$id.example.com" | ||
|
||
dgate-cli -Vf service create \ | ||
name=svc-$id namespace=ns-$id \ | ||
urls="$TEST_URL/$RANDOM" | ||
|
||
dgate-cli -Vf module create name=module1 \ | ||
payload@=$DIR/admin_test.ts \ | ||
namespace=ns-$id | ||
|
||
dgate-cli -Vf route create \ | ||
name=rt-$id \ | ||
service=svc-$id \ | ||
namespace=ns-$id \ | ||
paths="/,/{id},/$id,/$id/{id}" \ | ||
methods=GET,POST,PUT \ | ||
modules=module1 \ | ||
preserveHost:=false \ | ||
stripPath:=false | ||
|
||
curl -sf $ADMIN_URL/readyz > /dev/null | ||
|
||
curl -f ${PROXY_URL}/$id/$RANDOM -H Host:$id.example.com | ||
|
||
echo "Admin Test Succeeded" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
export const responseModifier = async (ctx: any) => { | ||
console.log("responseModifier -> path params", ctx.pathParams()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.