-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### Proposed Changes * Add baseline Karate project following pattern of postman in a separate maven module
- Loading branch information
Showing
19 changed files
with
578 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.dotcms</groupId> | ||
<artifactId>dotcms-parent</artifactId> | ||
<version>${revision}${sha1}${changelist}</version> | ||
<relativePath>../parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<packaging>jar</packaging> | ||
<artifactId>dotcms-test-karate</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>21</maven.compiler.source> | ||
<maven.compiler.target>21</maven.compiler.target> | ||
<maven.compiler.release>21</maven.compiler.release> | ||
|
||
<license.use>true</license.use> | ||
<clean.docker.volumes>true</clean.docker.volumes> | ||
<cleanup.before.tests>true</cleanup.before.tests> | ||
<postman.test.skip>true</postman.test.skip> | ||
<!-- Some tests e.g. in ApiToken_Resource.postman_collection currently fail unless docker external port is same as internal --> | ||
<tomcat.port>8080</tomcat.port> | ||
<docker.jacoco.skip>false</docker.jacoco.skip> | ||
<karate.version>1.5.0</karate.version> | ||
<karate.test.skip>true</karate.test.skip> | ||
<karate.base.url>http://localhost:${tomcat.port}</karate.base.url> | ||
<it.test>KarateCITests#defaults</it.test> | ||
</properties> | ||
|
||
<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-enforcer-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skipTests>true</skipTests> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<configuration> | ||
<skip>${karate.test.skip}</skip> | ||
<showLogs>true</showLogs> | ||
<follow>true</follow> | ||
<imagesMap> | ||
<dotcms> | ||
<run> | ||
<env> | ||
<CATALINA_OPTS>-XX:+PrintFlagsFinal</CATALINA_OPTS> | ||
<DB_MAX_TOTAL>15</DB_MAX_TOTAL> | ||
<DOT_INDEX_POLICY_SINGLE_CONTENT>FORCE</DOT_INDEX_POLICY_SINGLE_CONTENT> | ||
<DOT_ASYNC_REINDEX_COMMIT_LISTENERS>false</DOT_ASYNC_REINDEX_COMMIT_LISTENERS> | ||
<DOT_ASYNC_COMMIT_LISTENERS>false</DOT_ASYNC_COMMIT_LISTENERS> | ||
<DOT_CACHE_GRAPHQLQUERYCACHE_SECONDS>600</DOT_CACHE_GRAPHQLQUERYCACHE_SECONDS> | ||
<JVM_ENDPOINT_TEST_PASS>obfuscate_me</JVM_ENDPOINT_TEST_PASS> | ||
<DOT_ENABLE_SCRIPTING>true</DOT_ENABLE_SCRIPTING> | ||
<DOT_ANNOUNCEMENTS_BASE_URL>http://localhost:${tomcat.port}</DOT_ANNOUNCEMENTS_BASE_URL> | ||
<DOT_ALLOW_ACCESS_TO_PRIVATE_SUBNETS>true</DOT_ALLOW_ACCESS_TO_PRIVATE_SUBNETS> | ||
<DOT_DOTCMS_DEV_MODE>true</DOT_DOTCMS_DEV_MODE> | ||
<DOT_AI_API_URL>http://wm:8080/c</DOT_AI_API_URL> | ||
<DOT_AI_IMAGE_API_URL>http://wm:${tomcat.port}/i</DOT_AI_IMAGE_API_URL> | ||
<DOT_AI_EMBEDDINGS_API_URL>http://wm:${tomcat.port}/e</DOT_AI_EMBEDDINGS_API_URL> | ||
<DOT_AI_MODELS_API_URL>http://wm:${tomcat.port}/m</DOT_AI_MODELS_API_URL> | ||
</env> | ||
</run> | ||
</dotcms> | ||
</imagesMap> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>cleanup-at-start</id> | ||
<goals> | ||
<goal>stop</goal> | ||
<goal>volume-remove</goal> | ||
</goals> | ||
<phase>pre-integration-test</phase> | ||
</execution> | ||
<execution> | ||
<id>start</id> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
<phase>pre-integration-test</phase> | ||
</execution> | ||
<execution> | ||
<id>stop</id> | ||
<goals> | ||
<goal>stop</goal> | ||
</goals> | ||
<!-- should be post-integration test but need to make sure it does not stop | ||
before dump of jacoco --> | ||
<phase>verify</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<!-- Maven Failsafe Plugin --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>3.0.0</version> | ||
<configuration> | ||
<skip>${karate.test.skip}</skip> | ||
<systemPropertyVariables> | ||
<karate.base.url>${karate.base.url}</karate.base.url> | ||
</systemPropertyVariables> | ||
<includes> | ||
<include>**/*.java</include> | ||
</includes> | ||
<testFailureIgnore>false</testFailureIgnore> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>integration-tests</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>integration-test</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>verify-tests</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
<dependencies> | ||
<!-- <dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-slf4j2-impl</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
<version>1.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-1.2-api</artifactId> | ||
</dependency> | ||
--> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
<version>5.10.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.karatelabs</groupId> | ||
<artifactId>karate-junit5</artifactId> | ||
<version>${karate.version}</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<!-- | ||
<exclusion> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>jcl-over-slf4j</artifactId> | ||
</exclusion> | ||
--> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import com.intuit.karate.Results; | ||
import com.intuit.karate.Runner; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class KarateCITests { | ||
// Note this is a JUnit 5 test compare with @Karate.Test annotated methods.https://stackoverflow.com/questions/65577487/whats-the-purpose-of-karate-junit5-when-you-can-run-tests-without-it | ||
|
||
@Test | ||
void defaults() { | ||
Results results = Runner.path("classpath:tests/defaults").tags("~@ignore") | ||
.outputHtmlReport(true) | ||
.outputJunitXml(true) | ||
.outputCucumberJson(true) | ||
.parallel(1); | ||
assertEquals(0, results.getFailCount(), results.getErrorMessages()); | ||
} | ||
|
||
} |
Oops, something went wrong.