Skip to content

Commit

Permalink
Run integration tests on pull request runs (#263)
Browse files Browse the repository at this point in the history
Run integration tests on pull request runs
  • Loading branch information
nvoxland authored May 24, 2022
1 parent a87a49c commit f3444b7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Unit Tests
name: Build & Test

on:
pull_request:
Expand All @@ -9,7 +9,7 @@ on:

jobs:
unit-test:
name: Java ${{ matrix.java }}
name: Unit Tests - Java ${{ matrix.java }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -25,9 +25,37 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Run Unit Tests With Maven
run: mvn surefire:test --file pom.xml
distribution: 'temurin'
cache: 'maven'

- name: Unit Tests - Java ${{ matrix.java }}
run: mvn -B surefire:test --file pom.xml

integration-tests:
name: Integration Test - Java ${{ matrix.java }}
runs-on: ubuntu-latest
needs: unit-test
strategy:
matrix:
java: [8, 11, 17]
mongodb: [4]
services:
mongodb:
image: mongo:${{ matrix.mongodb }}
ports:
- 27017-27019:27017-27019

steps:
- uses: actions/checkout@v2

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Integration Test - Java ${{ matrix.java }}
run: mvn -B clean test verify -Prun-its --file pom.xml
2 changes: 1 addition & 1 deletion src/main/java/liquibase/nosql/executor/NoSqlExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void execute(final SqlStatement sql, final List<SqlVisitor> sqlVisitors)
} else if (sql instanceof UpdateStatement) {
execute((UpdateStatement) sql);
} else {
throw new IllegalArgumentException();
throw new IllegalArgumentException("Mongodb cannot execute "+sql.getClass().getName()+" statements");
}
}

Expand Down

0 comments on commit f3444b7

Please sign in to comment.