From f19fc29ffd551d5a5546bd3af73a13c2f1f0388a Mon Sep 17 00:00:00 2001 From: frozen <355847+Frozen@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:41:12 -0400 Subject: [PATCH 1/2] Add Docker support for Go tests with new Makefile target and Dockerfile --- Makefile | 3 +++ Test.Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Test.Dockerfile diff --git a/Makefile b/Makefile index e9df64cf00..8eb6235869 100644 --- a/Makefile +++ b/Makefile @@ -257,3 +257,6 @@ debug-delete-log: @echo "[WARN] - it needs sudo to remove folder created with loki docker image user" sudo rm -rf test/logs_aggregator/loki + +docker-go-test: + docker run --rm -it -v "$PWD":/go/src/github.com/harmony-one/harmony frozen621/harmony-test bash -c 'make go-test' \ No newline at end of file diff --git a/Test.Dockerfile b/Test.Dockerfile new file mode 100644 index 0000000000..377a38f3cb --- /dev/null +++ b/Test.Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.24 + +ARG ENV=dev + +RUN apt-get update && \ + apt-get install -y build-essential make git curl libgmp-dev libssl-dev gcc g++ && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /go/src/github.com/harmony-one + +RUN git clone https://github.com/harmony-one/mcl.git && \ + git clone https://github.com/harmony-one/bls.git + +RUN echo "Cloning branch: ${ENV}" && \ + git clone -b ${ENV} https://github.com/harmony-one/harmony.git && \ + cd harmony && \ + go mod tidy && \ + make deps || true + +WORKDIR /go/src/github.com/harmony-one/harmony + +RUN ls -la /app + +CMD ["make", "go-test"] \ No newline at end of file From 49ee607ffded7ee06237951a0417d9b91d30ba0c Mon Sep 17 00:00:00 2001 From: frozen <355847+Frozen@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:53:16 -0400 Subject: [PATCH 2/2] Refactor Dockerfile for Go tests: remove unnecessary commands and ensure proper dependency installation --- Test.Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Test.Dockerfile b/Test.Dockerfile index 377a38f3cb..ad0a974f3b 100644 --- a/Test.Dockerfile +++ b/Test.Dockerfile @@ -15,10 +15,8 @@ RUN echo "Cloning branch: ${ENV}" && \ git clone -b ${ENV} https://github.com/harmony-one/harmony.git && \ cd harmony && \ go mod tidy && \ - make deps || true + make deps WORKDIR /go/src/github.com/harmony-one/harmony -RUN ls -la /app - CMD ["make", "go-test"] \ No newline at end of file