mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
refactor: NewWorkflowPlanner
(#648)
feat: add flag `--no-recurse` to disable recursion when reading workflows from directories feat: added more tests to `TestPlanner`, renamed `TestJobFileInfo` to more appropriate name `WorkflowPlanTest` style: changed error message to lowercase, added single quotes for better visibility Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
cf202bedb5
commit
fbdf6e6952
11 changed files with 117 additions and 31 deletions
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
func TestGraphEvent(t *testing.T) {
|
||||
planner, err := model.NewWorkflowPlanner("testdata/basic")
|
||||
planner, err := model.NewWorkflowPlanner("testdata/basic", true)
|
||||
assert.NilError(t, err)
|
||||
|
||||
plan := planner.PlanEvent("push")
|
||||
|
@ -56,7 +56,7 @@ func runTestJobFile(ctx context.Context, t *testing.T, tjfi TestJobFileInfo) {
|
|||
runner, err := New(runnerConfig)
|
||||
assert.NilError(t, err, tjfi.workflowPath)
|
||||
|
||||
planner, err := model.NewWorkflowPlanner(fullWorkflowPath)
|
||||
planner, err := model.NewWorkflowPlanner(fullWorkflowPath, true)
|
||||
assert.NilError(t, err, fullWorkflowPath)
|
||||
|
||||
plan := planner.PlanEvent(tjfi.eventName)
|
||||
|
@ -143,7 +143,7 @@ func TestRunEventSecrets(t *testing.T) {
|
|||
runner, err := New(runnerConfig)
|
||||
assert.NilError(t, err, workflowPath)
|
||||
|
||||
planner, err := model.NewWorkflowPlanner(fmt.Sprintf("testdata/%s", workflowPath))
|
||||
planner, err := model.NewWorkflowPlanner(fmt.Sprintf("testdata/%s", workflowPath), true)
|
||||
assert.NilError(t, err, workflowPath)
|
||||
|
||||
plan := planner.PlanEvent(eventName)
|
||||
|
@ -180,7 +180,7 @@ func TestRunEventPullRequest(t *testing.T) {
|
|||
runner, err := New(runnerConfig)
|
||||
assert.NilError(t, err, workflowPath)
|
||||
|
||||
planner, err := model.NewWorkflowPlanner(fmt.Sprintf("testdata/%s", workflowPath))
|
||||
planner, err := model.NewWorkflowPlanner(fmt.Sprintf("testdata/%s", workflowPath), true)
|
||||
assert.NilError(t, err, workflowPath)
|
||||
|
||||
plan := planner.PlanEvent(eventName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue