From ccc6e6f967ea7565990c5f1040282b84ccddac94 Mon Sep 17 00:00:00 2001 From: Haneen Khalifa Date: Fri, 13 Sep 2024 15:23:52 +0300 Subject: [PATCH] feat: Skip e2e monitoringStack test for Windows --- .github/workflows/e2e_tests.yml | 62 ++------------------------------- Makefile | 7 ++-- 2 files changed, 8 insertions(+), 61 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 8a66154ec..a844be9a7 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -27,69 +27,13 @@ jobs: with: go-version: ${{ matrix.go }} - - name: Setup WSL - if: runner.os == 'Windows' - uses: Vampire/setup-wsl@v3 - with: - distribution: Ubuntu-22.04 - update: true - additional-packages: docker - - name: Install deps run: make install-deps - - - name: Setup Docker in WSL - if: runner.os == 'Windows' - shell: wsl-bash {0} - run: | - # Update package list - sudo apt-get update - - # Install Docker and make - sudo apt-get install -y docker.io make - - # Set iptables to legacy mode - sudo update-alternatives --set iptables /usr/sbin/iptables-legacy - - # Start Docker daemon manually - sudo dockerd & - - # Wait for Docker to start - for i in {1..10}; do - if docker info > /dev/null 2>&1; then - echo "Docker is ready!" - break - fi - echo "Waiting for Docker to start..." - sleep 3 - done - - # Verify Docker installation - docker version - docker info - - name: Install Go in WSL + - name: Run e2e tests Windows if: runner.os == 'Windows' - shell: wsl-bash {0} - run: | - # Setup Go using actions/setup-go - curl -fsSL https://github.com/actions/setup-go/releases/latest/download/setup-go-linux-x64 -o setup-go - chmod +x ./setup-go - ./setup-go ${{ matrix.go }} - - # Verify Go installation - go version - - - name: Run e2e tests (Windows) - if: runner.os == 'Windows' - shell: wsl-bash {0} - run: | - # Install deps - make install-deps - - # Run e2e tests - make e2e-test + run: make e2e-test-windows - - name: Run e2e tests (Non-Windows) + - name: Run e2e tests other if: runner.os != 'Windows' run: make e2e-test diff --git a/Makefile b/Makefile index dd60e82be..c6d2b157f 100644 --- a/Makefile +++ b/Makefile @@ -37,13 +37,16 @@ test: generate ## run tests e2e-test: generate ## Run e2e tests @go test -timeout 20m -count=1 ./e2e/... +e2e-test-windows: generate ## Run e2e tests on Windows + @go test -timeout 20m -count=1 -skip TestE2E_MonitoringStack ./e2e/... + test-no-e2e: generate ## run tests excluding e2e @mkdir -p coverage - @go test -coverprofile=coverage/coverage.out -covermode=count ./... -skip "TestE2E|e2e" + @go test -coverprofile=coverage/coverage.out -covermode=count ./... -skip TestE2E codecov-test: generate ## unit tests with coverage using the courtney tool @mkdir -p coverage - @courtney/courtney -v -o coverage/coverage.out -t="-skip=TestE2E|e2e" ./... + @courtney/courtney -v -o coverage/coverage.out -t="-skip=TestE2E" ./... @go tool cover -html=coverage/coverage.out -o coverage/coverage.html install-gofumpt: ## install gofumpt