forked from UnitTestBot/UTBotJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Engine process UnitTestBot#2 (UnitTestBot#1067)
[utbot-rd] 1. engine out-of-process 2. removed jdk8+ api calls in engine-related code 3. removed reflection in utbot-intellij to support idea 2022 4. bumped idea version and plugin sdk 5. reactive settings 6. ClientProcessBuilder to support out-of-process 7. moved sarifs, test generation, code generation and TestGenerationReport to another process
- Loading branch information
1 parent
8016349
commit f55c96d
Showing
62 changed files
with
3,851 additions
and
1,009 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
utbot-framework/src/main/kotlin/org/utbot/analytics/AnalyticsConfigureUtil.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.utbot.analytics | ||
|
||
import mu.KotlinLogging | ||
import org.utbot.framework.PathSelectorType | ||
import org.utbot.framework.UtSettings | ||
|
||
private val logger = KotlinLogging.logger {} | ||
|
||
object AnalyticsConfigureUtil { | ||
/** | ||
* Configures utbot-analytics models for the better path selection. | ||
* | ||
* NOTE: If analytics configuration for the NN Path Selector could not be loaded, | ||
* it switches to the [PathSelectorType.INHERITORS_SELECTOR]. | ||
*/ | ||
fun configureML() { | ||
logger.info { "PathSelectorType: ${UtSettings.pathSelectorType}" } | ||
|
||
if (UtSettings.pathSelectorType == PathSelectorType.ML_SELECTOR) { | ||
val analyticsConfigurationClassPath = UtSettings.analyticsConfigurationClassPath | ||
tryToSetUpMLSelector(analyticsConfigurationClassPath) | ||
} | ||
|
||
if (UtSettings.pathSelectorType == PathSelectorType.TORCH_SELECTOR) { | ||
val analyticsConfigurationClassPath = UtSettings.analyticsTorchConfigurationClassPath | ||
tryToSetUpMLSelector(analyticsConfigurationClassPath) | ||
} | ||
} | ||
|
||
private fun tryToSetUpMLSelector(analyticsConfigurationClassPath: String) { | ||
try { | ||
Class.forName(analyticsConfigurationClassPath) | ||
Predictors.stateRewardPredictor = EngineAnalyticsContext.mlPredictorFactory() | ||
|
||
logger.info { "RewardModelPath: ${UtSettings.modelPath}" } | ||
} catch (e: ClassNotFoundException) { | ||
logger.error { | ||
"Configuration of the predictors from the utbot-analytics module described in the class: " + | ||
"$analyticsConfigurationClassPath is not found!" | ||
} | ||
|
||
logger.info(e) { | ||
"Error while initialization of ${UtSettings.pathSelectorType}. Changing pathSelectorType on INHERITORS_SELECTOR" | ||
} | ||
UtSettings.pathSelectorType = PathSelectorType.INHERITORS_SELECTOR | ||
} | ||
catch (e: Exception) { // engine not found, for example | ||
logger.error { e.message } | ||
UtSettings.pathSelectorType = PathSelectorType.INHERITORS_SELECTOR | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.