Test that inverse matches work for DRONE_LIMIT_REPOS
Added some additional unit tests to verify that `DRONE_LIMIT_REPOS` works for inverse matches. Given that the matching is based on path/filepath, inverse matches are supported. Related docs: https://docs.drone.io/runner/docker/configuration/reference/drone-limit-repos/
This commit is contained in:
@@ -30,7 +30,7 @@ func TestFunc(t *testing.T) {
|
|||||||
match: true,
|
match: true,
|
||||||
matcher: Func([]string{"spaceghost/*", "octocat/*"}, []string{"push"}, true),
|
matcher: Func([]string{"spaceghost/*", "octocat/*"}, []string{"push"}, true),
|
||||||
},
|
},
|
||||||
// repoisitory matching
|
// repository matching
|
||||||
{
|
{
|
||||||
repo: "octocat/hello-world",
|
repo: "octocat/hello-world",
|
||||||
event: "pull_request",
|
event: "pull_request",
|
||||||
@@ -38,6 +38,14 @@ func TestFunc(t *testing.T) {
|
|||||||
match: true,
|
match: true,
|
||||||
matcher: Func([]string{"spaceghost/*", "octocat/*"}, []string{}, false),
|
matcher: Func([]string{"spaceghost/*", "octocat/*"}, []string{}, false),
|
||||||
},
|
},
|
||||||
|
// repository matching, skipping an org
|
||||||
|
{
|
||||||
|
repo: "octocat/hello-world",
|
||||||
|
event: "pull_request",
|
||||||
|
trusted: false,
|
||||||
|
match: true,
|
||||||
|
matcher: Func([]string{"!spaceghost/*", "octocat/*"}, []string{}, false),
|
||||||
|
},
|
||||||
// event matching
|
// event matching
|
||||||
{
|
{
|
||||||
repo: "octocat/hello-world",
|
repo: "octocat/hello-world",
|
||||||
@@ -67,6 +75,22 @@ func TestFunc(t *testing.T) {
|
|||||||
match: false,
|
match: false,
|
||||||
matcher: Func([]string{"octocat/*"}, []string{}, false),
|
matcher: Func([]string{"octocat/*"}, []string{}, false),
|
||||||
},
|
},
|
||||||
|
// repository matching, skip all repos in the org
|
||||||
|
{
|
||||||
|
repo: "spaceghost/hello-world",
|
||||||
|
event: "pull_request",
|
||||||
|
trusted: false,
|
||||||
|
match: false,
|
||||||
|
matcher: Func([]string{"!spaceghost/*"}, []string{}, false),
|
||||||
|
},
|
||||||
|
// repository matching, skip a concrete repo
|
||||||
|
{
|
||||||
|
repo: "spaceghost/hello-world",
|
||||||
|
event: "pull_request",
|
||||||
|
trusted: false,
|
||||||
|
match: false,
|
||||||
|
matcher: Func([]string{"!spaceghost/hello-world"}, []string{}, false),
|
||||||
|
},
|
||||||
// event matching
|
// event matching
|
||||||
{
|
{
|
||||||
repo: "octocat/hello-world",
|
repo: "octocat/hello-world",
|
||||||
|
|||||||
Reference in New Issue
Block a user