CI Actions imporvements

This commit is contained in:
Mark Pollack
2024-11-12 15:24:23 -05:00
parent 6acd202c12
commit 1d540a6dd1
6 changed files with 59 additions and 36 deletions

View File

@@ -40,10 +40,10 @@ jobs:
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
OLLAMA_TESTS_ENABLED: "false"
OLLAMA_AUTOCONF_TESTS_ENABLED: "true"
run: |
mvn -s settings.xml -Pintegration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
-DOLLAMA_TESTS_ENABLED=false --batch-mode --update-snapshots deploy
--batch-mode --update-snapshots deploy
- name: Generate Java docs
run: mvn javadoc:aggregate
@@ -78,33 +78,28 @@ jobs:
# The docker-compose and testcontainers modules will be compiled and run in a parallel job
# container-tests:
# name: Container integration tests
# runs-on: ubuntu-latest
# steps:
# - name: Checkout source code
# uses: actions/checkout@v4
#
# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: 'maven'
#
# - name: Configure Testcontainers
# run: |
# echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties
#
# - name: Run Container Integration Tests
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
# ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
# run: |
# mvn -s settings.xml -Pintegration-tests verify \
# -Dskip.docker-compose=false \
# -Dskip.testcontainers=false \
# -pl spring-ai-spring-boot-docker-compose,spring-ai-spring-boot-testcontainers \
# -am --batch-mode
container-tests:
name: docker-compose and testcontainers modules
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Configure Testcontainers
run: |
echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties
- name: Run Container Integration Tests
run: |
mvn -s settings.xml -Pintegration-tests verify \
-Dskip.docker-compose=false \
-Dskip.testcontainers=false \
-pl spring-ai-spring-boot-docker-compose,spring-ai-spring-boot-testcontainers \
-am --batch-mode

View File

@@ -98,4 +98,25 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<configuration>
<skipITs>${skip.model.ollama}</skipITs>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -30,7 +30,6 @@ import org.springframework.ai.ollama.management.PullModelStrategy;
import org.springframework.util.Assert;
@Testcontainers
@EnabledIfEnvironmentVariable(named = "OLLAMA_TESTS_ENABLED", matches = "true")
public abstract class BaseOllamaIT {
private static final String OLLAMA_LOCAL_URL = "http://localhost:11434";

View File

@@ -257,7 +257,7 @@
<puppycrawl-tools-checkstyle.version>9.3</puppycrawl-tools-checkstyle.version>
<disable.checks>true</disable.checks>
<!-- Individual vector store skip flags with smoke tests enabled by default -->
<!-- Individual vector store IT skip flags with smoke tests enabled by default -->
<skip.vectorstore.azure-cosmos-db>true</skip.vectorstore.azure-cosmos-db>
<skip.vectorstore.azure>true</skip.vectorstore.azure>
<skip.vectorstore.cassandra>true</skip.vectorstore.cassandra>
@@ -281,6 +281,10 @@
<!-- Container module ITs - skipped by default -->
<skip.docker-compose>true</skip.docker-compose>
<skip.testcontainers>true</skip.testcontainers>
<!-- Ollama Model IT tests - skipped by default -->
<skip.model.ollama>true</skip.model.ollama>
</properties>
<build>

View File

@@ -30,9 +30,13 @@ import org.springframework.ai.ollama.management.PullModelStrategy;
import org.springframework.util.Assert;
@Testcontainers
@EnabledIfEnvironmentVariable(named = "OLLAMA_TESTS_ENABLED", matches = "true")
@EnabledIfEnvironmentVariable(named = "OLLAMA_AUTOCONF_TESTS_ENABLED", matches = "true")
public abstract class BaseOllamaIT {
static {
System.out.println("OLLAMA_AUTOCONF_TESTS_ENABLED=" + System.getenv("OLLAMA_AUTOCONF_TESTS_ENABLED"));
System.out.println("System property=" + System.getProperty("OLLAMA_AUTOCONF_TESTS_ENABLED"));
}
private static final String OLLAMA_LOCAL_URL = "http://localhost:11434";
private static final Duration DEFAULT_TIMEOUT = Duration.ofMinutes(10);

View File

@@ -86,7 +86,7 @@ public class OpenAiAutoConfigurationIT {
.isTrue();
assertThat(response.length).isNotEqualTo(0);
logger.info("Response: " + Arrays.toString(response));
logger.debug("Response: " + Arrays.toString(response));
});
}