Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: bump github.com/stretchr/testify from 1.10.0 to 1.11.1#19599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletionscoderd/metricscache/metricscache_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -261,20 +261,19 @@ func TestCache_BuildTime(t *testing.T) {
wantTransition := codersdk.WorkspaceTransition(tt.args.transition)
require.Eventuallyf(t, func() bool {
stats := cache.TemplateBuildTimeStats(template.ID)
return stats[wantTransition] != codersdk.TransitionStats{}
ts := stats[wantTransition]
return ts.P50 != nil && *ts.P50 == tt.want.buildTimeMs
}, testutil.WaitLong, testutil.IntervalMedium,
"BuildTime neverpopulated",
"P50 neverreached expected value for %v", wantTransition,
)

gotStats = cache.TemplateBuildTimeStats(template.ID)
for transition,stats := range gotStats {
gotStats:= cache.TemplateBuildTimeStats(template.ID)
for transition,ts := range gotStats {
if transition == wantTransition {
require.Equal(t, tt.want.buildTimeMs, *stats.P50)
} else {
require.Empty(
t, stats, "%v", transition,
)
// Checked above
continue
}
require.Empty(t, ts, "%v", transition)
}
} else {
var stats codersdk.TemplateBuildTimeStats
Expand Down
16 changes: 10 additions & 6 deletionscoderd/prometheusmetrics/aggregator_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -194,15 +194,19 @@ func verifyCollectedMetrics(t *testing.T, expected []*agentproto.Stats_Metric, a

var d dto.Metric
err := actual[i].Write(&d)
require.NoError(t, err)
assert.NoError(t, err)

switch e.Type {
case agentproto.Stats_Metric_COUNTER:
require.Equal(t, e.Value, d.Counter.GetValue())
if e.Value != d.Counter.GetValue() {
return false
}
case agentproto.Stats_Metric_GAUGE:
require.Equal(t, e.Value, d.Gauge.GetValue())
if e.Value != d.Gauge.GetValue() {
return false
}
default:
require.Failf(t, "unsupported type: %s", string(e.Type))
assert.Failf(t, "unsupported type: %s", string(e.Type))
}

expectedLabels := make([]*agentproto.Stats_Metric_Label, len(e.Labels))
Expand All@@ -215,7 +219,7 @@ func verifyCollectedMetrics(t *testing.T, expected []*agentproto.Stats_Metric, a
}
sort.Slice(expectedLabels, sortFn)
sort.Slice(dtoLabels, sortFn)
require.Equal(t, expectedLabels, dtoLabels, d.String())
assert.Equal(t, expectedLabels, dtoLabels, d.String())
}
return true
}
Expand All@@ -229,7 +233,7 @@ func prometheusMetricToString(t *testing.T, m prometheus.Metric) string {

var d dto.Metric
err := m.Write(&d)
require.NoError(t, err)
assert.NoError(t, err)
dtoLabels := asMetricAgentLabels(d.GetLabel())
sort.Slice(dtoLabels, func(i, j int) bool {
return dtoLabels[i].Name < dtoLabels[j].Name
Expand Down
2 changes: 1 addition & 1 deletiongo.mod
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -175,7 +175,7 @@ require (
github.com/spf13/afero v1.14.0
github.com/spf13/pflag v1.0.6
github.com/sqlc-dev/pqtype v0.3.0
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
github.com/swaggo/http-swagger/v2 v2.0.1
github.com/swaggo/swag v1.16.2
github.com/tidwall/gjson v1.18.0
Expand Down
4 changes: 2 additions & 2 deletionsgo.sum
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1765,8 +1765,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/swaggest/assertjson v1.9.0 h1:dKu0BfJkIxv/xe//mkCrK5yZbs79jL7OVf9Ija7o2xQ=
github.com/swaggest/assertjson v1.9.0/go.mod h1:b+ZKX2VRiUjxfUIal0HDN85W0nHPAYUbYH5WkkSsFsU=
github.com/swaggo/files/v2 v2.0.0 h1:hmAt8Dkynw7Ssz46F6pn8ok6YmGZqHSVLZ+HQM7i0kw=
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp