Skip to content

Commit

Permalink
Improve plugin test detection [ci fast]
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Apr 13, 2023
1 parent 718d456 commit e6c60a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import org.pf4j.util.FileUtils
@CompileStatic
class PluginUpdater extends UpdateManager {

static final Pattern META_REGEX = ~/(.+)-(\d+\.\d+\.\d+)-meta\.json/
static final public Pattern META_REGEX = ~/(.+)-(\d+\.\d+\.\d+\S*)-meta\.json/

private CustomPluginManager pluginManager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,21 @@ class PluginUpdaterTest extends Specification {
'nf-amazon' | '1.1.0' | '1.0.0' | true

}

@Unroll
def 'should match meta file name' () {
when:
def matcher = PluginUpdater.META_REGEX.matcher(FILE_NAME)
then:
matcher.matches() == EXPECTED
!EXPECTED || matcher.group(1) == PLUGIN

where:
FILE_NAME | EXPECTED | PLUGIN
'foo' | false | null
'foo.json' | false | null
'nf-foo-1.0.0-meta.json' | true | 'nf-foo'
'xpack-google-1.0.0-beta.3-meta.json' | true | 'xpack-google'

}
}

0 comments on commit e6c60a6

Please sign in to comment.