From 38e7d609ebfb82ddbbb1402d6bdcd2c734494785 Mon Sep 17 00:00:00 2001 From: kapi-smartbear <129836549+kapi-smartbear@users.noreply.github.com> Date: Wed, 1 Oct 2025 14:00:32 +0200 Subject: [PATCH 1/3] Made sure we treat no log file as error and we do a fast exit if no project found --- pom.xml | 3 ++- .../plugins/testcomplete/TcTestBuilder.java | 16 ++++++++++++++-- .../plugins/testcomplete/Messages.properties | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ba0ef70..87a23d6 100644 --- a/pom.xml +++ b/pom.xml @@ -8,9 +8,10 @@ 2.361.4 + 11 - TestComplete + TestComplete-test TestComplete support plug-in 2.10-SNAPSHOT diff --git a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java index d3b7472..c6d8c6d 100644 --- a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java +++ b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java @@ -628,6 +628,15 @@ public void performInternal(Run run, FilePath filePath, Launcher launcher, return; } + //Prefilight check, check if project file exists + + File projectFile = new File(getSuite()); + if(!projectFile.exists() || projectFile.isDirectory()) { + TcLog.error(listener, Messages.TcTestBuilder_UnableToFindProjectFile(), getSuite()); + run.setResult(Result.FAILURE); + return; + } + // Search required TC/TE installation final TcInstallationsScanner scanner = new TcInstallationsScanner(launcher.getChannel(), listener); @@ -685,6 +694,9 @@ public void performInternal(Run run, FilePath filePath, Launcher launcher, boolean useSessionCreator = chosenInstallation.hasExtendedCommandLine() && (!needToUseService); + TcLog.info(listener, "Log file: %s", workspace.getMasterLogXFilePath().getName()); + + // Making the command line List passwordsToMask = new ArrayList<>(); ArgumentListBuilder args = makeCommandLineArgs(run, launcher, listener, workspace, chosenInstallation, useSessionCreator, passwordsToMask); @@ -1113,9 +1125,9 @@ private void processFiles(TcInstallation installation, Run run, VirtualCha } } else { - TcLog.warning(listener, Messages.TcTestBuilder_UnableToFindLogFile(), + TcLog.error(listener, Messages.TcTestBuilder_UnableToFindLogFile(), workspace.getSlaveLogXFilePath().getName()); - + run.setResult(Result.FAILURE); testResult.setLogInfo(new TcLogInfo(startTime, 0, 0, 1, 0)); } diff --git a/src/main/resources/com/smartbear/jenkins/plugins/testcomplete/Messages.properties b/src/main/resources/com/smartbear/jenkins/plugins/testcomplete/Messages.properties index b02dc95..958e72b 100644 --- a/src/main/resources/com/smartbear/jenkins/plugins/testcomplete/Messages.properties +++ b/src/main/resources/com/smartbear/jenkins/plugins/testcomplete/Messages.properties @@ -38,6 +38,7 @@ TcTestBuilder.NotWindowsOS = TestComplete/TestExecute can be launched only on th TcTestBuilder.InvalidTimeoutValue = Invalid timeout value: "%s". The default timeout will be used. TcTestBuilder.InstallationNotFound = Unable to find the specified TestComplete/TestExecute installation. +TcTestBuilder.UnableToFindProjectFile = Unable to find the project file "%s". TcTestBuilder.UnableToFindLogFile = Unable to find the log file "%s". TcTestBuilder.ErrorMessage = Error: %s. TcTestBuilder.RemoteCallingFailed = An error occurred while executing code on the test machine (slave): %s. From ea161b2a6b8491d931b5711c2d4239fede8103fb Mon Sep 17 00:00:00 2001 From: kapi-smartbear <129836549+kapi-smartbear@users.noreply.github.com> Date: Wed, 1 Oct 2025 14:00:49 +0200 Subject: [PATCH 2/3] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 87a23d6..4c098ba 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ 11 - TestComplete-test + TestComplete TestComplete support plug-in 2.10-SNAPSHOT From d226d204fbbec2a8cb116ebc3361eb3853ba60cc Mon Sep 17 00:00:00 2001 From: kapi-smartbear <129836549+kapi-smartbear@users.noreply.github.com> Date: Wed, 12 Nov 2025 11:53:01 +0100 Subject: [PATCH 3/3] Made sure the path works if it is relative --- .../plugins/testcomplete/TcTestBuilder.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java index c6d8c6d..b46d682 100644 --- a/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java +++ b/src/main/java/com/smartbear/jenkins/plugins/testcomplete/TcTestBuilder.java @@ -628,15 +628,6 @@ public void performInternal(Run run, FilePath filePath, Launcher launcher, return; } - //Prefilight check, check if project file exists - - File projectFile = new File(getSuite()); - if(!projectFile.exists() || projectFile.isDirectory()) { - TcLog.error(listener, Messages.TcTestBuilder_UnableToFindProjectFile(), getSuite()); - run.setResult(Result.FAILURE); - return; - } - // Search required TC/TE installation final TcInstallationsScanner scanner = new TcInstallationsScanner(launcher.getChannel(), listener); @@ -735,6 +726,15 @@ public void performInternal(Run run, FilePath filePath, Launcher launcher, } } + //Prefilight check, check if project file exists + FilePath projectFile = new FilePath(workspace.getSlaveWorkspacePath(), env.expand(getSuite())); + if(!projectFile.exists() || projectFile.isDirectory()) { + TcLog.error(listener, Messages.TcTestBuilder_UnableToFindProjectFile(), projectFile.getRemote()); + run.setResult(Result.FAILURE); + return; + } + + // TC/TE launching and data processing TcReportAction tcReportAction = Optional.ofNullable(filePath) .map(fpath -> fpath.toComputer())