Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ commands:
name: Save package results
command: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" \
find . -type f \( \
-regex ".*/target/surefire-reports/.*xml" \
-o -regex ".*/target/failsafe-reports/.*xml" \
\) \
-exec cp {} ~/test-results/junit/ \;
when: always
- store_test_results:
Expand Down Expand Up @@ -311,7 +314,7 @@ jobs:
export MAVEN_OPTS="-Xmx3g -XX:MaxMetaspaceSize=768m -Djava.awt.headless=true"
mvn -U -T1 -B install \
-DonlyUTs \
-DargLine="@{argLine} -Xmx2g -XX:MaxMetaspaceSize=512m"
-DargLine="-Xmx2g -XX:MaxMetaspaceSize=512m"
- save-test-results

integration-tests:
Expand Down Expand Up @@ -367,6 +370,8 @@ jobs:
-pl :sqrl-testing-container \
-Ddocker.image.tag=local-${CIRCLE_SHA1} \
-Dmcp.inspector.version=$MCP_TAG
mvn -B -DonlyContainerE2E jacoco:report-aggregate
- save-test-results

deploy:
docker:
Expand All @@ -386,7 +391,7 @@ jobs:
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
- run:
name: Build shaded JAR
command: mvn -U clean -T1C -B deploy -DonlyJars ${CIRCLE_TAG:+-Prelease} -Deasyjacoco.skip=true
command: mvn -U clean -T1C -B deploy -DonlyJars ${CIRCLE_TAG:+-Prelease}

build-images:
# use a full VM so we can run Docker / Buildx
Expand Down
26 changes: 0 additions & 26 deletions .mvn/extensions.xml

This file was deleted.

7 changes: 3 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ mvn -P dev initialize
# Server-specific builds
mvn clean package # Build fat JAR (vertx-server.jar)
mvn clean package -Pskip-shade-plugin # Build without fat JAR
mvn clean package -Pinstrument # Build with JaCoCo instrumentation
```

### Testing Commands
Expand All @@ -47,11 +46,11 @@ mvn verify
# Coverage report
mvn jacoco:report

# Test specific module (ALWAYS include -Deasyjacoco.skip when using -pl)
mvn test -pl sqrl-planner -Deasyjacoco.skip
# Test specific module
mvn test -pl sqrl-planner

# Test specific test method in module
mvn test -pl sqrl-tools/sqrl-config -Dtest=TestClassName#testMethodName -Deasyjacoco.skip
mvn test -pl sqrl-tools/sqrl-config -Dtest=TestClassName#testMethodName

# Container tests (requires Docker images to be built)
mvn -B install -DonlyContainerE2E -pl :sqrl-testing-container -Dit.test=TestClassName
Expand Down
78 changes: 49 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@
<h2.version>2.4.240</h2.version>
<spring-framework.version>7.0.8</spring-framework.version>
<hikari.version>7.1.0</hikari.version>
<argLine></argLine>
<!-- Do not touch Hadoop version unless it has been updated on the Flink side.
Otherwise, it might break the Flink filesystem integration. -->
<hadoop.version>3.3.4</hadoop.version>
<httpcomponents.version>4.5.14</httpcomponents.version>
<iceberg.version>1.11.0</iceberg.version>
<jackson.version>2.22.0</jackson.version>
<jacocoArgLine></jacocoArgLine>
<jacoco.version>0.8.15</jacoco.version>
<jakarta.annotation.version>3.0.0</jakarta.annotation.version>
<jakarta.inject.version>2.0.1</jakarta.inject.version>
Expand Down Expand Up @@ -173,7 +175,6 @@

<!-- Plugin versions -->
<docker-maven-plugin.version>0.48.1</docker-maven-plugin.version>
<easy-jacoco-maven-plugin.version>0.1.4</easy-jacoco-maven-plugin.version>
<git-code-format-maven-plugin.version>5.6</git-code-format-maven-plugin.version>
<license-maven-plugin.version>5.0.0</license-maven-plugin.version>
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
Expand Down Expand Up @@ -870,33 +871,47 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<excludes>
<exclude>org/**</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>com.marvinformatics.jacoco</groupId>
<artifactId>easy-jacoco-maven-plugin</artifactId>
<version>0.1.4</version>
<configuration>
<projectRules>
<rule>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.70</minimum>
</limit>
</limits>
</rule>
</projectRules>
<projectExtraProperties>
<license.skip>true</license.skip>
</projectExtraProperties>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<append>true</append>
<destFile>${project.build.directory}/jacoco.exec</destFile>
<propertyName>jacocoArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<phase>verify</phase>
<configuration>
<excludes>
<exclude>org/**</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>report-aggregate</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
<inherited>false</inherited>
<configuration>
<dataFileIncludes>
<dataFileInclude>target/*.exec</dataFileInclude>
</dataFileIncludes>
<excludes>
<exclude>org/**</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
Expand Down Expand Up @@ -982,6 +997,10 @@
<environmentVariables>
<TZ>America/Los_Angeles</TZ>
</environmentVariables>
<argLine>@{jacocoArgLine} ${argLine}</argLine>
<systemPropertyVariables>
<jacoco.agent.path>${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar</jacoco.agent.path>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
Expand All @@ -998,8 +1017,9 @@
<systemPropertyVariables>
<flinkrunner.image.repo>${flinkrunner.image.repo}</flinkrunner.image.repo>
<flinkrunner.version>${flinkrunner.version}</flinkrunner.version>
<jacoco.agent.path>${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar</jacoco.agent.path>
</systemPropertyVariables>
<argLine>${argLine}
<argLine>@{jacocoArgLine} ${argLine}
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
Expand Down
40 changes: 0 additions & 40 deletions sqrl-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,44 +427,4 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>instrument</id>

<dependencies>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<version>${jacoco.version}</version>
<classifier>runtime</classifier>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.marvinformatics.jacoco</groupId>
<artifactId>easy-jacoco-maven-plugin</artifactId>
<version>${easy-jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>instrument-uber-jar</id>
<goals>
<goal>instrument-jar</goal>
</goals>
<configuration>
<source>${project.build.directory}/sqrl-cli.jar</source>
<destination>${project.build.directory}/sqrl-cli.jar</destination>
<includes>
<include>com/datasqrl/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion sqrl-server/sqrl-server-vertx/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -e

# Enable debug mode if DEBUG environment variable is set
if [[ -n "${SQRL_DEBUG+x}" && -n "$SQRL_DEBUG" ]]; then
SQRL_JVM_ARGS="-Dlog4j2.configurationFile=/opt/sqrl/app/log4j2-debug.properties"
SQRL_JVM_ARGS="$SQRL_JVM_ARGS -Dlog4j2.configurationFile=/opt/sqrl/app/log4j2-debug.properties"
set -x
fi

Expand Down
31 changes: 0 additions & 31 deletions sqrl-server/sqrl-server-vertx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,35 +83,4 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>instrument</id>

<build>
<plugins>
<plugin>
<groupId>com.marvinformatics.jacoco</groupId>
<artifactId>easy-jacoco-maven-plugin</artifactId>
<version>${easy-jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>instrument-uber-jar</id>
<goals>
<goal>instrument-jar</goal>
</goals>
<configuration>
<source>${project.build.directory}/vertx-server.jar</source>
<destination>${project.build.directory}/vertx-server.jar</destination>
<includes>
<include>com/datasqrl/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
7 changes: 7 additions & 0 deletions sqrl-testing/sqrl-testing-container/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
<version>${jacoco.version}</version>
<classifier>runtime</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public class SqrlContainerExtension
REDPANDA_NETWORK_ALIAS + ":" + REDPANDA_INTERNAL_PORT;
private static final String REDPANDA_IMAGE = "redpandadata/redpanda:v23.1.2";
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private static final String JACOCO_AGENT_PATH_PROPERTY = "jacoco.agent.path";
private static final String JACOCO_AGENT_CONTAINER_PATH = "/opt/sqrl/jacocoagent.jar";
private static final String JACOCO_OUTPUT_CONTAINER_DIR = "/jacoco";
private static final Path JACOCO_OUTPUT_HOST_DIR = Path.of("target");

private final String testCaseName;

Expand Down Expand Up @@ -150,6 +154,7 @@ public GenericContainer<?> createCmdContainer(boolean debug) {
if (debug) {
cmd = cmd.withEnv("SQRL_DEBUG", "1");
}
cmd = configureJacoco(cmd, "sqrl-cli.exec");

commandContainers.add(cmd);
return cmd;
Expand Down Expand Up @@ -189,10 +194,41 @@ public GenericContainer<?> createServerContainer(Path projectRoot, boolean withR
serverContainer =
serverContainer.withEnv(KAFKA_BOOTSTRAP_SERVERS, REDPANDA_INTERNAL_BOOTSTRAP);
}
serverContainer = configureJacoco(serverContainer, "sqrl-server.exec");

return serverContainer;
}

@SneakyThrows
private GenericContainer<?> configureJacoco(GenericContainer<?> container, String destFileName) {
var agentPathProperty = System.getProperty(JACOCO_AGENT_PATH_PROPERTY);
if (StringUtils.isBlank(agentPathProperty)) {
return container;
}

var agentPath = Path.of(agentPathProperty);
if (!Files.isRegularFile(agentPath)) {
log.warn("JaCoCo agent not found at {}, Docker coverage disabled", agentPath);
return container;
}

var outputDir = JACOCO_OUTPUT_HOST_DIR.toAbsolutePath();
Files.createDirectories(outputDir);

var jacocoArg =
String.format(
"-javaagent:%s=destfile=%s/%s,append=true,includes=com.datasqrl.*",
JACOCO_AGENT_CONTAINER_PATH, JACOCO_OUTPUT_CONTAINER_DIR, destFileName);
var existingJvmArgs = container.getEnvMap().get("SQRL_JVM_ARGS");
var jvmArgs =
StringUtils.isBlank(existingJvmArgs) ? jacocoArg : existingJvmArgs + " " + jacocoArg;

return container
.withFileSystemBind(agentPath.toString(), JACOCO_AGENT_CONTAINER_PATH, BindMode.READ_ONLY)
.withFileSystemBind(outputDir.toString(), JACOCO_OUTPUT_CONTAINER_DIR, BindMode.READ_WRITE)
.withEnv("SQRL_JVM_ARGS", jvmArgs);
}

public void compileSqrlProject() {
compileSqrlProject(null);
}
Expand Down