-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documenting trigger on changed folder GitLab
- Loading branch information
1 parent
fba907f
commit a4713a8
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
src/test/resources/org/jenkinsci/plugins/gwt/bdd/gitlab/gitlab-push-specific-folder.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Feature: It should be possible to trigger for GitLab push events when specific files are changed. | ||
|
||
Scenario: A build should be triggered when a commit is pushed to specific folder. | ||
|
||
Given the following generic variables are configured: | ||
| variable | expression | expressionType | defaultValue | regexpFilter | | ||
| changed_files | $.commits[*].['modified','added','removed'][*] | JSONPath | | | | ||
|
||
Given filter is configured with text: $changed_files | ||
Given filter is configured with expression: .*"any/special/folder[^"]+?".* | ||
When received post content is: | ||
""" | ||
{ | ||
"commits": [ | ||
{ | ||
"added": ["added/file.txt"], | ||
"modified": ["modified/file.txt"], | ||
"removed": ["removed/file.txt"] | ||
}, | ||
{ | ||
"added": [], | ||
"modified": ["this/is/modified.txt"], | ||
"removed": [] | ||
} | ||
] | ||
} | ||
""" | ||
Then the job is not triggered | ||
Then variables are resolved to: | ||
| variable | value | | ||
| changed_files | ["modified/file.txt","added/file.txt","removed/file.txt","this/is/modified.txt"] | | ||
When received post content is: | ||
""" | ||
{ | ||
"commits": [ | ||
{ | ||
"added": [], | ||
"modified": ["any/special/folder/thefile.txt"], | ||
"removed": [] | ||
} | ||
] | ||
} | ||
""" | ||
Then the job is triggered | ||
Then variables are resolved to: | ||
| variable | value | | ||
| changed_files | ["any/special/folder/thefile.txt"] | | ||
When received post content is: | ||
""" | ||
{ | ||
"commits": [ | ||
{ | ||
"added": [], | ||
"modified": ["any/not/special/folder/thefile.txt"], | ||
"removed": [] | ||
} | ||
] | ||
} | ||
""" | ||
Then the job is not triggered | ||
Then variables are resolved to: | ||
| variable | value | | ||
| changed_files | ["any/not/special/folder/thefile.txt"] | |