fix: upstream discovery args metadata field caused crash. (#2832) #5126
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
name: Backend Unit Test | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'api/**' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'api/**' | |
jobs: | |
run-test: | |
runs-on: ubuntu-latest | |
services: | |
etcd: | |
image: bitnami/etcd:3.5.2 | |
ports: | |
- 2379:2379 | |
- 2380:2380 | |
env: | |
ALLOW_NONE_AUTHENTICATION: yes | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: run test | |
run: | | |
make api-test | |
- name: upload coverage profile | |
working-directory: ./api | |
run: | | |
bash <(curl -s https://codecov.io/bash) -F backend-unit-test | |
- name: run with custom port | |
working-directory: ./api | |
run: | | |
export GO111MOUDULE=on | |
export APISIX_CONF_PATH=$PWD/conf | |
sed -i 's/9000/8088/' conf/conf.yaml | |
go build -o ./manager-api ./main.go | |
./manager-api > ./api.log 2>&1 & | |
sleep 2 | |
cat ./api.log | |
cat conf/conf.yaml | |
- name: run with custom port | |
working-directory: ./api | |
run: | | |
curl http://127.0.0.1:8088/apisix/admin/user/login -X POST -i -d '{"username":"admin", "password": "admin"}' | |
code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:8088/apisix/admin/user/login -X POST -i -d '{"username":"admin", "password": "admin"}') | |
if [ ! $code -eq 200 ]; then | |
echo "failed: failed to custom port" | |
exit 1 | |
fi |