Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/implement-miss…
Browse files Browse the repository at this point in the history
…ing-www-authenticate-headers-jwt
  • Loading branch information
hanshuebner committed Jan 5, 2024
2 parents d61896c + 428ff45 commit 10e6baa
Show file tree
Hide file tree
Showing 495 changed files with 14,211 additions and 8,403 deletions.
65 changes: 45 additions & 20 deletions .ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@ set -e
function cyan() {
echo -e "\033[1;36m$*\033[0m"
}

function red() {
echo -e "\033[1;31m$*\033[0m"
}

export BUSTED_ARGS="--no-k -o htest -v --exclude-tags=flaky,ipv6"
function get_failed {
if [ ! -z "$FAILED_TEST_FILES_FILE" -a -s "$FAILED_TEST_FILES_FILE" ]
then
cat < $FAILED_TEST_FILES_FILE
else
echo "$@"
fi
}

BUSTED_ARGS="--keep-going -o htest -v --exclude-tags=flaky,ipv6"
if [ ! -z "$FAILED_TEST_FILES_FILE" ]
then
BUSTED_ARGS="--helper=spec/busted-log-failed.lua $BUSTED_ARGS"
fi

if [ "$KONG_TEST_DATABASE" == "postgres" ]; then
export TEST_CMD="bin/busted $BUSTED_ARGS,off"
Expand All @@ -29,56 +43,56 @@ else
export TEST_CMD="bin/busted $BUSTED_ARGS,postgres,db"
fi

if [[ "$KONG_TEST_COVERAGE" = true ]]; then
export TEST_CMD="$TEST_CMD --keep-going"
fi

if [ "$TEST_SUITE" == "integration" ]; then
if [[ "$TEST_SPLIT" == first* ]]; then
# GitHub Actions, run first batch of integration tests
eval "$TEST_CMD" $(ls -d spec/02-integration/* | sort | grep -v 05-proxy)
files=$(ls -d spec/02-integration/* | sort | grep -v 05-proxy)
files=$(get_failed $files)
eval "$TEST_CMD" $files

elif [[ "$TEST_SPLIT" == second* ]]; then
# GitHub Actions, run second batch of integration tests
# Note that the split here is chosen carefully to result
# in a similar run time between the two batches, and should
# be adjusted if imbalance become significant in the future
eval "$TEST_CMD" $(ls -d spec/02-integration/* | sort | grep 05-proxy)
files=$(ls -d spec/02-integration/* | sort | grep 05-proxy)
files=$(get_failed $files)
eval "$TEST_CMD" $files

else
# Non GitHub Actions
eval "$TEST_CMD" spec/02-integration/
eval "$TEST_CMD" $(get_failed spec/02-integration/)
fi
fi

if [ "$TEST_SUITE" == "dbless" ]; then
eval "$TEST_CMD" spec/02-integration/02-cmd \
spec/02-integration/05-proxy \
spec/02-integration/04-admin_api/02-kong_routes_spec.lua \
spec/02-integration/04-admin_api/15-off_spec.lua \
spec/02-integration/08-status_api/01-core_routes_spec.lua \
spec/02-integration/08-status_api/03-readiness_endpoint_spec.lua \
spec/02-integration/11-dbless \
spec/02-integration/20-wasm
eval "$TEST_CMD" $(get_failed spec/02-integration/02-cmd \
spec/02-integration/05-proxy \
spec/02-integration/04-admin_api/02-kong_routes_spec.lua \
spec/02-integration/04-admin_api/15-off_spec.lua \
spec/02-integration/08-status_api/01-core_routes_spec.lua \
spec/02-integration/08-status_api/03-readiness_endpoint_spec.lua \
spec/02-integration/11-dbless \
spec/02-integration/20-wasm)
fi
if [ "$TEST_SUITE" == "plugins" ]; then
set +ex
rm -f .failed

if [[ "$TEST_SPLIT" == first* ]]; then
# GitHub Actions, run first batch of plugin tests
PLUGINS=$(ls -d spec/03-plugins/* | head -n22)
PLUGINS=$(get_failed $(ls -d spec/03-plugins/* | head -n22))

elif [[ "$TEST_SPLIT" == second* ]]; then
# GitHub Actions, run second batch of plugin tests
# Note that the split here is chosen carefully to result
# in a similar run time between the two batches, and should
# be adjusted if imbalance become significant in the future
PLUGINS=$(ls -d spec/03-plugins/* | tail -n+23)
PLUGINS=$(get_failed $(ls -d spec/03-plugins/* | tail -n+23))

else
# Non GitHub Actions
PLUGINS=$(ls -d spec/03-plugins/*)
PLUGINS=$(get_failed $(ls -d spec/03-plugins/*))
fi

for p in $PLUGINS; do
Expand All @@ -89,9 +103,20 @@ if [ "$TEST_SUITE" == "plugins" ]; then
echo

$TEST_CMD $p || echo "* $p" >> .failed

# the suite is run multiple times for plugins: collect partial failures
if [ ! -z "$FAILED_TEST_FILES_FILE" ]
then
cat "$FAILED_TEST_FILES_FILE" >> "$FAILED_TEST_FILES_FILE.tmp"
fi
done

if [[ "$TEST_SPLIT" == second* ]] || [[ "$TEST_SPLIT" != first* ]]; then
if [ ! -z "$FAILED_TEST_FILES_FILE.tmp" -a -s "$FAILED_TEST_FILES_FILE.tmp" ]
then
mv "$FAILED_TEST_FILES_FILE.tmp" "$FAILED_TEST_FILES_FILE"
fi

if [[ "$TEST_SPLIT" != first* ]]; then
cat kong-*.rockspec | grep kong- | grep -v zipkin | grep -v sidecar | grep "~" | grep -v kong-prometheus-plugin | while read line ; do
REPOSITORY=`echo $line | sed "s/\"/ /g" | awk -F" " '{print $1}'`
VERSION=`luarocks show $REPOSITORY | grep $REPOSITORY | head -1 | awk -F" " '{print $2}' | cut -f1 -d"-"`
Expand Down
4 changes: 0 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ https://github.com/Kong/kong/blob/master/COMMUNITY_PLEDGE.md
- [ ] A changelog file has been created under `changelog/unreleased/kong` or `skip-changelog` label added on PR if changelog is unnecessary. [README.md](https://github.com/Kong/gateway-changelog/README.md)
- [ ] There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

### Full changelog

* [Implement ...]

### Issue reference

<!--- If it fixes an open issue, please link to the issue here. -->
Expand Down
Loading

0 comments on commit 10e6baa

Please sign in to comment.