From fe356a1ddcf2aead7996c46d44427adf33869d49 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:26:38 +0200 Subject: [PATCH] build: e2e tests fail due to lack of docker-compose command (#860) * build(e2e): docker-compose missing in e2e tests * fix: fmt * build: fix quoting of tags --- Makefile | 10 +++++----- docs/tools/docker-compose.md | 2 +- spec/ivy-proofs/README.md | 4 ++-- test/e2e/pkg/infra/docker/exec.go | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index e1e035cb02..0580470ea7 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ build-binary: .PHONY: build-binary install: - $(GO) install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tenderdash + $(GO) install $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' ./cmd/tenderdash .PHONY: install $(BUILDDIR)/: @@ -239,7 +239,7 @@ generate_test_cert: # dist builds binaries for all platforms and packages them for distribution # TODO add abci to these scripts dist: - @BUILD_TAGS=$(BUILD_TAGS) sh -c "'$(CURDIR)/scripts/dist.sh'" + @BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'" .PHONY: dist go-mod-cache: go.sum @@ -260,7 +260,7 @@ draw_deps: get_deps_bin_size: @# Copy of build recipe with additional flags to perform binary size analysis - $(eval $(shell go build -work -a $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(BUILDDIR)/ ./cmd/tendermint/ 2>&1)) + $(eval $(shell go build -work -a $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' -o $(BUILDDIR)/ ./cmd/tendermint/ 2>&1)) @find $(WORK) -type f -name "*.a" | xargs -I{} du -hxs "{}" | sort -rh | sed -e s:${WORK}/::g > deps_bin_size.log @echo "Results can be found here: $(CURDIR)/deps_bin_size.log" .PHONY: get_deps_bin_size @@ -383,12 +383,12 @@ build_c-amazonlinux: # Run a 4-node testnet locally localnet-start: localnet-stop build-docker-localnode @if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z dashpay/tenderdash testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.167.10.2; fi - docker-compose up + docker compose up .PHONY: localnet-start # Stop testnet localnet-stop: - docker-compose down + docker compose down .PHONY: localnet-stop # Build hooks for dredd, to skip or add information on some steps diff --git a/docs/tools/docker-compose.md b/docs/tools/docker-compose.md index 3f174f9c87..2d392764fd 100644 --- a/docs/tools/docker-compose.md +++ b/docs/tools/docker-compose.md @@ -69,7 +69,7 @@ To change the number of validators / non-validators change the `localnet-start` ```makefile localnet-start: localnet-stop @if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z dashpay/tenderdash:localnode testnet --v 5 --n 3 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi - docker-compose up + docker compose up ``` The command now will generate config files for 5 validators and 3 diff --git a/spec/ivy-proofs/README.md b/spec/ivy-proofs/README.md index 00a4bed259..9b0f16e73e 100644 --- a/spec/ivy-proofs/README.md +++ b/spec/ivy-proofs/README.md @@ -27,7 +27,7 @@ The license above applies to all files in this folder. The easiest way to check the proofs is to use [Docker](https://www.docker.com/). 1. Install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/). -2. Build a Docker image: `docker-compose build` -3. Run the proofs inside the Docker container: `docker-compose run +2. Build a Docker image: `docker compose build` +3. Run the proofs inside the Docker container: `docker compose run tendermint-proof`. This will check all the proofs with the `ivy_check` command and write the output of `ivy_check` to a subdirectory of `./output/' diff --git a/test/e2e/pkg/infra/docker/exec.go b/test/e2e/pkg/infra/docker/exec.go index 361c46308d..e656c36fa2 100644 --- a/test/e2e/pkg/infra/docker/exec.go +++ b/test/e2e/pkg/infra/docker/exec.go @@ -10,14 +10,14 @@ import ( // execCompose runs a Docker Compose command for a testnet. func execCompose(ctx context.Context, dir string, args ...string) error { return exec.Command(ctx, append( - []string{"docker-compose", "--ansi=never", "-f", filepath.Join(dir, "docker-compose.yml")}, + []string{"docker", "compose", "--ansi=never", "-f", filepath.Join(dir, "docker-compose.yml")}, args...)...) } // execComposeVerbose runs a Docker Compose command for a testnet and displays its output. func execComposeVerbose(ctx context.Context, dir string, args ...string) error { return exec.CommandVerbose(ctx, append( - []string{"docker-compose", "--ansi=never", "-f", filepath.Join(dir, "docker-compose.yml")}, + []string{"docker", "compose", "--ansi=never", "-f", filepath.Join(dir, "docker-compose.yml")}, args...)...) }