Skip to content

Commit

Permalink
add test and fix app version not being written correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
karottenreibe committed Nov 30, 2023
1 parent 1d681df commit bcd94b7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion agent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ publishAs {
description.set("JVM profiler that simplifies various aspects around recording and uploading test coverage")
}

val appVersion = rootProject.extra("appVersion").toString()
val appVersion = rootProject.extra["appVersion"].toString()
val jacocoVersion = libs.versions.jacoco.get()
val outputVersion = "$appVersion-jacoco-$jacocoVersion"

Expand Down
2 changes: 1 addition & 1 deletion system-tests/log-version-on-startup-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ plugins {

tasks.test {
val logFilePath = "logTest"
environment("AGENT_VERSION", version)
environment("AGENT_VERSION", rootProject.extra["appVersion"].toString())
teamscaleAgent(mapOf("debug" to logFilePath))
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.regex.Pattern;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -19,8 +20,7 @@ public class LogVersionOnStartupTest {
@Test
public void systemTest() throws Exception {
assertThat(Files.exists(LOG_DIRECTORY)).isTrue();
assertThat(Files.readAllLines(LOG_DIRECTORY.resolve("teamscale-jacoco-agent.log"))).anySatisfy(line -> {
assertThat(line).contains("INFO").contains(AGENT_VERSION);
});
String logContent = String.join("\n", Files.readAllLines(LOG_DIRECTORY.resolve("teamscale-jacoco-agent.log")));
assertThat(logContent).containsPattern("INFO.*" + Pattern.quote(AGENT_VERSION));
}
}
2 changes: 1 addition & 1 deletion teamscale-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<revision>1.0.0-SNAPSHOT</revision>
<teamscale.agent.version>32.4.2</teamscale.agent.version>
<teamscale.agent.version>29.0.0</teamscale.agent.version>
</properties>

<dependencies>
Expand Down

0 comments on commit bcd94b7

Please sign in to comment.