Skip to content

Commit

Permalink
Test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozen committed Jun 28, 2024
1 parent 943fe6a commit 24b4da8
Show file tree
Hide file tree
Showing 17 changed files with 719 additions and 528 deletions.
17 changes: 15 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
*
!scripts/docker
harmony_db*
bin
cache
.DS_Store
*.log
log-*
tmp_log
*.rlp
**/*.rlp
.hmykey
db-127.0.0.1-*
db*
.dht
.dht-*
explorer_storage_*
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,6 @@ debug_external: clean

build_localnet_validator:
bash test/build-localnet-validator.sh

protofiles:
bash ./scripts/gogenerate.sh
68 changes: 68 additions & 0 deletions Tests.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
FROM golang:1.21

WORKDIR $GOPATH/src/github.com/harmony-one

SHELL ["/bin/bash", "-c"]

# These are split into multiple lines to allow debugging the error message that I cannot reproduce locally
# The command `xxx` returned a non-zero code: 100
RUN apt clean > /dev/null 2>1
RUN apt update > /dev/null 2>1
RUN apt upgrade -y > /dev/null 2>1
RUN apt update -y > /dev/null 2>1
RUN apt install -y unzip libgmp-dev libssl-dev curl git jq make gcc g++ bash sudo python3 python3-pip

#RUN #git clone https://github.com/harmony-one/harmony.git > /dev/null 2>1 \
RUN git clone https://github.com/harmony-one/bls.git > /dev/null 2>1
RUN git clone https://github.com/harmony-one/mcl.git > /dev/null 2>1

# Fix complaints about Docker / root / user ownership for Golang "VCS stamping"
# https://github.com/golang/go/blob/3900ba4baf0e3b309a55b5ac4dd25f709df09772/src/cmd/go/internal/vcs/vcs.go
RUN git config --global --add safe.directory $GOPATH/src/github.com/harmony-one/harmony > /dev/null 2>1 \
&& git config --global --add safe.directory $GOPATH/src/github.com/harmony-one/bls > /dev/null 2>1 \
&& git config --global --add safe.directory $GOPATH/src/github.com/harmony-one/mcl > /dev/null 2>1

# Build to fetch all dependencies for faster test builds
WORKDIR $GOPATH/src/github.com/harmony-one/harmony
COPY . .
# Выполняем команду pwd для вывода текущего каталога
RUN echo "Current directory:" && pwd

# Проверяем содержимое каталога
RUN echo "Listing directory contents:" && ls -la

RUN go mod tidy
#RUN go get github.com/pborman/uuid > /dev/null 2>1
#RUN go get github.com/rjeczalik/notify > /dev/null 2>1
#RUN go get github.com/cespare/cp > /dev/null 2>1
#RUN go get github.com/libp2p/go-libp2p-crypto > /dev/null 2>1
#RUN go get github.com/kr/pretty > /dev/null 2>1
#RUN go get github.com/kr/text > /dev/null 2>1
#RUN go get gopkg.in/check.v1 > /dev/null 2>1
RUN bash scripts/install_build_tools.sh > /dev/null 2>1
RUN make > /dev/null 2>1
#RUN rm -rf harmony

# Install testing tools
RUN curl -L -o /go/bin/hmy https://harmony.one/hmycli > /dev/null 2>1 && chmod +x /go/bin/hmy > /dev/null 2>1

WORKDIR $GOPATH/src/github.com/coinbase

RUN git clone https://github.com/coinbase/rosetta-cli.git > /dev/null 2>1
RUN cd rosetta-cli && make install > /dev/null 2>1

WORKDIR $GOPATH/src/github.com/harmony-one/harmony/tests

#COPY scripts scripts
#COPY rpc_tests rpc_tests
#COPY configs configs
#COPY requirements.txt requirements.txt

WORKDIR $GOPATH/src/github.com/harmony-one/harmony

# Since we are running as root in Docker, `--break-system-packages` is required
RUN python3 -m pip install -r tests/requirements.txt --break-system-packages
RUN chmod +x tests/scripts/run.sh


ENTRYPOINT ["/go/src/github.com/harmony-one/harmony/tests/scripts/run.sh"]
2 changes: 1 addition & 1 deletion api/proto/message/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package message
package harmonymessage

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion api/proto/message/gen.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker run --platform linux/amd64 -v ${PWD}:/tmp ${PROTOC_IMAGE} /tmp/message.proto
docker run --platform linux/amd64 -v ${PWD}:/tmp ${PROTOC_IMAGE} /tmp/harmonymessage.proto
Loading

0 comments on commit 24b4da8

Please sign in to comment.