mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-10-05 19:30:59 +00:00
chore(tests): fix invalid jobparser tests
- has_with had undetected structure error now failing the schema - empty_step and has_secrets are invalid and caught by the schema there no longer is a need for them
This commit is contained in:
parent
e069333f58
commit
cbdb42093b
7 changed files with 20 additions and 55 deletions
|
@ -42,16 +42,6 @@ func TestParse(t *testing.T) {
|
||||||
options: nil,
|
options: nil,
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "has_secrets",
|
|
||||||
options: nil,
|
|
||||||
wantErr: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "empty_step",
|
|
||||||
options: nil,
|
|
||||||
wantErr: false,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
8
act/jobparser/testdata/empty_step.in.yaml
vendored
8
act/jobparser/testdata/empty_step.in.yaml
vendored
|
@ -1,8 +0,0 @@
|
||||||
name: test
|
|
||||||
jobs:
|
|
||||||
job1:
|
|
||||||
name: job1
|
|
||||||
runs-on: linux
|
|
||||||
steps:
|
|
||||||
- run: echo job-1
|
|
||||||
-
|
|
7
act/jobparser/testdata/empty_step.out.yaml
vendored
7
act/jobparser/testdata/empty_step.out.yaml
vendored
|
@ -1,7 +0,0 @@
|
||||||
name: test
|
|
||||||
jobs:
|
|
||||||
job1:
|
|
||||||
name: job1
|
|
||||||
runs-on: linux
|
|
||||||
steps:
|
|
||||||
- run: echo job-1
|
|
6
act/jobparser/testdata/has_secrets.in.yaml
vendored
6
act/jobparser/testdata/has_secrets.in.yaml
vendored
|
@ -3,12 +3,14 @@ jobs:
|
||||||
job1:
|
job1:
|
||||||
name: job1
|
name: job1
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
uses: .gitea/workflows/build.yml
|
|
||||||
secrets:
|
secrets:
|
||||||
secret: hideme
|
secret: hideme
|
||||||
|
steps:
|
||||||
|
- uses: .gitea/workflows/build.yml
|
||||||
|
|
||||||
job2:
|
job2:
|
||||||
name: job2
|
name: job2
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
uses: .gitea/workflows/build.yml
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
steps:
|
||||||
|
- uses: .gitea/workflows/build.yml
|
||||||
|
|
16
act/jobparser/testdata/has_secrets.out.yaml
vendored
16
act/jobparser/testdata/has_secrets.out.yaml
vendored
|
@ -1,16 +0,0 @@
|
||||||
name: test
|
|
||||||
jobs:
|
|
||||||
job1:
|
|
||||||
name: job1
|
|
||||||
runs-on: linux
|
|
||||||
uses: .gitea/workflows/build.yml
|
|
||||||
secrets:
|
|
||||||
secret: hideme
|
|
||||||
---
|
|
||||||
name: test
|
|
||||||
jobs:
|
|
||||||
job2:
|
|
||||||
name: job2
|
|
||||||
runs-on: linux
|
|
||||||
uses: .gitea/workflows/build.yml
|
|
||||||
secrets: inherit
|
|
14
act/jobparser/testdata/has_with.in.yaml
vendored
14
act/jobparser/testdata/has_with.in.yaml
vendored
|
@ -3,13 +3,15 @@ jobs:
|
||||||
job1:
|
job1:
|
||||||
name: job1
|
name: job1
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
uses: .gitea/workflows/build.yml
|
steps:
|
||||||
with:
|
- uses: .gitea/workflows/build.yml
|
||||||
package: service
|
with:
|
||||||
|
package: service
|
||||||
|
|
||||||
job2:
|
job2:
|
||||||
name: job2
|
name: job2
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
uses: .gitea/workflows/build.yml
|
steps:
|
||||||
with:
|
- uses: .gitea/workflows/build.yml
|
||||||
package: module
|
with:
|
||||||
|
package: module
|
||||||
|
|
14
act/jobparser/testdata/has_with.out.yaml
vendored
14
act/jobparser/testdata/has_with.out.yaml
vendored
|
@ -3,15 +3,17 @@ jobs:
|
||||||
job1:
|
job1:
|
||||||
name: job1
|
name: job1
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
uses: .gitea/workflows/build.yml
|
steps:
|
||||||
with:
|
- uses: .gitea/workflows/build.yml
|
||||||
package: service
|
with:
|
||||||
|
package: service
|
||||||
---
|
---
|
||||||
name: test
|
name: test
|
||||||
jobs:
|
jobs:
|
||||||
job2:
|
job2:
|
||||||
name: job2
|
name: job2
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
uses: .gitea/workflows/build.yml
|
steps:
|
||||||
with:
|
- uses: .gitea/workflows/build.yml
|
||||||
package: module
|
with:
|
||||||
|
package: module
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue