Skip to content

Commit

Permalink
feat: Skip e2e monitoringStack test for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
khalifaa55 committed Sep 13, 2024
1 parent 200474c commit ccc6e6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 61 deletions.
62 changes: 3 additions & 59 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ccc6e6f

Please sign in to comment.