1

test under repos [Artifacts after running test

@KevinLu-MSFT I could not attach the .jar file but below is my structure where you can see what i have in my pipe line and what the output. I my question above i have given teh .pom and .xml file in this one i have attached the feature file that I call. Please let me know if you need anything more to help to get to the bottom of this. i don't see any logs generated in devop

Feature: Call a test api

  Background:
    * url 'https://www.google.co.uk/'

  Scenario: get google search

    Given driver 'https://www.google.co.uk/'
    When method get
    Then status 200

]2

package getconcall;

import com.intuit.karate.junit4.Karate;
import org.junit.runner.RunWith;

@RunWith(Karate.class)
public class ConRunner {

}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <groupId>com.restexample</groupId>
    <artifactId>myRestCalls</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
 
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.version>3.6.0</maven.compiler.version>
        <karate.version>0.9.5</karate.version>
    </properties>    

    <dependencies>
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-apache</artifactId>
            <version>${karate.version}</version>
            <scope>test</scope>
        </dependency>            
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-junit4</artifactId>
            <version>${karate.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.masterthought</groupId>
            <artifactId>cucumber-reporting</artifactId>
            <version>3.8.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.1</version>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <compilerArgument>-Werror</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
            </plugin>
        </plugins>        
    </build>       
    
</project>

Got Tests on Azure pipe line, my tests are working locally producing html reports. The same ran on pipe line produces snapshot.jar file.

  1. pom.xml file mapped to maven and running well in pipeline displaying green after running.

  2. But I get a snapshot.jar file and i don't see any reports.

  3. I feel the .java file is not getting executed, which in turn calls the .feature file for the tests to execute.

  4. I can't see any reports. how do i get them to be added.

  5. Any help on this appreciated, so that i can see my tests run and reports generated.

  6. Have attached pom and .java file that i use in my test.

Devanathan
  • 63
  • 1
  • 4
  • no idea at all. all the best – Peter Thomas Sep 01 '20 at 14:55
  • Test with Karate Project, it could generate html reports in the `target` folder. Can you share some logs about jar file generation? I couldn't reproduce this issue in my side. If possible, please share a minimal project about reproducing problems. – Kevin Lu-MSFT Sep 02 '20 at 05:53
  • @KevinLu-MSFT , i don't see any logs in the devops folder. apart from able to download the .jar file. How do i send that to you .. by asking another question in stack overflow? I can actually send you the details of the files that i am using to test.. since its on my own devops sample project.. before moving it on to the org. piple line. – Devanathan Sep 02 '20 at 09:52
  • @KevinLu-MSFT Please find my question below. – Devanathan Sep 02 '20 at 10:47
  • @Devanathan. From the configuration you shared, it seems that everything is ok. Here is [the sample](https://github.com/intuit/karate/tree/master/karate-junit5) I tested(The author is Peter) . It could work as expected in Azure Pipeline. You could try to use the current pipeline settings to run this sample. Please check if it could generate the HTML file. – Kevin Lu-MSFT Sep 03 '20 at 08:41

0 Answers0