MCPcopy Create free account
hub / github.com/docker/secrets-engine / Test_bumpModule

Function Test_bumpModule

x/release/helper/release_test.go:88–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func Test_bumpModule(t *testing.T) {
89 t.Parallel()
90 t.Run("bump module with version metadata and dependencies", func(t *testing.T) {
91 repo := newMockRepoData()
92 m := &mockFS{}
93 assert.NoError(t, BumpModule(t.Context(), "x", Patch, repo["x"], m))
94 assert.ElementsMatch(t, m.tagsCreated, []string{"x/v0.0.4-do.not.use"})
95 assert.ElementsMatch(t, m.bumps, []bump{
96 {"runtime/go.mod", "x", "v0.0.4-do.not.use"},
97 {"client/go.mod", "x", "v0.0.4-do.not.use"},
98 {"plugin/go.mod", "x", "v0.0.4-do.not.use"},
99 })
100 assert.ElementsMatch(t, m.commits, []string{"chore: bump x/v0.0.4-do.not.use"})
101 original := newMockRepoData()
102 assert.Equal(t, original, repo, "no side effects in BumpModule")
103 })
104 t.Run("bump module without version metadata and no dependencies", func(t *testing.T) {
105 repo := newMockRepoData()
106 m := &mockFS{}
107 assert.NoError(t, BumpModule(t.Context(), "runtime", Patch, repo["runtime"], m))
108 assert.ElementsMatch(t, m.tagsCreated, []string{"runtime/v0.2.4"})
109 assert.ElementsMatch(t, m.bumps, []bump{})
110 })
111}
112
113func newMockRepoData() RepoData {
114 modules := RepoData{}

Callers

nothing calls this directly

Calls 3

newMockRepoDataFunction · 0.85
BumpModuleFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected