From e2fb2be1ff59b6f971f3d5f1339c57205461eb66 Mon Sep 17 00:00:00 2001 From: encodeous Date: Sun, 8 Feb 2026 10:36:52 -0500 Subject: [PATCH] test(e2e): reduce flakiness by executing e2e in sequence --- .github/workflows/go-test.yml | 40 +++++++++++++++++++++++------------ e2e/connectivity_test.go | 5 ----- e2e/healthcheck_test.go | 10 --------- e2e/recovery_test.go | 11 +++------- 4 files changed, 30 insertions(+), 36 deletions(-) diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index a9dad23..26614ae 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -6,23 +6,37 @@ on: pull_request: branches: [ main ] +env: + GO_VERSION: '1.25.4' + jobs: - test: + unit_test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.25.4' - - - name: Install Dependencies - run: go install - - - name: Build - run: go build - - - name: Run all tests - run: go run gotest.tools/gotestsum@latest -- -tags=router_test,integration,e2e ./... - + go-version: ${{ env.GO_VERSION }} + - name: Run unit test + run: go run gotest.tools/gotestsum@latest -- -tags=router_test ./... + integration: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Run integration + run: go run gotest.tools/gotestsum@latest -- -tags=integration ./integration/... + e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + - name: Run e2e + run: go run gotest.tools/gotestsum@latest -- -tags=e2e ./e2e/... diff --git a/e2e/connectivity_test.go b/e2e/connectivity_test.go index b8711c3..f8aa355 100644 --- a/e2e/connectivity_test.go +++ b/e2e/connectivity_test.go @@ -10,11 +10,6 @@ import ( ) func TestConnectivity(t *testing.T) { - if testing.Short() { - t.Skip("skipping e2e test in short mode") - } - t.Parallel() - // Use a specific subnet for this test to avoid conflicts h := NewHarness(t) diff --git a/e2e/healthcheck_test.go b/e2e/healthcheck_test.go index 9763071..b21744c 100644 --- a/e2e/healthcheck_test.go +++ b/e2e/healthcheck_test.go @@ -15,11 +15,6 @@ import ( ) func TestHealthcheckPing(t *testing.T) { - if testing.Short() { - t.Skip("skipping e2e test in short mode") - } - t.Parallel() - // Use a specific subnet for this test to avoid conflicts h := NewHarness(t) @@ -132,11 +127,6 @@ func TestHealthcheckPing(t *testing.T) { } func TestHealthcheckHTTP(t *testing.T) { - if testing.Short() { - t.Skip("skipping e2e test in short mode") - } - t.Parallel() - h := NewHarness(t) // IPs diff --git a/e2e/recovery_test.go b/e2e/recovery_test.go index 4fb8661..0855bd3 100644 --- a/e2e/recovery_test.go +++ b/e2e/recovery_test.go @@ -12,19 +12,14 @@ import ( ) func TestRecoveryExample(t *testing.T) { - if testing.Short() { - t.Skip("skipping e2e test in short mode") - } - t.Parallel() - h := NewHarness(t) // Node names alice := "alice" bob := "bob" charlie := "charlie" -eve := "eve" -vps := "vps" + eve := "eve" + vps := "vps" nodeNames := []string{alice, bob, charlie, eve, vps} // Generate keys @@ -141,4 +136,4 @@ vps := "vps" if err != nil { t.Fatalf("Post-recovery ping failed: %v\nStdout: %s\nStderr: %s", err, stdout, stderr) } -} \ No newline at end of file +}