Skip to content

Rd-gen #748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 30, 2022
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-run-tests-from-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
# The option forces to execute all jobs even though some of them have failed.
fail-fast: false
matrix:
project: [utbot-api, utbot-cli, utbot-core, utbot-framework-api, utbot-fuzzers, utbot-gradle, utbot-instrumentation, utbot-instrumentation-tests, utbot-intellij, utbot-junit-contest, utbot-sample, utbot-summary, utbot-summary-tests]
project: [utbot-api, utbot-cli, utbot-core, utbot-framework-api, utbot-fuzzers, utbot-gradle, utbot-instrumentation, utbot-instrumentation-tests, utbot-intellij, utbot-junit-contest, utbot-rd, utbot-sample, utbot-summary, utbot-summary-tests]
runs-on: ubuntu-20.04
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
steps:
Expand Down
11 changes: 11 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.name == "rdgen") {
useModule("com.jetbrains.rd:rd-gen:${requested.version}")
}
}
}
}

rootProject.name = 'utbot'

include 'utbot-core'
Expand All @@ -17,4 +27,5 @@ include 'utbot-summary'
include 'utbot-gradle'
//include 'utbot-maven'
include 'utbot-summary-tests'
include 'utbot-rd'

1 change: 1 addition & 0 deletions utbot-analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ jar {
}

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
zip64 = true
}
35 changes: 0 additions & 35 deletions utbot-core/src/main/kotlin/org/utbot/common/ProcessUtil.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class ConcreteExecutionFailureException(cause: Throwable, errorFile: File, val p
appendLine("----------------------------------------")
appendLine("The child process is dead")
appendLine("Cause:\n${cause.message}")
appendLine("Last 20 lines of the error log ${errorFile.absolutePath}:")
appendLine("Last 1000 lines of the error log ${errorFile.absolutePath}:")
appendLine("----------------------------------------")
errorFile.useLines { lines ->
val lastLines = LinkedList<String>()
for (line in lines) {
lastLines.add(line)
if (lastLines.size > 20) {
if (lastLines.size > 1000) {
lastLines.removeFirst()
}
}
Expand Down
3 changes: 3 additions & 0 deletions utbot-framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ dependencies {
//implementation 'junit:junit:4.13.1'
api project(':utbot-framework-api')

implementation group: 'com.jetbrains.rd', name: 'rd-framework', version: '2022.3.1'
implementation group: 'com.jetbrains.rd', name: 'rd-core', version: '2022.3.1'

implementation "com.github.UnitTestBot:soot:${soot_commit_hash}"

implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: jackson_version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
Expand Down Expand Up @@ -39,6 +38,7 @@ import org.utbot.framework.util.jimpleBody
import org.utbot.framework.util.runSoot
import org.utbot.framework.util.toModel
import org.utbot.instrumentation.ConcreteExecutor
import org.utbot.instrumentation.warmup
import org.utbot.instrumentation.warmup.Warmup
import java.io.File
import java.nio.file.Path
Expand Down
2 changes: 2 additions & 0 deletions utbot-instrumentation-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ dependencies {
testImplementation configurations.fetchInstrumentationJar
testImplementation project(':utbot-sample')
testImplementation group: 'org.jacoco', name: 'org.jacoco.report', version: jacoco_version
implementation group: 'com.jetbrains.rd', name: 'rd-framework', version: '2022.3.1'
implementation group: 'com.jetbrains.rd', name: 'rd-core', version: '2022.3.1'
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.utbot.examples

import com.jetbrains.rd.util.reactive.RdFault
import org.utbot.examples.samples.ExampleClass
import org.utbot.examples.statics.substitution.StaticSubstitution
import org.utbot.examples.statics.substitution.StaticSubstitutionExamples
Expand Down Expand Up @@ -74,9 +75,10 @@ class TestCoverageInstrumentation {
}

assertInstanceOf(
IllegalArgumentException::class.java,
RdFault::class.java,
exc.cause!!
)
assertTrue((exc.cause as RdFault).reasonTypeFqn == "IllegalArgumentException")
}
}

Expand All @@ -96,9 +98,10 @@ class TestCoverageInstrumentation {
}

assertInstanceOf(
IllegalArgumentException::class.java,
RdFault::class.java,
exc.cause!!
)
assertTrue((exc.cause as RdFault).reasonTypeFqn == "IllegalArgumentException")

it.execute(ExampleClass::bar, arrayOf(testObject, 2))
val coverageInfo1 = it.collectCoverage(ExampleClass::class.java)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.utbot.examples

import com.jetbrains.rd.util.reactive.RdFault
import org.utbot.examples.samples.ClassWithSameMethodNames
import org.utbot.examples.samples.ExampleClass
import org.utbot.examples.samples.staticenvironment.StaticExampleClass
Expand Down Expand Up @@ -46,9 +47,10 @@ class TestInvokeInstrumentation {
)
}
assertInstanceOf(
IllegalArgumentException::class.java,
RdFault::class.java,
exc.cause!!
)
assertTrue((exc.cause as RdFault).reasonTypeFqn == "IllegalArgumentException")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.utbot.examples

import com.jetbrains.rd.util.reactive.RdFault
import org.utbot.examples.samples.ExampleClass
import org.utbot.examples.samples.staticenvironment.StaticExampleClass
import org.utbot.instrumentation.ConcreteExecutor
Expand Down Expand Up @@ -52,9 +53,10 @@ class TestIsolated {
}

assertInstanceOf(
IllegalArgumentException::class.java,
RdFault::class.java,
exc.cause!!
)
assertTrue((exc.cause as RdFault).reasonTypeFqn == "IllegalArgumentException")
}
}

Expand Down
7 changes: 6 additions & 1 deletion utbot-instrumentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle"

dependencies {
api project(':utbot-framework-api')
implementation project(':utbot-rd')

implementation group: 'org.ow2.asm', name: 'asm', version: asm_version
implementation group: 'org.ow2.asm', name: 'asm-commons', version: asm_version
Expand All @@ -10,6 +11,10 @@ dependencies {
implementation group: 'de.javakaffee', name: 'kryo-serializers', version: kryo_serializers_version
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version

implementation group: 'com.jetbrains.rd', name: 'rd-framework', version: '2022.3.1'
implementation group: 'com.jetbrains.rd', name: 'rd-core', version: '2022.3.1'


// TODO: this is necessary for inline classes mocking in UtExecutionInstrumentation
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
implementation group: 'org.mockito', name: 'mockito-inline', version: '4.2.0'
Expand Down Expand Up @@ -41,4 +46,4 @@ configurations {

artifacts {
instrumentationArchive jar
}
}
Loading