snapshot of https://github.com/ory/keto.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
CI / Run lints and checks (push) Failing after 47s
CI / Run tests (push) Failing after 1s
CI / Run race tests (push) Failing after 5s
CI / Build CLI docs (push) Has been skipped
CI / Run buf actions (push) Failing after 5s
CodeQL / Analyze (go) (push) Failing after 3s
CodeQL / Analyze (javascript) (push) Failing after 2s
Docker Image Scanners / scanners (push) Failing after 3s
Format / format (push) Failing after 3s
Synchronize Issue Labels / Synchronize Issue Labels (push) Has been skipped
CI / Generate release (push) Has been skipped
CI / Draft newsletter (push) Has been skipped
CI / Pending approval Slack notification (push) Has been skipped
CI / Send newsletter (push) Has been skipped
Some checks failed
CI / Run lints and checks (push) Failing after 47s
CI / Run tests (push) Failing after 1s
CI / Run race tests (push) Failing after 5s
CI / Build CLI docs (push) Has been skipped
CI / Run buf actions (push) Failing after 5s
CodeQL / Analyze (go) (push) Failing after 3s
CodeQL / Analyze (javascript) (push) Failing after 2s
Docker Image Scanners / scanners (push) Failing after 3s
Format / format (push) Failing after 3s
Synchronize Issue Labels / Synchronize Issue Labels (push) Has been skipped
CI / Generate release (push) Has been skipped
CI / Draft newsletter (push) Has been skipped
CI / Pending approval Slack notification (push) Has been skipped
CI / Send newsletter (push) Has been skipped
This commit is contained in:
60
contrib/docs-code-samples/test.sh
Executable file
60
contrib/docs-code-samples/test.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
go -C ../.. install .
|
||||
PATH="../../.bin/gobin:../../.bin/brew/bin:../../.bin/brew/sbin:$PATH"
|
||||
|
||||
function teardown() {
|
||||
kill "$keto_server_pid" || true
|
||||
}
|
||||
trap teardown EXIT
|
||||
|
||||
function compare() {
|
||||
local actual="$1"
|
||||
local expected="$2/expected_output.json"
|
||||
local d="jd -set"
|
||||
if [[ ! -f "$expected" ]]; then
|
||||
expected="$2/expected_output.txt"
|
||||
d="diff -U 100000"
|
||||
fi
|
||||
$d "$actual" "$expected"
|
||||
}
|
||||
|
||||
for suite in */ ; do
|
||||
suite=$(basename "$suite")
|
||||
if [ "$suite" == "node_modules" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
keto serve -c "$suite/keto.yml" &> "serve_$suite.log" &
|
||||
keto_server_pid=$!
|
||||
|
||||
echo "starting keto server for suite $suite"
|
||||
curl --retry 7 --retry-connrefused --output /dev/null --silent --fail http://127.0.0.1:4466/health/ready
|
||||
|
||||
for main in "$suite"/*/main.go; do
|
||||
echo "Running $main"
|
||||
compare <(go run -tags docscodesamples "./$main" 2>&1) "$(dirname "$main")"
|
||||
done
|
||||
|
||||
for index in "$suite"/*/index.js; do
|
||||
echo "Running $index"
|
||||
compare <(node "$index" 2>&1) "$(dirname "$index")"
|
||||
done
|
||||
|
||||
for tc in "$suite"/*/curl.sh; do
|
||||
echo "Running $tc"
|
||||
compare <("$tc" 2>&1) "$(dirname "$tc")"
|
||||
done
|
||||
|
||||
for tc in "$suite"/*/cli.sh; do
|
||||
echo "Running $tc"
|
||||
compare <("$tc" 2>&1) "$(dirname "$tc")"
|
||||
done
|
||||
|
||||
kill "$keto_server_pid"
|
||||
done
|
||||
|
||||
echo
|
||||
echo "EVERYTHING PASSED"
|
||||
echo
|
||||
Reference in New Issue
Block a user