Skip to content

Commit

Permalink
install docker and use host's docker daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
devyetii committed May 5, 2023
1 parent 893baf7 commit 4012a27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docker.local/bin/unit_test.sh
Expand Up @@ -50,9 +50,9 @@ if [[ -n "$PACKAGE" ]]; then
# Run tests from a single package.
# assume that $PACKAGE looks something like: 0chain.net/chaincore/threshold/bls
echo "Running unit tests from $PACKAGE:"
docker run "$INTERACTIVE" zchain_unit_test sh -c "cd /0chain/code/go/$PACKAGE; go test -tags bn256 ./..."
docker run "$INTERACTIVE" --network="host" -v /var/run/docker.sock:/var/run/docker.sock zchain_unit_test sh -c "cd /0chain/code/go/$PACKAGE; go test -tags bn256 ./..."
else
# Run all tests.
echo "Running general unit tests:"
docker run "$INTERACTIVE" -v $(pwd)/code:/codecov zchain_unit_test sh -c "cd 0chain.net; go test -tags bn256 -coverprofile=/codecov/coverage.txt -covermode=atomic ./..."
docker run "$INTERACTIVE" --network="host" -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/code:/codecov zchain_unit_test sh -c "cd 0chain.net; go test -tags bn256 -coverprofile=/codecov/coverage.txt -covermode=atomic ./..."
fi
2 changes: 1 addition & 1 deletion docker.local/build.unit_test/Dockerfile
@@ -1,7 +1,7 @@
FROM zchain_build_base
ENV SRC_DIR=/0chain

RUN apk add --update --no-cache curl
RUN apk add --update --no-cache curl docker
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2

# Download the dependencies:
Expand Down

0 comments on commit 4012a27

Please sign in to comment.