(ctx context.Context, t *testing.T, tjfi TestJobFileInfo)
| 272 | } |
| 273 | |
| 274 | func 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 | |
| 320 | func TestMkdirFsImplSafeResolve(t *testing.T) { |
| 321 | baseDir := "/foo/bar" |
no test coverage detected
searching dependent graphs…