Skip to content

Commit

Permalink
fix: integrate test script
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceLiZhixin committed Sep 26, 2021
1 parent 4314ba8 commit 91ebda2
Showing 1 changed file with 6 additions and 30 deletions.
36 changes: 6 additions & 30 deletions integrate_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,11 @@ echo "github pull request repo param -> $1"
echo "github pull request base branch -> $3"
echo "github pull request head branch -> ${GITHUB_HEAD_REF}"

samples_testing() {
echo "use dubbo-go-samples $3 branch for integration testing"
git clone -b master https://github.com/apache/dubbo-go-samples.git samples && cd samples
echo "use dubbo-go-samples $3 branch for integration testing"
git clone -b master https://github.com/apache/dubbo-go-samples.git samples && cd samples

# update dubbo-go to current commit id
go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2"
# update dubbo-go to current commit id
go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2"

# start integrate test
./start_integrate_test.sh
}

local_testing() {
echo "use test/integrate/dubbo for integration testing"
# default use zk as registry
#start zookeeper registry insecure listen in [:]:2181
docker run -d --network host zookeeper
echo "zookeeper listen in [:]2181"

# build go-server image
cd ./test/integrate/dubbo/go-server
docker build . -t ci-provider --build-arg REPO="$1" --build-arg COMMITID="$2"
cd "${ROOT_DIR}"
docker run -d --network host ci-provider
}

# check dubbo-go-samples corresponding branch
res=$(git ls-remote --heads https://github.com/apache/dubbo-go-samples.git "$3" | wc -l)
if [ "$res" -eq "1" ]; then
samples_testing "$@"
else
local_testing "$@"
fi
# start integrate test
./start_integrate_test.sh

0 comments on commit 91ebda2

Please sign in to comment.