( t *testing.T, clientURL *url.URL, replicas []codersdk.Replica, )
| 909 | } |
| 910 | |
| 911 | func replicaIDForClientURL( |
| 912 | t *testing.T, |
| 913 | clientURL *url.URL, |
| 914 | replicas []codersdk.Replica, |
| 915 | ) uuid.UUID { |
| 916 | t.Helper() |
| 917 | |
| 918 | for _, replica := range replicas { |
| 919 | relayURL, err := url.Parse(replica.RelayAddress) |
| 920 | require.NoErrorf( |
| 921 | t, |
| 922 | err, |
| 923 | "parse replica relay address %q", |
| 924 | replica.RelayAddress, |
| 925 | ) |
| 926 | if relayURL.Host == clientURL.Host { |
| 927 | return replica.ID |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | require.FailNowf( |
| 932 | t, |
| 933 | "missing replica for client URL", |
| 934 | "client host %q not present in replica list", |
| 935 | clientURL.Host, |
| 936 | ) |
| 937 | return uuid.Nil |
| 938 | } |
| 939 | |
| 940 | func TestChatModelConfigDefault(t *testing.T) { |
| 941 | t.Parallel() |
no test coverage detected