Skip to content

Commit

Permalink
Небольшой рефакторинг
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 committed Aug 29, 2024
1 parent a9fbf86 commit 5c5b284
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic"
}
25 changes: 10 additions & 15 deletions src/ru/pulsar/jenkins/library/steps/LoadExtensions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,18 @@ class LoadExtensions implements Serializable {
return ""
}

String optionsName = "${stageName}Options"

def optionsInstance = config."$optionsName"

if (optionsInstance) {
try {
// Для InitInfoBaseOptions необходимо возвращать путь к файлу настроек vrunner только если база загружается из архива
if (!optionsInstance.templateDBLoaded()) {
return ""
}
} catch (MissingMethodException e) {
// Метод templateDBLoaded вполне может отсутствовать, и это не является ошибкой
}
String optionsPropertyName = "${stageName}Options"
def optionsInstance = config."$optionsPropertyName"

return optionsInstance."vrunnerSettings"
} else {
if (!optionsInstance) {
return ""
}

// For InitInfoBaseOptions, return the vrunner settings path only if the database is loaded from an archive
if (optionsInstance instanceof InitInfoBaseOptions && !optionsInstance.templateDBLoaded()) {
return ""
}

return optionsInstance."vrunnerSettings"
}
}

0 comments on commit 5c5b284

Please sign in to comment.