fix: tests with validation errors were skipped (#2496)

* fix: tests with validation errors were skipped

* fixup

* [no ci] fix one test

* fix some tests

* fix last test

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2024-10-28 05:03:42 +01:00
committed by GitHub
parent f77a443edf
commit 2c0e3fea00
12 changed files with 14 additions and 16 deletions

View File

@@ -196,11 +196,9 @@ func (j *TestJobFileInfo) runTest(ctx context.Context, t *testing.T, cfg *Config
assert.Nil(t, err, j.workflowPath)
planner, err := model.NewWorkflowPlanner(fullWorkflowPath, true)
if err != nil {
if j.errorMessage != "" && err != nil {
assert.Error(t, err, j.errorMessage)
} else {
assert.Nil(t, err, fullWorkflowPath)
} else if assert.Nil(t, err, fullWorkflowPath) {
plan, err := planner.PlanEvent(j.eventName)
assert.True(t, (err == nil) != (plan == nil), "PlanEvent should return either a plan or an error")
if err == nil && plan != nil {