<?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>io.github.dfa1.vortex</groupId>
		<artifactId>vortex-java</artifactId>
		<version>0.7.3</version>
	</parent>

	<artifactId>vortex-integration</artifactId>

	<name>vortex-integration</name>
	<description>Integration tests for the Vortex columnar file format Java implementation.</description>

	<properties>
		<maven.deploy.skip>true</maven.deploy.skip>
	</properties>

	<dependencies>
		<!-- testing -->
		<dependency>
			<groupId>io.airlift</groupId>
			<artifactId>aircompressor-v3</artifactId>
			<scope>test</scope>
		</dependency>
		<!-- hardwood (Parquet reader) requires zstd-jni to decompress ZSTD-compressed Parquet pages -->
		<dependency>
			<groupId>com.github.luben</groupId>
			<artifactId>zstd-jni</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.github.dfa1.vortex</groupId>
			<artifactId>vortex-writer</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.github.dfa1.vortex</groupId>
			<artifactId>vortex-parquet</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.github.dfa1.vortex</groupId>
			<artifactId>vortex-csv</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>dev.hardwood</groupId>
			<artifactId>hardwood-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.github.dfa1.vortex</groupId>
			<artifactId>vortex-reader</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.github.dfa1.vortex</groupId>
			<artifactId>vortex-inspector</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>dev.vortex</groupId>
			<artifactId>vortex-jni</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.arrow</groupId>
			<artifactId>arrow-vector</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.arrow</groupId>
			<artifactId>arrow-c-data</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.arrow</groupId>
			<artifactId>arrow-memory-unsafe</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>coverage</id>
			<!-- When reporting coverage, promote key modules from test to compile scope so
			     jacoco:report-aggregate can locate their class directories. The integration
			     module is never published (maven.deploy.skip=true) so this has no downstream
			     impact. -->
			<dependencies>
				<dependency>
					<groupId>io.github.dfa1.vortex</groupId>
					<artifactId>vortex-core</artifactId>
					<scope>compile</scope>
				</dependency>
				<dependency>
					<groupId>io.github.dfa1.vortex</groupId>
					<artifactId>vortex-reader</artifactId>
					<scope>compile</scope>
				</dependency>
				<dependency>
					<groupId>io.github.dfa1.vortex</groupId>
					<artifactId>vortex-writer</artifactId>
					<scope>compile</scope>
				</dependency>
				<dependency>
					<groupId>io.github.dfa1.vortex</groupId>
					<artifactId>vortex-inspector</artifactId>
					<scope>compile</scope>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<executions>
							<!-- Aggregate integration-test coverage across all dependency modules.
							     report-integration only covers classes in THIS module (none), so
							     we use report-aggregate to collect reader/writer/core class hits
							     from the jacoco-it.exec files that failsafe produces here. -->
							<execution>
								<id>report-aggregate-it</id>
								<phase>verify</phase>
								<goals>
									<goal>report-aggregate</goal>
								</goals>
								<configuration>
									<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>**/*IntegrationTest.java</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<configuration>
					<includes>
						<include>**/*IntegrationTest.java</include>
					</includes>
					<argLine>
						@{argLine}
						--add-opens java.base/java.nio=ALL-UNNAMED
						--enable-native-access=ALL-UNNAMED
						--sun-misc-unsafe-memory-access=allow
					</argLine>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
