MCPcopy
hub / github.com/nektos/act / runTestJobFile

Function runTestJobFile

pkg/artifacts/server_test.go:274–318  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, tjfi TestJobFileInfo)

Source from the content-addressed store, hash-verified

272}
273
274func runTestJobFile(ctx context.Context, t *testing.T, tjfi TestJobFileInfo) {
275 t.Run(tjfi.workflowPath, func(t *testing.T) {
276 fmt.Printf("::group::%s\n", tjfi.workflowPath)
277
278 if err := os.RemoveAll(artifactsPath); err != nil {
279 panic(err)
280 }
281
282 workdir, err := filepath.Abs(tjfi.workdir)
283 assert.Nil(t, err, workdir)
284 fullWorkflowPath := filepath.Join(workdir, tjfi.workflowPath)
285 runnerConfig := &runner.Config{
286 Workdir: workdir,
287 BindWorkdir: false,
288 EventName: tjfi.eventName,
289 Platforms: tjfi.platforms,
290 ReuseContainers: false,
291 ContainerArchitecture: tjfi.containerArchitecture,
292 GitHubInstance: "github.com",
293 ArtifactServerPath: artifactsPath,
294 ArtifactServerAddr: artifactsAddr,
295 ArtifactServerPort: artifactsPort,
296 }
297
298 runner, err := runner.New(runnerConfig)
299 assert.Nil(t, err, tjfi.workflowPath)
300
301 planner, err := model.NewWorkflowPlanner(fullWorkflowPath, true, false)
302 assert.Nil(t, err, fullWorkflowPath)
303
304 plan, err := planner.PlanEvent(tjfi.eventName)
305 if err == nil {
306 err = runner.NewPlanExecutor(plan)(ctx)
307 if tjfi.errorMessage == "" {
308 assert.Nil(t, err, fullWorkflowPath)
309 } else {
310 assert.Error(t, err, tjfi.errorMessage)
311 }
312 } else {
313 assert.Nil(t, plan)
314 }
315
316 fmt.Println("::endgroup::")
317 })
318}
319
320func TestMkdirFsImplSafeResolve(t *testing.T) {
321 baseDir := "/foo/bar"

Callers 1

TestArtifactFlowFunction · 0.85

Calls 5

PlanEventMethod · 0.95
NewFunction · 0.92
NewWorkflowPlannerFunction · 0.92
NewPlanExecutorMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…