Compare commits
2 commits
0405c69d98
...
4f9ff1b641
Author | SHA1 | Date | |
---|---|---|---|
4f9ff1b641 | |||
33a3e3c7ef |
4 changed files with 17 additions and 5 deletions
6
pom.xml
6
pom.xml
|
@ -57,6 +57,12 @@
|
|||
<version>1.2.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>1.9.23</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlinx</groupId>
|
||||
<artifactId>kotlinx-coroutines-core</artifactId>
|
||||
|
|
|
@ -91,6 +91,7 @@ public class MobibotBuild extends Project {
|
|||
.include(dependency("com.google.guava", "guava", "33.1.0-jre"))
|
||||
.include(dependency("com.google.cloud", "google-cloud-vertexai", "1.2.0"))
|
||||
// Kotlin
|
||||
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
|
||||
.include(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.8.0"))
|
||||
.include(dependency("org.jetbrains.kotlinx", "kotlinx-cli-jvm", "0.3.6"))
|
||||
// Logging
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.junit.jupiter.api.extension.ExtensionContext
|
|||
*/
|
||||
class DisableOnCiCondition : ExecutionCondition {
|
||||
override fun evaluateExecutionCondition(context: ExtensionContext): ConditionEvaluationResult {
|
||||
return if (System.getenv("CI") != null && System.getenv("COVERAGE_SDK") == null) {
|
||||
return if (System.getenv("CI") != null) {
|
||||
ConditionEvaluationResult.disabled("Test disabled on CI")
|
||||
} else {
|
||||
ConditionEvaluationResult.enabled("Test enabled")
|
||||
|
|
|
@ -47,6 +47,15 @@ class ChatGptTest : LocalProperties() {
|
|||
.hasNoCause()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testChatOnCoverage() {
|
||||
if (System.getenv("CI") == null || System.getenv("COVERAGE_SDK") != null) {
|
||||
assertThat(
|
||||
ChatGpt.chat("how do I encode a URL in java?", getProperty(ChatGpt.API_KEY_PROP), 60)
|
||||
).contains("URLEncoder")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisableOnCi
|
||||
fun testChat() {
|
||||
|
@ -55,10 +64,6 @@ class ChatGptTest : LocalProperties() {
|
|||
ChatGpt.chat("how do I make an HTTP request in Javascript?", apiKey, 100)
|
||||
).contains("XMLHttpRequest")
|
||||
|
||||
assertThat(
|
||||
ChatGpt.chat("how do I encode a URL in java?", apiKey, 60)
|
||||
).contains("URLEncoder")
|
||||
|
||||
assertFailure { ChatGpt.chat("1 liter to gallon", apiKey, -1) }
|
||||
.isInstanceOf(ModuleException::class.java)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue