From 2a0c8a4371a98714e38ad3fb3d824ebc097f4d51 Mon Sep 17 00:00:00 2001 From: Joseph Ottinger Date: Mon, 5 Feb 2024 12:01:45 -0500 Subject: [PATCH] Adding more explicit logging for chatgpt tests so they don't fail if the key isn't populated --- src/test/kotlin/javabot/operations/ChatGPTOperationTest.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/kotlin/javabot/operations/ChatGPTOperationTest.kt b/src/test/kotlin/javabot/operations/ChatGPTOperationTest.kt index 04a7aa4e..0eb45707 100644 --- a/src/test/kotlin/javabot/operations/ChatGPTOperationTest.kt +++ b/src/test/kotlin/javabot/operations/ChatGPTOperationTest.kt @@ -2,6 +2,7 @@ package javabot.operations import com.google.inject.Inject import javabot.BaseTest +import javabot.Javabot.Companion.LOG import javabot.JavabotConfig import org.testng.Assert.assertTrue import org.testng.annotations.Test @@ -18,6 +19,9 @@ class ChatGPTOperationTest : BaseTest() { if (config.chatGptKey().isNotEmpty()) { val response = operation.handleMessage(message("~gpt speed of an african laden swallow")) assertTrue(response.isEmpty()) + LOG.info("ChatGPT inappropriate (non-java) content test passed") + } else { + LOG.info("ChatGPT testing skipped, no key configured") } } @@ -27,6 +31,9 @@ class ChatGPTOperationTest : BaseTest() { val response = operation.handleMessage(message("~gpt what is the maven directory structure")) assertTrue(response.isNotEmpty()) assertTrue(response[0].value.contains("src/main/java")) + LOG.info("ChatGPT appropriate content passed: ${response[0].value}") + } else { + LOG.info("ChatGPT testing skipped, no key configured") } } }