<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>grakn</artifactId>
        <groupId>ai.grakn</groupId>
        <version>0.12.1</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>grakn-test-profiles</artifactId>

    <packaging>pom</packaging>

    <properties>
        <grakn.test-profile>tinker</grakn.test-profile>
        <main.basedir>${project.parent.parent.basedir}</main.basedir>
        <docker-tests>true</docker-tests>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>

                <configuration>
                    <systemPropertyVariables>
                        <grakn.conf>../conf/test/${grakn.test-profile}/grakn.properties</grakn.conf>
                        <grakn.test-profile>${grakn.test-profile}</grakn.test-profile>
                    </systemPropertyVariables>
                    <!-- uncomment the following to be able to run only specific packages with
                        for example -DtestGroup=ai/grakn/test/migration/sql
					<includes>
                    	<include>**/${testGroup}/*Test.java</include>
                	</includes>
                -->
                    <!-- This is important for otherwise surefire reports or the console
                    don't contain stack traces! -->
                    <trimStackTrace>false</trimStackTrace>
                    <argLine>-XX:+HeapDumpOnOutOfMemoryError</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.19.1</version>

                <configuration>
                    <systemPropertyVariables>
                        <grakn.conf>../conf/test/${grakn.test-profile}/grakn.properties</grakn.conf>
                        <grakn.test-profile>${grakn.test-profile}</grakn.test-profile>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>tinker</id>
            <properties>
                <grakn.test-profile>tinker</grakn.test-profile>
            </properties>
        </profile>

        <profile>
            <id>titan</id>
            <properties>
                <grakn.test-profile>titan</grakn.test-profile>
                <grakn.skip-bash-tests>false</grakn.skip-bash-tests>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>ai.grakn</groupId>
                    <artifactId>titan-factory</artifactId>
                    <version>${project.version}</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-log4j12</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>ch.qos.logback</groupId>
                            <artifactId>logback-classic</artifactId>
                        </exclusion>
                    </exclusions>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.cassandraunit</groupId>
                    <artifactId>cassandra-unit</artifactId>
                    <version>${cassandra-unit.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.datastax.cassandra</groupId>
                    <artifactId>cassandra-driver-core</artifactId>
                    <version>3.1.2</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>docker</id>
            <properties>
                <docker-tests>false</docker-tests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.19.1</version>
                        <configuration>
                          <excludes>
                            <exclude>**/**</exclude>
                          </excludes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>2.19.1</version>
                        <configuration>
                          <excludes>
                            <exclude>**/**</exclude>
                          </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>orientdb</id>
            <properties>
                <grakn.test-profile>orientdb</grakn.test-profile>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>ai.grakn</groupId>
                    <artifactId>orientdb-factory</artifactId>
                    <version>${project.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>scaling</id>
            <properties>
                <grakn.test-profile>titan</grakn.test-profile>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>ai.grakn</groupId>
                    <artifactId>titan-factory</artifactId>
                    <version>${project.version}</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-log4j12</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>ch.qos.logback</groupId>
                            <artifactId>logback-classic</artifactId>
                        </exclusion>
                    </exclusions>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>-Xmx16g</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>




</project>
