Unable to execute test script from Jenkins

121 views
Skip to first unread message

Raju Kumar

unread,
Aug 24, 2021, 9:18:24 AM8/24/21
to Jenkins Users
Hello Guys.
I am facing issue with Jenkins my test locally running but on AWS it's showing build successful but no tests run , Please Help me.
Console OutputStarted by user Saurav Kumar Running as SYSTEM Building in workspace /var/lib/jenkins/workspace/Test The recommended git tool is: NONE using credential c30f8c69-28d8-49ad-9c72-00d5e0fa6ce4 > /usr/libexec/git-core/git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/Test/.git # timeout=10 Fetching changes from the remote Git repository > /usr/libexec/git-core/git config remote.origin.url https://github.com/RajuKumar9/fourthrepository.git # timeout=10 Fetching upstream changes from https://github.com/RajuKumar9/fourthrepository.git > /usr/libexec/git-core/git --version # timeout=10 > git --version # 'git version 2.32.0' using GIT_ASKPASS to set credentials > /usr/libexec/git-core/git fetch --tags --force --progress -- https://github.com/RajuKumar9/fourthrepository.git +refs/heads/*:refs/remotes/origin/* # timeout=10 > /usr/libexec/git-core/git rev-parse refs/remotes/origin/master^{commit} # timeout=10 Checking out Revision 4c65d217dacd115b40a8fce94d04707474418aab (refs/remotes/origin/master) > /usr/libexec/git-core/git config core.sparsecheckout # timeout=10 > /usr/libexec/git-core/git checkout -f 4c65d217dacd115b40a8fce94d04707474418aab # timeout=10 Commit message: "new changes" > /usr/libexec/git-core/git rev-list --no-walk 4c65d217dacd115b40a8fce94d04707474418aab # timeout=10 [Test] $ mvn clean test [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building simplett $1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ simplett --- [INFO] Deleting /var/lib/jenkins/workspace/Test/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ simplett --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 5 resources [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/Test/src/main/java/yourorganization/maven_sample [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ simplett --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 5 source files to /var/lib/jenkins/workspace/Test/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ simplett --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/Test/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ simplett --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ simplett --- [INFO] No tests to run. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.209 s [INFO] Finished at: 2021-08-24T07:32:17Z [INFO] Final Memory: 14M/38M [INFO] ------------------------------------------------------------------------ Finished: SUCCESS

 POM File

<modelVersion>4.0.0</modelVersion>
<groupId>simplet</groupId>
<artifactId>simplett</artifactId>
<version>$1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<resources>
<resource>
<directory>src\main\java</directory>
</resource>
<resource>
<directory>src\main\java\yourorganization\maven_sample</directory>
<targetPath>www</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                 <executions>
                    <execution>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <transformers>
                                <transformer
                                  implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>com.yourorganization.maven_sample.LogicPositivizer</mainClass>
                                     <mainClass>com.yourorganization.maven_sample.SecondUser</mainClass>
                                     <mainClass>com.yourorganization.maven_sample.ThirdUser</mainClass>
                                     <mainClass>com.yourorganization.maven_sample.FourthUser</mainClass>
                                     <mainClass>com.yourorganization.maven_sample.FifthUser</mainClass>
                                </transformer>
                            </transformers>
                           </configuration>
                    </execution>
                </executions>
            </plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
     <dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>

       </dependency>
      <dependency>  
 <groupId>org.testng</groupId>  
 <artifactId>testng</artifactId>  
 <version>6.8</version>  
 
    </dependency> 
 
</dependencies>

</project>



Martin Schmude

unread,
Aug 25, 2021, 1:35:12 AM8/25/21
to Jenkins Users
Maven expects test classes in folder ./src/test/java. In https://github.com/RajuKumar9/fourthrepository there is no such folder.
There are no test classes, so Maven can't compile and execute any tests.
Reply all
Reply to author
Forward
0 new messages