Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go 1.21. Moved functional tests into repo. #4701

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ os: linux
dist: jammy
language: go
go:
- 1.19.5
- 1.21.11
go_import_path: github.com/harmony-one/harmony
cache:
directories:
Expand All @@ -26,7 +26,6 @@ install:
- echo $TRAVIS_PULL_REQUEST_BRANCH
- git clone https://github.com/harmony-one/mcl.git $GOPATH/src/github.com/harmony-one/mcl
- git clone https://github.com/harmony-one/bls.git $GOPATH/src/github.com/harmony-one/bls
- git clone https://github.com/harmony-one/harmony-test.git $GOPATH/src/github.com/harmony-one/harmony-test
- (cd $GOPATH/src/github.com/harmony-one/mcl; make -j4)
- (cd $GOPATH/src/github.com/harmony-one/bls; make BLS_SWAP_G=1 -j4)
# - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ trace-pointer:

debug:
rm -rf .dht-127.0.0.1*
# uncomment the following lines to enable debug logging for libp2p, it produces a lot of logs, so disabled by default
#export GOLOG_LOG_LEVEL=debug
#export GOLOG_OUTPUT=stdout
bash ./test/debug.sh

debug-kill:
Expand Down Expand Up @@ -183,3 +186,6 @@ debug_external: clean

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

protofiles:
bash ./scripts/gogenerate.sh
70 changes: 70 additions & 0 deletions Tests.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
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

# 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

RUN git clone https://github.com/coinbase/rosetta-cli.git > /dev/null 2>1
RUN cd rosetta-cli && make install > /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
#RUN rm -rf harmony


WORKDIR $GOPATH/src/github.com/coinbase


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