Skip to content

Commit 9e4336d

Browse files
committed
fix: remove unnecessary test case
1 parent 6078455 commit 9e4336d

File tree

1 file changed

+0
-66
lines changed

1 file changed

+0
-66
lines changed

enterprise/coderd/aibridge_test.go

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package coderd_test
22

33
import (
44
"database/sql"
5-
"io"
65
"net/http"
76
"testing"
87
"time"
@@ -639,71 +638,6 @@ func TestAIBridgeListInterceptions(t *testing.T) {
639638
})
640639
}
641640

642-
func TestAIBridgeRouting(t *testing.T) {
643-
t.Parallel()
644-
645-
dv := coderdtest.DeploymentValues(t)
646-
client, closer, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
647-
Options: &coderdtest.Options{
648-
DeploymentValues: dv,
649-
},
650-
LicenseOptions: &coderdenttest.LicenseOptions{
651-
Features: license.Features{
652-
codersdk.FeatureAIBridge: 1,
653-
},
654-
},
655-
})
656-
t.Cleanup(func() {
657-
_ = closer.Close()
658-
})
659-
660-
// Register a simple test handler that echoes back the request path.
661-
testHandler := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
662-
rw.WriteHeader(http.StatusOK)
663-
_, _ = rw.Write([]byte(r.URL.Path))
664-
})
665-
api.RegisterInMemoryAIBridgedHTTPHandler(testHandler)
666-
667-
cases := []struct {
668-
name string
669-
path string
670-
expectedPath string
671-
}{
672-
{
673-
name: "StablePrefix",
674-
path: "/api/v2/aibridge/openai/v1/chat/completions",
675-
expectedPath: "/openai/v1/chat/completions",
676-
},
677-
{
678-
name: "ExperimentalPrefix",
679-
path: "/api/experimental/aibridge/openai/v1/chat/completions",
680-
expectedPath: "/openai/v1/chat/completions",
681-
},
682-
}
683-
684-
for _, tc := range cases {
685-
t.Run(tc.name, func(t *testing.T) {
686-
t.Parallel()
687-
688-
ctx := testutil.Context(t, testutil.WaitLong)
689-
req, err := http.NewRequestWithContext(ctx, http.MethodPost, client.URL.String()+tc.path, nil)
690-
require.NoError(t, err)
691-
req.Header.Set(codersdk.SessionTokenHeader, client.SessionToken())
692-
693-
httpClient := &http.Client{}
694-
resp, err := httpClient.Do(req)
695-
require.NoError(t, err)
696-
defer resp.Body.Close()
697-
require.Equal(t, http.StatusOK, resp.StatusCode)
698-
699-
// Verify that the prefix was stripped correctly and the path was forwarded.
700-
body, err := io.ReadAll(resp.Body)
701-
require.NoError(t, err)
702-
require.Equal(t, tc.expectedPath, string(body))
703-
})
704-
}
705-
}
706-
707641
func TestAIBridgeRateLimiting(t *testing.T) {
708642
t.Parallel()
709643

0 commit comments

Comments
 (0)