WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 995711c

Browse files
committed
Jenkins: Update CLI version, make folder name optional to support Test Manager, handle macOS
1 parent 08b171d commit 995711c

17 files changed

+57
-55
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<packaging>hpi</packaging>
1414

1515
<properties>
16-
<revision>6.0</revision>
16+
<revision>6.1</revision>
1717
<changelist>999999-SNAPSHOT</changelist>
1818
<gitHubRepo>jenkinsci/uipath-automation-package-plugin</gitHubRepo>
1919
<jenkins.version>2.414.3</jenkins.version>

src/main/java/com/uipath/uipathpackage/UiPathInstallPlatform.java

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void perform(
7575
FilePath actualCliNupkgPath = null;
7676

7777
if (scopedVersion.contains("CustomVersion")) {
78-
if(StringUtils.isBlank(cliNupkgPath)){
78+
if (StringUtils.isBlank(cliNupkgPath)) {
7979
throw new AbortException("CustomVersion is selected, but path to local nupkg is not provided.");
8080
}
8181
try {
@@ -90,8 +90,7 @@ public void perform(
9090
logger.println("Exception: " + e.getMessage());
9191
throw new AbortException("Failed to parse custom CLI version from path: " + cliNupkgPath + ". Make sure you didn't change default nupkg name downloaded from feed");
9292
}
93-
}
94-
else {
93+
} else {
9594
versionConfiguration = cliConfiguration.getConfiguration(scopedVersion);
9695
}
9796

@@ -102,20 +101,20 @@ public void perform(
102101

103102
logger.println(isSelectedCliAlreadyCached ? "cli " + scopedVersion + " is already cached.." : "cli " + scopedVersion + " is not found in cache..");
104103

105-
if(this.forceInstall || !isSelectedCliAlreadyCached) {
106-
if(forceInstall) {
104+
if (this.forceInstall || !isSelectedCliAlreadyCached) {
105+
if (forceInstall) {
107106
logger.println("force installing the cli , any previous cache for version " + scopedVersion + " will be invalidated..");
108107
}
109108

110109
FilePath cliRootCacheDirPath = cliConfiguration.getCliRootCachedDirectoryPath(launcher, envVars, scopedVersion);
111110

112-
if(scopedVersion.equals(cliConfiguration.getDefaultCliVersionKey())) {
111+
if (scopedVersion.equals(cliConfiguration.getDefaultCliVersionKey())) {
113112
logger.print("(caching) extracting the pre-packaged cli...");
114113
util.extractCliApp(cliRootCacheDirPath, listener, envVars);
115114

116-
} else if(cliVersion.contains("CustomVersion") && StringUtils.isNotBlank(cliNupkgPath)) {
117-
if(!actualCliNupkgPath.exists()){
118-
logger.println("CliNupkgPath provided doesn't exists "+actualCliNupkgPath.getRemote());
115+
} else if (cliVersion.contains("CustomVersion") && StringUtils.isNotBlank(cliNupkgPath)) {
116+
if (!actualCliNupkgPath.exists()) {
117+
logger.println("CliNupkgPath provided doesn't exists " + actualCliNupkgPath.getRemote());
119118
throw new AbortException(Messages.UiPathInstallPlatform_DescriptorImpl_Error_CliNupkgPath());
120119
}
121120
logger.println("(caching) extracting provided cli-nuget from path " + actualCliNupkgPath.getRemote());
@@ -137,10 +136,10 @@ public void perform(
137136

138137
cliConfiguration.updateSelectedCliVersionKey(run, scopedVersion);
139138
} catch (Exception e) {
140-
if(traceLevel.equals(TraceLevel.Verbose) || traceLevel.equals(TraceLevel.Error)) {
139+
if (traceLevel.equals(TraceLevel.Verbose) || traceLevel.equals(TraceLevel.Error)) {
141140
e.printStackTrace(logger);
142141
}
143-
throw new AbortException("unable to install the cli "+ e.getMessage());
142+
throw new AbortException("unable to install the cli " + e.getMessage());
144143
}
145144
}
146145

@@ -169,6 +168,10 @@ private void validateCliCompatibility(UiPathCliConfiguration.Configuration cliSe
169168
if (cliSelectedVersion.getPlatform() != UiPathCliConfiguration.CliPlatform.Linux) {
170169
throw new AbortException("Selected UiPath CLI version '" + cliSelectedVersion.getDisplayName() + "' cannot be executed on Linux agent.");
171170
}
171+
} else if (osName.contains("darwin") || osName.contains("mac")) {
172+
if (cliSelectedVersion.getPlatform() != UiPathCliConfiguration.CliPlatform.macOS) {
173+
throw new AbortException("Selected UiPath CLI version '" + cliSelectedVersion.getDisplayName() + "' cannot be executed on macOS agent.");
174+
}
172175
} else {
173176
throw new AbortException("Running on incompatible operating system");
174177
}
@@ -239,28 +242,28 @@ public ListBoxModel doFillCliVersionItems(@AncestorInPath Item item) {
239242
return new ListBoxModel();
240243
}
241244

242-
ListBoxModel result= new ListBoxModel();
245+
ListBoxModel result = new ListBoxModel();
243246

244247
List<Map.Entry<String, UiPathCliConfiguration.Configuration>> entries =
245248
new ArrayList<>(cliConfiguration.getConfiguration().entrySet());
246249
entries.sort(Comparator.comparing((Map.Entry<String, UiPathCliConfiguration.Configuration> e)
247250
-> e.getValue().getName())
248251
.thenComparing(e -> e.getValue().getVersion().getComplete(), Comparator.reverseOrder()));
249252

250-
for (Map.Entry<String, UiPathCliConfiguration.Configuration> v : entries) {
251-
result.add(new ListBoxModel.Option(v.getValue().getDisplayName(), v.getKey()));
252-
}
253+
for (Map.Entry<String, UiPathCliConfiguration.Configuration> v : entries) {
254+
result.add(new ListBoxModel.Option(v.getValue().getDisplayName(), v.getKey()));
255+
}
253256

254-
return result;
257+
return result;
255258
}
256259

257260
public ListBoxModel doFillTraceLevelItems(@AncestorInPath Item item) {
258261
if (item == null || !item.hasPermission(Item.CONFIGURE)) {
259262
return new ListBoxModel();
260263
}
261264

262-
ListBoxModel result= new ListBoxModel();
263-
for (TraceLevel v: TraceLevel.values()) {
265+
ListBoxModel result = new ListBoxModel();
266+
for (TraceLevel v : TraceLevel.values()) {
264267
result.add(v.toString(), v.toString());
265268
}
266269

src/main/java/com/uipath/uipathpackage/UiPathTest.java

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @NonNul
151151
if (!StringUtils.isBlank(projectKey)) {
152152
testOptions.setProjectKey(projectKey.trim());
153153
} else {
154+
testOptions.setOrganizationUnit(envVars.expand(folderName.trim()));
154155
listener.getLogger().println("Testing module in Orchestrator will be deprecated soon. Consider migrating to UiPath Test Manager. " +
155156
"For more information, visit: " +
156157
"Migration FAQ: https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/faq-migrating-test-artifacts-to-test-manager " +
@@ -181,16 +182,18 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @NonNul
181182
}
182183
}
183184
else {
184-
if(!StringUtils.isBlank(projectKey))
185-
testOptions.setTestSetKey(((TestSetEntry)testTarget).getTestSet());
186-
else
187-
testOptions.setTestSet(((TestSetEntry)testTarget).getTestSet());
185+
if(!StringUtils.isBlank(projectKey)) {
186+
testOptions.setTestSetKey(((TestSetEntry) testTarget).getTestSet());
187+
}
188+
else {
189+
testOptions.setTestSet(((TestSetEntry) testTarget).getTestSet());
190+
}
188191
}
189192

190193
String orchestratorTenantFormatted = envVars.expand(orchestratorTenant.trim()).isEmpty() ? util.getConfigValue(rb, "UiPath.DefaultTenant") : envVars.expand(orchestratorTenant.trim());
191194
testOptions.setOrchestratorUrl(orchestratorAddress);
192195
testOptions.setOrchestratorTenant(orchestratorTenantFormatted);
193-
testOptions.setOrganizationUnit(envVars.expand(folderName.trim()));
196+
194197
testOptions.setTestReportType("junit");
195198

196199
String resultsOutputPath = testResultsOutputPath != null && !testResultsOutputPath.trim().isEmpty()
@@ -483,7 +486,9 @@ private void validateParameters() throws AbortException {
483486

484487
Utility util = new Utility();
485488
util.validateParams(this.orchestratorAddress, com.uipath.uipathpackage.Messages.ValidationErrors_InvalidOrchAddress());
486-
util.validateParams(this.folderName, com.uipath.uipathpackage.Messages.ValidationErrors_InvalidOrchFolder());
489+
490+
if(StringUtils.isBlank(projectKey))
491+
util.validateParams(this.folderName, com.uipath.uipathpackage.Messages.ValidationErrors_InvalidOrchFolder());
487492

488493
if (credentials == null) {
489494
throw new InvalidParameterException(com.uipath.uipathpackage.Messages.GenericErrors_MissingAuthenticationMethod());
@@ -671,19 +676,6 @@ public FormValidation doCheckOrchestratorAddress(@QueryParameter String value) {
671676
return FormValidation.ok();
672677
}
673678

674-
/**
675-
* Validates Orchestrator Folder
676-
*
677-
* @param value value of orchestrator folder
678-
* @return FormValidation
679-
*/
680-
public FormValidation doCheckFolderName(@QueryParameter String value) {
681-
if (value.trim().isEmpty()) {
682-
return FormValidation.error(com.uipath.uipathpackage.Messages.GenericErrors_MissingFolder());
683-
}
684-
return FormValidation.ok();
685-
}
686-
687679
/**
688680
* Validates ParametersFilePath
689681
*

src/main/resources/com/uipath/uipathpackage/UiPathTest/config.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PackagePath=Package(s) path
22
OrchestratorAddress=Orchestrator address
33
OrchestratorTenant=Orchestrator tenant
4-
OrchestratorFolder=Orchestrator folder
4+
OrchestratorFolder=Orchestrator folder (only for running in Orchestrator Testing Module)
55
Credentials=Credentials
66
AuthenticationToken=Authentication Token
77
TestTarget=Target

src/main/resources/com/uipath/uipathpackage/UiPathTest/config_de.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PackagePath=Paketpfad
22
OrchestratorAddress=Orchestrator-Adresse
33
OrchestratorTenant=Orchestrator-Mandant
4-
OrchestratorFolder=Orchestrator-Ordner
4+
OrchestratorFolder=
55
Credentials=Anmeldeinformationen
66
AuthenticationToken=Authentifizierungstoken
77
TestTarget=Target

src/main/resources/com/uipath/uipathpackage/UiPathTest/config_es-MX.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PackagePath=Ruta de acceso a los paquetes
22
OrchestratorAddress=Dirección de Orchestrator
33
OrchestratorTenant=Inquilino de Orchestrator
4-
OrchestratorFolder=Carpeta de Orchestrator
4+
OrchestratorFolder=
55
Credentials=Credenciales
66
AuthenticationToken=Token de autenticación
77
TestTarget=Target

src/main/resources/com/uipath/uipathpackage/UiPathTest/config_es.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PackagePath=Ruta de paquete/s
22
OrchestratorAddress=Dirección de Orchestrator
33
OrchestratorTenant=Inquilino de Orchestrator
4-
OrchestratorFolder=Carpeta de Orchestrator
4+
OrchestratorFolder=
55
Credentials=Credenciales
66
AuthenticationToken=Token de autenticación
77
TestTarget=Destino

src/main/resources/com/uipath/uipathpackage/UiPathTest/config_fr.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PackagePath=Chemin d’accès au(x) package(s)
22
OrchestratorAddress=Adresse Orchestrator
33
OrchestratorTenant=Locataire dʹOrchestrator
4-
OrchestratorFolder=Dossier Orchestrator
4+
OrchestratorFolder=
55
Credentials=Identifiants
66
AuthenticationToken=Jeton d’authentification
77
TestTarget=Target

src/main/resources/com/uipath/uipathpackage/UiPathTest/config_ja.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PackagePath=パッケージのパス
22
OrchestratorAddress=Orchestrator のアドレス
33
OrchestratorTenant=Orchestrator テナント
4-
OrchestratorFolder=Orchestrator のフォルダー
4+
OrchestratorFolder=
55
Credentials=資格情報
66
AuthenticationToken=認証トークン
77
TestTarget=ターゲット

src/main/resources/com/uipath/uipathpackage/UiPathTest/config_ko.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PackagePath=패키지 경로
22
OrchestratorAddress=Orchestrator 주소
33
OrchestratorTenant=Orchestrator 테넌트
4-
OrchestratorFolder=Orchestrator 폴더
4+
OrchestratorFolder=
55
Credentials=자격 증명
66
AuthenticationToken=인증 토큰
77
TestTarget=Target

0 commit comments

Comments
 (0)