Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit edea1da

Browse files
committedOct 2, 2023
Merge branch 'main' into extauthprovider
2 parents c1c4786 + 9e1e365 commit edea1da

File tree

70 files changed

+3174
-3894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3174
-3894
lines changed
 

‎cli/exp_scaletest_test.go

Lines changed: 71 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,78 @@ func TestScaleTestWorkspaceTraffic(t *testing.T) {
9292
// This test just validates that the CLI command accepts its known arguments.
9393
func TestScaleTestDashboard(t *testing.T) {
9494
t.Parallel()
95-
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium)
96-
defer cancelFunc()
97-
98-
log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
99-
client := coderdtest.New(t, &coderdtest.Options{
100-
Logger: &log,
95+
t.Run("MinWait", func(t *testing.T) {
96+
t.Parallel()
97+
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitShort)
98+
defer cancelFunc()
99+
100+
log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
101+
client := coderdtest.New(t, &coderdtest.Options{
102+
Logger: &log,
103+
})
104+
_ = coderdtest.CreateFirstUser(t, client)
105+
106+
inv, root := clitest.New(t, "exp", "scaletest", "dashboard",
107+
"--interval", "0s",
108+
)
109+
clitest.SetupConfig(t, client, root)
110+
pty := ptytest.New(t)
111+
inv.Stdout = pty.Output()
112+
inv.Stderr = pty.Output()
113+
114+
err := inv.WithContext(ctx).Run()
115+
require.ErrorContains(t, err, "--interval must be greater than zero")
101116
})
102-
_ = coderdtest.CreateFirstUser(t, client)
103117

104-
inv, root := clitest.New(t, "exp", "scaletest", "dashboard",
105-
"--count", "1",
106-
"--min-wait", "100ms",
107-
"--max-wait", "1s",
108-
"--timeout", "5s",
109-
"--scaletest-prometheus-address", "127.0.0.1:0",
110-
"--scaletest-prometheus-wait", "0s",
111-
)
112-
clitest.SetupConfig(t, client, root)
113-
pty := ptytest.New(t)
114-
inv.Stdout = pty.Output()
115-
inv.Stderr = pty.Output()
118+
t.Run("MaxWait", func(t *testing.T) {
119+
t.Parallel()
120+
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitShort)
121+
defer cancelFunc()
122+
123+
log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
124+
client := coderdtest.New(t, &coderdtest.Options{
125+
Logger: &log,
126+
})
127+
_ = coderdtest.CreateFirstUser(t, client)
128+
129+
inv, root := clitest.New(t, "exp", "scaletest", "dashboard",
130+
"--interval", "1s",
131+
"--jitter", "1s",
132+
)
133+
clitest.SetupConfig(t, client, root)
134+
pty := ptytest.New(t)
135+
inv.Stdout = pty.Output()
136+
inv.Stderr = pty.Output()
137+
138+
err := inv.WithContext(ctx).Run()
139+
require.ErrorContains(t, err, "--jitter must be less than --interval")
140+
})
116141

117-
err := inv.WithContext(ctx).Run()
118-
require.NoError(t, err, "")
142+
t.Run("OK", func(t *testing.T) {
143+
t.Parallel()
144+
ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium)
145+
defer cancelFunc()
146+
147+
log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
148+
client := coderdtest.New(t, &coderdtest.Options{
149+
Logger: &log,
150+
})
151+
_ = coderdtest.CreateFirstUser(t, client)
152+
153+
inv, root := clitest.New(t, "exp", "scaletest", "dashboard",
154+
"--interval", "1s",
155+
"--jitter", "500ms",
156+
"--timeout", "5s",
157+
"--scaletest-prometheus-address", "127.0.0.1:0",
158+
"--scaletest-prometheus-wait", "0s",
159+
"--rand-seed", "1234567890",
160+
)
161+
clitest.SetupConfig(t, client, root)
162+
pty := ptytest.New(t)
163+
inv.Stdout = pty.Output()
164+
inv.Stderr = pty.Output()
165+
166+
err := inv.WithContext(ctx).Run()
167+
require.NoError(t, err, "")
168+
})
119169
}

