Skip to content

Commit

Permalink
Merge pull request #251 from ppalaga/240127-parallel-its
Browse files Browse the repository at this point in the history
Run integration tests in parallel
  • Loading branch information
geoand authored Jan 30, 2024
2 parents 4a199e7 + 491a318 commit 6ef8c35
Show file tree
Hide file tree
Showing 46 changed files with 652 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-against-langchain4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ jobs:
cd langchain4j
git clone https://github.com/langchain4j/langchain4j.git
cd langchain4j
mvn -B clean install -DskipTests
./mvnw -B clean install -DskipTests
- name: Build with Maven
run: mvn -B clean install -Dno-format
run: ./mvnw -B clean install -Dno-format
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }}
PINECONE_INDEX_NAME: ${{ secrets.PINECONE_INDEX_NAME }}
PINECONE_PROJECT_ID: ${{ secrets.PINECONE_PROJECT_ID }}

- name: Build with Maven (Native)
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
run: ./mvnw -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: mvn -B clean install -Dno-format
run: ./mvnw -B clean install -Dno-format
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }}
PINECONE_INDEX_NAME: ${{ secrets.PINECONE_INDEX_NAME }}
PINECONE_PROJECT_ID: ${{ secrets.PINECONE_PROJECT_ID }}

- name: Build with Maven (Native)
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
run: ./mvnw -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }}
Expand Down
98 changes: 92 additions & 6 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,115 @@ defaults:
shell: bash

jobs:
build:
build-and-test-jvm:
name: Build on ${{ matrix.os }} - ${{ matrix.java }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: [17, 21]
java: [17]
runs-on: ${{ matrix.os }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Prepare git
run: git config --global core.autocrlf false
if: startsWith(matrix.os, 'windows')

- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: 'maven'

- name: Build with Maven
run: mvn -B clean install -Dno-format
run: ./mvnw -B clean install -Dno-format -ntp

- name: Zip the Maven repo
run: |
tar -czf ${{ runner.temp }}/maven-repo.tgz -C ~ .m2/repository
# Avoid caching our own artifacts
rm -Rf ~/.m2/repository/io/quarkiverse/langchain4j
- name: Persist the Maven repo
uses: actions/upload-artifact@v4
with:
name: maven-repo
path: ${{ runner.temp }}/maven-repo.tgz
retention-days: 5

- name: Output the matrix
id: set-matrix
run: |
cd integration-tests
MATRIX='{"testModule":'$( \
find . -mindepth 2 -maxdepth 2 -type f -name 'pom.xml' -exec dirname {} \; \
| sed 's|^\./||' \
| sort -u \
| jq -R -s -c 'split("\n")[:-1]' \
)'}'
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
test-jvm-alt:
name: Test on ${{ matrix.os }} - ${{ matrix.java }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: [21]
runs-on: ${{ matrix.os }}
steps:
- name: Prepare git
run: git config --global core.autocrlf false
if: startsWith(matrix.os, 'windows')

- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: 'maven'

- name: Build with Maven
run: ./mvnw -B clean test -Dno-format -ntp

- name: Avoid caching our own artifacts
run: |
rm -Rf ~/.m2/repository/io/quarkiverse/langchain4j
native-tests:
needs: build-and-test-jvm
name: ${{matrix.testModule}} native tests
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.build-and-test-jvm.outputs.matrix) }}
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Download the Maven repo
uses: actions/download-artifact@v4
with:
name: maven-repo
path: ..
- name: Unzip the Maven Repo
shell: bash
run: |
tar -xzf ../maven-repo.tgz -C ~
- name: Build with Maven (Native)
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
- name: Run integration test ${{matrix.testModule}}
run: |
cd integration-tests/${{matrix.testModule}} && ../../mvnw -B verify -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip -Dno-format -ntp
4 changes: 2 additions & 2 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: mvn -B clean install -Dno-format
run: ./mvnw -B clean install -Dno-format

- name: Build with Maven (Native)
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
run: ./mvnw -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ jobs:
- name: Update latest release version in docs
run: |
mvn -B -ntp -pl docs -am generate-resources -Denforcer.skip -Dformatter.skip -Dimpsort.skip
./mvnw -B -ntp -pl docs -am generate-resources -Denforcer.skip -Dformatter.skip -Dimpsort.skip
if ! git diff --quiet docs/modules/ROOT/pages/includes/attributes.adoc; then
git add docs/modules/ROOT/pages/includes/attributes.adoc
git commit -m "Update the latest release version ${{steps.metadata.outputs.current-version}} in documentation"
fi
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
./mvnw -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
./mvnw -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
2 changes: 1 addition & 1 deletion integration-tests/azure-openai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>quarkus-langchain4j-integration-tests-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>quarkus-langchain4j-integration-tests-azure-openai</artifactId>
<artifactId>quarkus-langchain4j-integration-test-azure-openai</artifactId>
<name>Quarkus LangChain4j - Integration Tests - Azure OpenAI</name>
<properties>
<skipITs>true</skipITs>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/bam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>quarkus-langchain4j-integration-tests-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>quarkus-langchain4j-integration-tests-bam</artifactId>
<artifactId>quarkus-langchain4j-integration-test-bam</artifactId>
<name>Quarkus LangChain4j - Integration Tests - BAM</name>
<properties>
<skipITs>true</skipITs>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/devui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>quarkus-langchain4j-integration-tests-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>quarkus-langchain4j-integration-tests-devui</artifactId>
<artifactId>quarkus-langchain4j-integration-test-devui</artifactId>
<name>Quarkus LangChain4j - Integration Tests - Dev UI</name>
<properties>
<skipITs>true</skipITs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>in-process-embedding-all-minilm-l6-v2-q</artifactId>
<artifactId>quarkus-langchain4j-integration-test-embed-all-minilm-l6-v2-q</artifactId>
<name>Quarkus LangChain4j - Integration Tests - embeddings-all-minilm-l6-v2-q</name>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>in-process-embedding-all-minilm-l6-v2</artifactId>
<artifactId>quarkus-langchain4j-integration-test-embed-all-minilm-l6-v2</artifactId>
<name>Quarkus LangChain4j - Integration Tests - embeddings-all-minilm-l6-v2</name>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>in-process-embedding-bge-small-en-q</artifactId>
<artifactId>quarkus-langchain4j-integration-test-embed-bge-small-en-q</artifactId>
<name>Quarkus LangChain4j - Integration Tests - embeddings-bge-small-en-q</name>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>in-process-embedding-bge-small-en</artifactId>
<artifactId>quarkus-langchain4j-integration-test-embed-bge-small-en</artifactId>
<name>Quarkus LangChain4j - Integration Tests - embeddings-bge-small-en</name>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>in-process-embedding-e5-small-v2-q</artifactId>
<artifactId>quarkus-langchain4j-integration-test-embed-e5-small-v2-q</artifactId>
<name>Quarkus LangChain4j - Integration Tests - embeddings-e5-small-v2-q</name>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>in-process-embedding-e5-small-v2</artifactId>
<artifactId>quarkus-langchain4j-integration-test-embed-e5-small-v2</artifactId>
<name>Quarkus LangChain4j - Integration Tests - embeddings-e5-small-v2</name>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/hugging-face/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>quarkus-langchain4j-integration-tests-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>quarkus-langchain4j-integration-tests-hugging-face</artifactId>
<artifactId>quarkus-langchain4j-integration-test-hugging-face</artifactId>
<name>Quarkus LangChain4j - Integration Tests - Hugging Face</name>
<properties>
<skipITs>true</skipITs>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/ollama/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>quarkus-langchain4j-integration-tests-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>quarkus-langchain4j-integration-tests-ollama</artifactId>
<artifactId>quarkus-langchain4j-integration-test-ollama</artifactId>
<name>Quarkus LangChain4j - Integration Tests - Ollama</name>
<properties>
<skipITs>true</skipITs>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/openai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>quarkus-langchain4j-integration-tests-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>quarkus-langchain4j-integration-tests-openai</artifactId>
<artifactId>quarkus-langchain4j-integration-test-openai</artifactId>
<name>Quarkus LangChain4j - Integration Tests - OpenAI</name>
<properties>
<skipITs>true</skipITs>
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<module>simple-ollama</module>
<module>azure-openai</module>
<module>devui</module>
<module>in-process-embedding-all-minilm-l6-v2-q</module>
<module>in-process-embedding-all-minilm-l6-v2</module>
<module>in-process-embedding-bge-small-en-q</module>
<module>in-process-embedding-bge-small-en</module>
<module>in-process-embedding-e5-small-v2-q</module>
<module>in-process-embedding-e5-small-v2</module>
<module>embed-all-minilm-l6-v2-q</module>
<module>embed-all-minilm-l6-v2</module>
<module>embed-bge-small-en-q</module>
<module>embed-bge-small-en</module>
<module>embed-e5-small-v2-q</module>
<module>embed-e5-small-v2</module>
</modules>
</project>
2 changes: 1 addition & 1 deletion integration-tests/simple-ollama/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>quarkus-langchain4j-integration-tests-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>quarkus-langchain4j-integration-tests-simple-ollama</artifactId>
<artifactId>quarkus-langchain4j-integration-test-simple-ollama</artifactId>
<name>Quarkus LangChain4j - Integration Tests - Ollama DevServices</name>
<properties>
<skipITs>true</skipITs>
Expand Down
Loading

0 comments on commit 6ef8c35

Please sign in to comment.