-
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.
add module update functional test, add hclog formatting fixes, disabl…
…e… (#10) * add module update functional test, add hclog formating fixes, disable stacktraces, and caller logs, add ref updated for routes in the resource manager * fix collection/namespace switching, and fix tests * fix collection and namespace switching
- Loading branch information
Showing
30 changed files
with
370 additions
and
198 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
set -eo xtrace | ||
|
||
ADMIN_URL=${ADMIN_URL:-"http://localhost:9080"} | ||
PROXY_URL=${PROXY_URL:-"http://localhost"} | ||
|
||
DIR="$( cd "$( dirname "$0" )" && pwd )" | ||
|
||
export DGATE_ADMIN_API=$ADMIN_URL | ||
|
||
dgate-cli namespace create \ | ||
name=change_checker-ns | ||
|
||
dgate-cli domain create \ | ||
name=change_checker-dm \ | ||
patterns:='["change_checker.com"]' \ | ||
namespace=change_checker-ns | ||
|
||
dgate-cli module create name=change_checker-mod \ | ||
payload@=$DIR/change_checker_1.ts \ | ||
namespace=change_checker-ns | ||
|
||
dgate-cli route create \ | ||
name=base_rt paths:='["/", "/{id}"]' \ | ||
modules:='["change_checker-mod"]' \ | ||
methods:='["GET","POST"]' \ | ||
stripPath:=true \ | ||
preserveHost:=true \ | ||
namespace=change_checker-ns | ||
|
||
MODID1=$(curl -sG -H Host:change_checker.com ${PROXY_URL}/ | jq -r '.mod') | ||
|
||
if [ "$MODID1" != "module1" ]; then | ||
echo "Initial assert failed" | ||
exit 1 | ||
fi | ||
|
||
|
||
dgate-cli module create name=change_checker-mod \ | ||
payload@=$DIR/change_checker_2.ts \ | ||
namespace=change_checker-ns | ||
|
||
# dgate-cli r.ker-ns | ||
|
||
MODID2=$(curl -sG -H Host:change_checker.com ${PROXY_URL}/ | jq -r '.mod') | ||
|
||
if [ "$MODID2" != "module2" ]; then | ||
echo "module update failed" | ||
exit 1 | ||
fi |
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,6 @@ | ||
|
||
export const requestHandler = async (ctx: any) => { | ||
ctx.response().status(201).json({ | ||
mod: "module1", | ||
}); | ||
} |
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,6 @@ | ||
|
||
export const requestHandler = async (ctx: any) => { | ||
ctx.response().status(201).json({ | ||
mod: "module2", | ||
}); | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// @ts-ignore | ||
import { sleep } from "dgate"; | ||
|
||
export const fetchUpstream = async (ctx) => | ||
|
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
version: v1 | ||
debug: true | ||
log_level: info | ||
|
||
tags: | ||
|
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
version: v1 | ||
debug: true | ||
log_level: info | ||
tags: | ||
- "dev" | ||
|
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
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.