Skip to content

Commit

Permalink
Github workflow for HTTPServer test (#356)
Browse files Browse the repository at this point in the history
* github workflow for httpsrv_test.sh

* move integration test to test.yml
  • Loading branch information
samutamm authored Nov 8, 2021
1 parent 6c538a6 commit fa76323
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,21 @@ jobs:
go mod verify
go mod download
go test -v ./...
integration-test-ubuntu:
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v2
with:
go-version: ^1.16.5

- name: Checkout codebase
uses: actions/checkout@v2

- name: Test
run: |
make httpserver_test
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(dir $(MKFILE_PATH))
RELEASE_DIR := ${MKFILE_DIR}bin
GO_PATH := $(shell go env | grep GOPATH | awk -F '"' '{print $$2}')
HTTPSERVER_TEST_PATH := build/test

# Version
RELEASE?=v1.3.2
Expand Down Expand Up @@ -97,6 +98,13 @@ test:
go mod verify
go test -v ./... ${TEST_FLAGS}

httpserver_test: build
{ \
set -e ;\
cd ${HTTPSERVER_TEST_PATH} ;\
./httpserver_test.sh ;\
}

clean:
rm -rf ${RELEASE_DIR}
rm -rf ${MKFILE_DIR}build/cache
Expand Down
2 changes: 1 addition & 1 deletion example/sbin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ do
try_time=$(($try_time+1))
pid=`ps -eo pid,args | grep "$server" | grep -v grep | awk '{print $1}'`
if [[ $try_time -ge 2 ]]; then
echo "Error: failed to start $sever"
echo "Error: failed to start $server"
exit 2
fi
done
Expand Down

0 comments on commit fa76323

Please sign in to comment.