(t *testing.T)
| 41 | var onlyAutobahnCases = []string{} |
| 42 | |
| 43 | func TestAutobahn(t *testing.T) { |
| 44 | t.Parallel() |
| 45 | |
| 46 | if os.Getenv("AUTOBAHN") == "" { |
| 47 | t.SkipNow() |
| 48 | } |
| 49 | |
| 50 | if os.Getenv("AUTOBAHN") == "fast" { |
| 51 | // These are the slow tests. |
| 52 | excludedAutobahnCases = append(excludedAutobahnCases, |
| 53 | "9.*", "12.*", "13.*", |
| 54 | ) |
| 55 | } |
| 56 | |
| 57 | if len(onlyAutobahnCases) > 0 { |
| 58 | excludedAutobahnCases = []string{} |
| 59 | autobahnCases = onlyAutobahnCases |
| 60 | } |
| 61 | |
| 62 | ctx, cancel := context.WithTimeout(context.Background(), time.Hour) |
| 63 | defer cancel() |
| 64 | |
| 65 | wstestURL, closeFn, err := wstestServer(t, ctx) |
| 66 | assert.Success(t, err) |
| 67 | defer func() { |
| 68 | assert.Success(t, closeFn()) |
| 69 | }() |
| 70 | |
| 71 | err = waitWS(ctx, wstestURL) |
| 72 | assert.Success(t, err) |
| 73 | |
| 74 | cases, err := wstestCaseCount(ctx, wstestURL) |
| 75 | assert.Success(t, err) |
| 76 | |
| 77 | t.Run("cases", func(t *testing.T) { |
| 78 | for i := 1; i <= cases; i++ { |
| 79 | i := i |
| 80 | t.Run("", func(t *testing.T) { |
| 81 | ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5) |
| 82 | defer cancel() |
| 83 | |
| 84 | c, _, err := websocket.Dial(ctx, fmt.Sprintf(wstestURL+"/runCase?case=%v&agent=main", i), &websocket.DialOptions{ |
| 85 | CompressionMode: websocket.CompressionContextTakeover, |
| 86 | }) |
| 87 | assert.Success(t, err) |
| 88 | err = wstest.EchoLoop(ctx, c) |
| 89 | t.Logf("echoLoop: %v", err) |
| 90 | }) |
| 91 | } |
| 92 | }) |
| 93 | |
| 94 | c, _, err := websocket.Dial(ctx, wstestURL+"/updateReports?agent=main", nil) |
| 95 | assert.Success(t, err) |
| 96 | c.Close(websocket.StatusNormalClosure, "") |
| 97 | |
| 98 | checkWSTestIndex(t, "./ci/out/autobahn-report/index.json") |
| 99 | } |
| 100 |
nothing calls this directly
no test coverage detected
searching dependent graphs…