From 519812776e2879ec1e3f14227c9cfba4a09bdba9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 03:12:37 +0000 Subject: [PATCH] chore: bump github.com/stretchr/testify from 1.10.0 to 1.11.1 (#19599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.10.0 to 1.11.1.
Release notes

Sourced from github.com/stretchr/testify's releases.

v1.11.1

This release fixes #1785 introduced in v1.11.0 where expected argument values implementing the stringer interface (String() string) with a method which mutates their value, when passed to mock.Mock.On (m.On("Method", <expected>).Return()) or actual argument values passed to mock.Mock.Called may no longer match one another where they previously did match. The behaviour prior to v1.11.0 where the stringer is always called is restored. Future testify releases may not call the stringer method at all in this case.

What's Changed

Full Changelog: https://github.com/stretchr/testify/compare/v1.11.0...v1.11.1

v1.11.0

What's Changed

Functional Changes

v1.11.0 Includes a number of performance improvements.

Fixes

Documentation, Build & CI

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/stretchr/testify&package-manager=go_modules&previous-version=1.10.0&new-version=1.11.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ethan Dickson --- coderd/metricscache/metricscache_test.go | 17 ++++++++--------- coderd/prometheusmetrics/aggregator_test.go | 16 ++++++++++------ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/coderd/metricscache/metricscache_test.go b/coderd/metricscache/metricscache_test.go index 4582187a33..a704c5dda2 100644 --- a/coderd/metricscache/metricscache_test.go +++ b/coderd/metricscache/metricscache_test.go @@ -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 never populated", + "P50 never reached 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 diff --git a/coderd/prometheusmetrics/aggregator_test.go b/coderd/prometheusmetrics/aggregator_test.go index 6cbe5514b1..f3441eccdd 100644 --- a/coderd/prometheusmetrics/aggregator_test.go +++ b/coderd/prometheusmetrics/aggregator_test.go @@ -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)) @@ -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 } @@ -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 diff --git a/go.mod b/go.mod index 712ec18a26..1417a8c4dd 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 0104e725d8..773465e97a 100644 --- a/go.sum +++ b/go.sum @@ -1769,8 +1769,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=