MCPcopy Index your code
hub / github.com/go-task/task / TestRunOnceSharedDeps

Function TestRunOnceSharedDeps

task_test.go:2208–2228  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2206}
2207
2208func TestRunOnceSharedDeps(t *testing.T) {
2209 t.Parallel()
2210
2211 const dir = "testdata/run_once_shared_deps"
2212
2213 var buff bytes.Buffer
2214 e := task.NewExecutor(
2215 task.WithDir(dir),
2216 task.WithStdout(&buff),
2217 task.WithStderr(&buff),
2218 task.WithForceAll(true),
2219 )
2220 require.NoError(t, e.Setup())
2221 require.NoError(t, e.Run(t.Context(), &task.Call{Task: "build"}))
2222
2223 rx := regexp.MustCompile(`task: \[service-[a,b]:library:build\] echo "build library"`)
2224 matches := rx.FindAllStringSubmatch(buff.String(), -1)
2225 assert.Len(t, matches, 1)
2226 assert.Contains(t, buff.String(), `task: [service-a:build] echo "build a"`)
2227 assert.Contains(t, buff.String(), `task: [service-b:build] echo "build b"`)
2228}
2229
2230func TestRunWhenChanged(t *testing.T) {
2231 t.Parallel()

Callers

nothing calls this directly

Calls 4

SetupMethod · 0.95
RunMethod · 0.95
StringMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…