From 9eb8ef9b13641ee57442efd6ce3eeb1eef567765 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Fri, 13 Dec 2024 11:48:51 +0100 Subject: [PATCH 1/5] Improve e2e test Makefile targets --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 190a9e9..f210b32 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,16 @@ test-all: test test: $(MAKE) -C demo test $(MAKE) -C x test - $(MAKE) -C tests/e2e/ test -test-e2e: +test-e2e: build-docker-e2e test-e2e-cache + +test-e2e-cache: $(MAKE) -C tests/e2e/ test + $(MAKE) test-e2e-bcd-consumer-integration + +clean-e2e: + docker container rm -f $(shell docker container ls -a -q) || true + docker network prune -f || true ############################################################################### ### Linting ### @@ -83,6 +89,8 @@ proto-lint: ### Integration e2e ### ############################################################################### +build-docker-e2e: build-ibcsim-bcd build-babylond + build-ibcsim-bcd: $(MAKE) -C contrib/images ibcsim-bcd @@ -95,4 +103,4 @@ start-bcd-consumer-integration: test-e2e-bcd-consumer-integration: start-bcd-consumer-integration @cd tests/e2e @go test -run TestBCDConsumerIntegrationTestSuite -mod=readonly -timeout=60m -v github.com/babylonlabs-io/babylon-sdk/tests/e2e --tags=e2e - @cd - + @cd - From 5d6fbf149c6b4f0faf7e97d6b9bb04d358a00f13 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Fri, 13 Dec 2024 11:50:02 +0100 Subject: [PATCH 2/5] Use e2e test target in CI --- .github/workflows/integration-e2e.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/integration-e2e.yml b/.github/workflows/integration-e2e.yml index cb0e1de..979fa69 100644 --- a/.github/workflows/integration-e2e.yml +++ b/.github/workflows/integration-e2e.yml @@ -10,17 +10,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - - name: Build IBC Simulator BCD Image - run: make build-ibcsim-bcd - - - name: Build Babylond Image - run: make build-babylond - - name: Cache Go uses: actions/setup-go@v5 with: go-version: 1.23 - - name: Run Integration Tests - run: sudo make test-e2e-bcd-consumer-integration + run: sudo make test-e2e From c13b6bc59317b5efd1a76507f86b1f7b3ccdd085 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Fri, 13 Dec 2024 12:20:57 +0100 Subject: [PATCH 3/5] Fix: e2e test repeteability / working dir --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f210b32..fb4368e 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,4 @@ start-bcd-consumer-integration: $(MAKE) -C contrib/images start-bcd-consumer-integration test-e2e-bcd-consumer-integration: start-bcd-consumer-integration - @cd tests/e2e - @go test -run TestBCDConsumerIntegrationTestSuite -mod=readonly -timeout=60m -v github.com/babylonlabs-io/babylon-sdk/tests/e2e --tags=e2e - @cd - + @cd tests/e2e && go test -run TestBCDConsumerIntegrationTestSuite -mod=readonly -timeout=60m -v github.com/babylonlabs-io/babylon-sdk/tests/e2e --tags=e2e From 43b94d4b87a31354aacf952c6abe0fe2d3824b26 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Fri, 13 Dec 2024 12:58:21 +0100 Subject: [PATCH 4/5] Disable duplicated e2e test call --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccd09ae..07a84ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.11.2 with: run-unit-tests: true - run-integration-tests: true + run-integration-tests: false integration-tests-command: | make test-e2e @@ -21,4 +21,4 @@ jobs: with: publish: false dockerfile: ./contrib/images/local-bcd/Dockerfile - repoName: babylon-sdk \ No newline at end of file + repoName: babylon-sdk From c9f03906bd8d0338b47e47bda6f2699853062c12 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Sat, 14 Dec 2024 10:36:39 +0100 Subject: [PATCH 5/5] Differentiate between basic e2e tests (integration) and e2e tests --- .github/workflows/ci.yml | 4 ++-- .github/workflows/{integration-e2e.yml => e2e.yml} | 4 ++-- .github/workflows/publish.yml | 4 ++-- Makefile | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) rename .github/workflows/{integration-e2e.yml => e2e.yml} (82%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07a84ee..e41db95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ jobs: uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.11.2 with: run-unit-tests: true - run-integration-tests: false + run-integration-tests: true integration-tests-command: | - make test-e2e + make test-integration docker_pipeline: uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.11.2 diff --git a/.github/workflows/integration-e2e.yml b/.github/workflows/e2e.yml similarity index 82% rename from .github/workflows/integration-e2e.yml rename to .github/workflows/e2e.yml index 979fa69..ee4ae93 100644 --- a/.github/workflows/integration-e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,4 +1,4 @@ -name: integration-e2e +name: e2e on: push: branches: @@ -14,5 +14,5 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.23 - - name: Run Integration Tests + - name: Run E2E Tests run: sudo make test-e2e diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 528788f..53d6d03 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,7 @@ jobs: run-unit-tests: true run-integration-tests: true integration-tests-command: | - make test-e2e + make test-integration docker_pipeline: uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.11.2 @@ -24,4 +24,4 @@ jobs: with: publish: true dockerfile: ./contrib/images/local-bcd/Dockerfile - repoName: babylon-sdk \ No newline at end of file + repoName: babylon-sdk diff --git a/Makefile b/Makefile index fb4368e..0753939 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,12 @@ test: $(MAKE) -C demo test $(MAKE) -C x test +test-integration: + $(MAKE) -C tests/e2e/ test + test-e2e: build-docker-e2e test-e2e-cache test-e2e-cache: - $(MAKE) -C tests/e2e/ test $(MAKE) test-e2e-bcd-consumer-integration clean-e2e: