Skip to content

Commit

Permalink
reduced image size for testing, reduces testing by 20s + jacoco coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jetkai committed Mar 7, 2023
1 parent 6ab926d commit e2cf8bb
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
flags: unittests
fail_ci_if_error: true
output: file
file: coverage-report.txt
file: build/reports/jacoco/test/jacocoTestReport.xml
11 changes: 11 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("java")
id("maven-publish")
id("jacoco")
}

group = "io.github.jetkai"
Expand Down Expand Up @@ -64,6 +65,16 @@ tasks.register("setEnvironmentVariable") {
}
}

tasks.test {
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
}
dependsOn(tasks.test) // tests are required to run before generating the report
}

tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/CreateImageEditTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void createImageEditTest() {
//The number of images to generate. Must be between 1 and 10.
.setN(2)
//The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
.setSize("1024x1024")
.setSize("256x256")
.build();

//Create OpenAI instance using API key & organization
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/CreateImageTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void createImageTest() {
//The number of images to generate. Must be between 1 and 10.
.setN(2)
//The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024
.setSize("1024x1024")
.setSize("256x256")
.build();

//Create OpenAI instance using API key & organization
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/CreateImageVariationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void createImageVariationTest() {
//Set the number of images to generate. Must be between 1 and 10.
.setN(2)
//Set the size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
.setSize("1024x1024")
.setSize("256x256")
.build();

//Create OpenAI instance using API key & organization
Expand Down
Binary file modified src/test/resources/otter-mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/test/resources/otter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e2cf8bb

Please sign in to comment.