Skip to content

Commit 5f2055d

Browse files
committed
Test H2 using GitHub Actions
1 parent 14a4955 commit 5f2055d

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,25 @@ jobs:
210210
run: mvn -B package -DskipTests=true
211211
- name: Run Tests
212212
run: POSTGRES_AVAILABLE=true mvn -Dtest=TestPostgres test
213+
214+
h2:
215+
name: H2 Tests
216+
runs-on: ubuntu-latest
217+
steps:
218+
- uses: actions/checkout@v2
219+
with:
220+
fetch-depth: 0
221+
- name: Set up JDK 1.8
222+
uses: actions/setup-java@v1
223+
with:
224+
java-version: 1.8
225+
- name: Build SQLancer
226+
run: mvn -B package -DskipTests=true
227+
- name: Set up H2
228+
run: |
229+
git clone https://github.com/h2database/h2database
230+
cd h2database/h2
231+
./build.sh jar
232+
cp bin/h2*.jar ../../target/lib/h2*.jar
233+
- name: Run Tests
234+
run: H2_AVAILABLE=true mvn -Dtest=TestH2 test

test/sqlancer/dbms/TestH2.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package sqlancer.dbms;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
5+
6+
import org.junit.jupiter.api.Test;
7+
8+
import sqlancer.Main;
9+
10+
public class TestH2 {
11+
12+
@Test
13+
public void testDuckDB() {
14+
String h2Available = System.getenv("H2_AVAILABLE");
15+
boolean mariaDBIsAvailable = h2Available != null && h2Available.equalsIgnoreCase("true");
16+
assumeTrue(mariaDBIsAvailable);
17+
assertEquals(0, Main.executeMain(new String[] { "--random-seed", "0", "--timeout-seconds", TestConfig.SECONDS,
18+
"--num-threads", "4", "--num-queries", TestConfig.NUM_QUERIES, "h2" }));
19+
20+
}
21+
22+
}

0 commit comments

Comments
 (0)