1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

chore(tests): workflows are validated via a schema

This test was introduced by 61b7859f12
to verify a safeguard prevents a crash. With schema validation it is
caught at an earlier stage.
This commit is contained in:
Earl Warren 2025-07-05 21:51:06 +02:00
parent 4453e1a834
commit 5faf1bbc54

View file

@ -226,9 +226,8 @@ jobs:
foo: {{ a }} foo: {{ a }}
` `
workflow, err := ReadWorkflow(strings.NewReader(yaml)) _, err := ReadWorkflow(strings.NewReader(yaml))
assert.NoError(t, err, "read workflow should succeed") assert.ErrorContains(t, err, "Line: 11 Column 16: Expected a scalar got mapping")
assert.Nil(t, workflow.GetJob("test").Steps[0].GetEnv())
} }
func TestReadWorkflow_RunsOnLabels(t *testing.T) { func TestReadWorkflow_RunsOnLabels(t *testing.T) {