Skip to content

Commit

Permalink
Add a docker image for integration tests (#59)
Browse files Browse the repository at this point in the history
* Add a docker image for integration tests

* Docker - pre-download dependencies + increase timeout for libp2p topic subscription info exchange
  • Loading branch information
Maelkum authored Mar 27, 2023
1 parent ea1c5cc commit 87ea29f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions docker/integration-tests/Dockerfile.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM --platform=linux/amd64 ubuntu:latest

WORKDIR /app/node

## copy source files
COPY . .

# curl, unzip other utilities
RUN apt-get update && \
apt-get install --no-install-recommends --assume-yes curl unzip pv ca-certificates gnupg2 build-essential

# install go
RUN curl -o go1.18.3.linux-amd64.tar.gz -sSL https://go.dev/dl/go1.18.3.linux-amd64.tar.gz
RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin

# get the runtime
RUN curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/v0.0.12/blockless-runtime.linux-latest.x86_64.tar.gz
RUN mkdir /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime


# specify where runtime is installed
ENV B7S_INTEG_RUNTIME_DIR=/app/runtime

# download dependencies
RUN go get ./...

# run the tests
CMD [ "go", "test", "--tags=integration", "-v", "./..." ]
2 changes: 1 addition & 1 deletion node/node_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
// This is the pause we make after subscribing to the topic and before publishing a message.
// In reality as little as 250ms is enough, but lets allow a longer time for when
// tests are executed in parallel or on weaker machines.
subscriptionDiseminationPause = 1 * time.Second
subscriptionDiseminationPause = 2 * time.Second
)

func TestNode_New(t *testing.T) {
Expand Down

0 comments on commit 87ea29f

Please sign in to comment.