‎go.mod

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ require (
141141
github.com/mitchellh/mapstructure v1.5.0
142142
github.com/moby/moby v24.0.1+incompatible
143143
github.com/muesli/termenv v0.15.2
144-
github.com/open-policy-agent/opa v0.56.0
144+
github.com/open-policy-agent/opa v0.57.0
145145
github.com/ory/dockertest/v3 v3.10.0
146146
github.com/pion/udp v0.1.2
147147
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
@@ -154,7 +154,7 @@ require (
154154
github.com/robfig/cron/v3 v3.0.1
155155
github.com/spf13/afero v1.10.0
156156
github.com/spf13/pflag v1.0.5
157-
github.com/sqlc-dev/pqtype v0.2.0
157+
github.com/sqlc-dev/pqtype v0.3.0
158158
github.com/stretchr/testify v1.8.4
159159
github.com/swaggo/http-swagger/v2 v2.0.1
160160
github.com/swaggo/swag v1.16.2
@@ -164,11 +164,11 @@ require (
164164
github.com/wagslane/go-password-validator v0.3.0
165165
go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1
166166
go.nhat.io/otelsql v0.12.0
167-
go.opentelemetry.io/otel v1.18.0
168-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.18.0
169-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.18.0
170-
go.opentelemetry.io/otel/sdk v1.18.0
171-
go.opentelemetry.io/otel/trace v1.18.0
167+
go.opentelemetry.io/otel v1.19.0
168+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0
169+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
170+
go.opentelemetry.io/otel/sdk v1.19.0
171+
go.opentelemetry.io/otel/trace v1.19.0
172172
go.uber.org/atomic v1.11.0
173173
go.uber.org/goleak v1.2.1
174174
go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516
@@ -184,8 +184,8 @@ require (
184184
golang.org/x/tools v0.13.0
185185
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
186186
golang.zx2c4.com/wireguard v0.0.0-20230704135630-469159ecf7d1
187-
google.golang.org/api v0.142.0
188-
google.golang.org/grpc v1.58.1
187+
google.golang.org/api v0.143.0
188+
google.golang.org/grpc v1.58.2
189189
google.golang.org/protobuf v1.31.0
190190
gopkg.in/DataDog/dd-trace-go.v1 v1.55.0
191191
gopkg.in/natefinch/lumberjack.v2 v2.2.1
@@ -196,6 +196,11 @@ require (
196196
tailscale.com v1.46.1
197197
)
198198

199+
require (
200+
github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89
201+
github.com/chromedp/chromedp v0.9.2
202+
)
203+
199204
require (
200205
cloud.google.com/go/compute v1.23.0 // indirect
201206
cloud.google.com/go/logging v1.8.1 // indirect
@@ -244,9 +249,10 @@ require (
244249
github.com/bep/godartsass/v2 v2.0.0 // indirect
245250
github.com/bep/golibsass v1.1.1 // indirect
246251
github.com/cespare/xxhash/v2 v2.2.0 // indirect
252+
github.com/chromedp/sysutil v1.0.0 // indirect
247253
github.com/clbanning/mxj/v2 v2.7.0 // indirect
248254
github.com/cloudflare/circl v1.3.3 // indirect
249-
github.com/containerd/continuity v0.4.2-0.20230616210509-1e0d26eb2381 // indirect
255+
github.com/containerd/continuity v0.4.2 // indirect
250256
github.com/coreos/go-iptables v0.6.0 // indirect
251257
github.com/dlclark/regexp2 v1.10.0 // indirect
252258
github.com/docker/cli v23.0.5+incompatible // indirect
@@ -273,6 +279,9 @@ require (
273279
github.com/go-test/deep v1.0.8 // indirect
274280
github.com/go-toast/toast v0.0.0-20190211030409-01e6764cf0a4 // indirect
275281
github.com/gobwas/glob v0.2.3 // indirect
282+
github.com/gobwas/httphead v0.1.0 // indirect
283+
github.com/gobwas/pool v0.2.1 // indirect
284+
github.com/gobwas/ws v1.2.1 // indirect
276285
github.com/godbus/dbus/v5 v5.1.0 // indirect
277286
github.com/gogo/protobuf v1.3.2 // indirect
278287
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -284,7 +293,7 @@ require (
284293
github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect
285294
github.com/google/s2a-go v0.1.7 // indirect
286295
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
287-
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
296+
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
288297
github.com/gorilla/css v1.0.0 // indirect
289298
github.com/gorilla/mux v1.8.0 // indirect
290299
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
@@ -386,7 +395,7 @@ require (
386395
github.com/zeebo/errs v1.3.0 // indirect
387396
go.opencensus.io v0.24.0 // indirect
388397
go.opentelemetry.io/contrib v1.19.0 // indirect
389-
go.opentelemetry.io/otel/metric v1.18.0 // indirect
398+
go.opentelemetry.io/otel/metric v1.19.0 // indirect
390399
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
391400
go4.org/intern v0.0.0-20230525184215-6c62f75575cb // indirect
392401
go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect
@@ -396,9 +405,9 @@ require (
396405
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 // indirect
397406
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
398407
google.golang.org/appengine v1.6.7 // indirect
399-
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
400-
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
401-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
408+
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
409+
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
410+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
402411
gopkg.in/yaml.v2 v2.4.0 // indirect
403412
howett.net/plist v1.0.0 // indirect
404413
inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a // indirect
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.