Skip to content

Commit

Permalink
Fix some test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Avanatiker committed Dec 9, 2024
1 parent 22a9e1a commit 040872d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static List<Path> getReportFileNames(String mavenProjectPath) throws IOEx
}
}

private interface AgentService {
public interface AgentService {
/** Dumps coverage */
@POST("/dump")
Call<Void> dump();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ class TestEngineOptions {

private fun createImpactedTestsProvider(): ImpactedTestsProvider {
val client = TeamscaleClient(
serverOptions?.url, serverOptions?.userName!!,
serverOptions?.userAccessToken!!, serverOptions?.project!!,
serverOptions?.url,
serverOptions?.userName!!,
serverOptions?.userAccessToken!!,
serverOptions?.project!!,
File(reportDirectory, "server-request.txt")
)
return ImpactedTestsProvider(
client, baseline!!, baselineRevision!!, endCommit!!, endRevision!!, repository!!, partition!!,
client, baseline, baselineRevision, endCommit, endRevision, repository, partition,
runAllTests, includeAddedTests, includeFailedAndSkipped
)
}
Expand All @@ -116,12 +118,12 @@ class TestEngineOptions {
class Builder {
private val testEngineOptions = TestEngineOptions()

fun serverOptions(serverOptions: ServerOptions): Builder {
fun serverOptions(serverOptions: ServerOptions?): Builder {
testEngineOptions.serverOptions = serverOptions
return this
}

fun partition(partition: String): Builder {
fun partition(partition: String?): Builder {
testEngineOptions.partition = partition
return this
}
Expand All @@ -146,27 +148,27 @@ class TestEngineOptions {
return this
}

fun endCommit(endCommit: CommitDescriptor): Builder {
fun endCommit(endCommit: CommitDescriptor?): Builder {
testEngineOptions.endCommit = endCommit
return this
}

fun endRevision(endRevision: String): Builder {
fun endRevision(endRevision: String?): Builder {
testEngineOptions.endRevision = endRevision
return this
}

fun repository(repository: String): Builder {
fun repository(repository: String?): Builder {
testEngineOptions.repository = repository
return this
}

fun baseline(baseline: String): Builder {
fun baseline(baseline: String?): Builder {
testEngineOptions.baseline = baseline
return this
}

fun baselineRevision(baselineRevision: String): Builder {
fun baselineRevision(baselineRevision: String?): Builder {
testEngineOptions.baselineRevision = baselineRevision
return this
}
Expand All @@ -192,7 +194,8 @@ class TestEngineOptions {
return this
}

fun reportDirectory(reportDirectory: String): Builder {
fun reportDirectory(reportDirectory: String?): Builder {
reportDirectory ?: return this
testEngineOptions.reportDirectory = File(reportDirectory)
return this
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import org.junit.platform.engine.UniqueId
import org.mockito.kotlin.*
import java.util.*

@Suppress("INLINE_FROM_HIGHER_PLATFORM")
/** Tests for [TestwiseCoverageCollectingExecutionListener]. */
internal class TestwiseCoverageCollectingExecutionListenerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ data class TestExecution @JvmOverloads constructor(
private val duration: Double? = null

val durationSeconds: Double
@Suppress("DEPRECATION")
get() = duration ?: (durationMillis / 1000.0)
}

0 comments on commit 040872d

Please sign in to comment.