Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
e1524007
Commit
e1524007
authored
Jun 12, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding tests to GitLab CI, and adding new API_MODEL env variable for testing
parent
1239de66
Pipeline
#12448
passed with stages
in 2 minutes 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
.gitlab-ci.yml
.gitlab-ci.yml
+22
-0
BehaviorTests.java
src/test/java/com/owlmaddie/tests/BehaviorTests.java
+5
-0
No files found.
.gitlab-ci.yml
View file @
e1524007
...
...
@@ -9,6 +9,7 @@ cache:
stages
:
-
build
-
test
-
deploy
# Build JAR files for each Minecraft & Fabric version
...
...
@@ -63,6 +64,27 @@ build_mod:
tags
:
-
minecraft
# Optional test (gpt 3.5)
test_gpt_35
:
stage
:
test
script
:
-
echo "Running tests with `gpt-3.5-turbo`"
-
./gradlew test
when
:
manual
tags
:
-
test
# Optional test (gpt 4o)
test_gpt_4o
:
stage
:
test
script
:
-
echo "Running tests with `gpt-4o`"
-
export API_MODEL="gpt-4o"
-
./gradlew test
when
:
manual
tags
:
-
test
# Deploy to Modrinth
Modrinth
:
stage
:
deploy
...
...
src/test/java/com/owlmaddie/tests/BehaviorTests.java
View file @
e1524007
...
...
@@ -35,6 +35,7 @@ public class BehaviorTests {
static
String
RESOURCE_PATH
=
"src/test/resources/data/creaturechat/"
;
static
String
API_KEY
=
""
;
static
String
API_URL
=
""
;
static
String
API_MODEL
=
""
;
String
NO_API_KEY
=
"No API_KEY environment variable has been set."
;
ConfigurationHandler
.
Config
config
=
null
;
...
...
@@ -72,6 +73,7 @@ public class BehaviorTests {
// Get API key from env var
API_KEY
=
System
.
getenv
(
"API_KEY"
);
API_URL
=
System
.
getenv
(
"API_URL"
);
API_MODEL
=
System
.
getenv
(
"API_MODEL"
);
// Config
config
=
new
ConfigurationHandler
.
Config
();
...
...
@@ -81,6 +83,9 @@ public class BehaviorTests {
if
(
API_URL
!=
null
&&
!
API_URL
.
isEmpty
())
{
config
.
setUrl
(
API_URL
);
}
if
(
API_MODEL
!=
null
&&
!
API_MODEL
.
isEmpty
())
{
config
.
setModel
(
API_MODEL
);
}
// Verify API key is set correctly
assertNotNull
(
API_KEY
,
NO_API_KEY
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment