mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
test updates
Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
c236395c01
commit
eb7e10e86b
8 changed files with 33 additions and 24 deletions
|
@ -4,7 +4,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"gotest.tools/assert"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestReadWorkflow_StringEvent(t *testing.T) {
|
||||
|
@ -20,9 +20,10 @@ jobs:
|
|||
`
|
||||
|
||||
workflow, err := ReadWorkflow(strings.NewReader(yaml))
|
||||
assert.NilError(t, err, "read workflow should succeed")
|
||||
assert.NoError(t, err, "read workflow should succeed")
|
||||
|
||||
assert.DeepEqual(t, workflow.On(), []string{"push"})
|
||||
assert.Len(t, workflow.On(), 1)
|
||||
assert.Contains(t, workflow.On(), "push")
|
||||
}
|
||||
|
||||
func TestReadWorkflow_ListEvent(t *testing.T) {
|
||||
|
@ -38,9 +39,11 @@ jobs:
|
|||
`
|
||||
|
||||
workflow, err := ReadWorkflow(strings.NewReader(yaml))
|
||||
assert.NilError(t, err, "read workflow should succeed")
|
||||
assert.NoError(t, err, "read workflow should succeed")
|
||||
|
||||
assert.DeepEqual(t, workflow.On(), []string{"push", "pull_request"})
|
||||
assert.Len(t, workflow.On(), 2)
|
||||
assert.Contains(t, workflow.On(), "push")
|
||||
assert.Contains(t, workflow.On(), "pull_request")
|
||||
}
|
||||
|
||||
func TestReadWorkflow_MapEvent(t *testing.T) {
|
||||
|
@ -62,7 +65,8 @@ jobs:
|
|||
`
|
||||
|
||||
workflow, err := ReadWorkflow(strings.NewReader(yaml))
|
||||
assert.NilError(t, err, "read workflow should succeed")
|
||||
|
||||
assert.DeepEqual(t, workflow.On(), []string{"push", "pull_request"})
|
||||
assert.NoError(t, err, "read workflow should succeed")
|
||||
assert.Len(t, workflow.On(), 2)
|
||||
assert.Contains(t, workflow.On(), "push")
|
||||
assert.Contains(t, workflow.On(), "pull_request")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue