package sqlancer;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

import org.junit.jupiter.api.Test;

public class TestMain {

    private static final String NUM_QUERIES = "1000";
    private static final String SECONDS = "300";

    @Test
    public void testDuckDB() {
        // run with one thread due to multithreading issues, see https://github.com/sqlancer/sqlancer/pull/45
        assertEquals(0, Main.executeMain(new String[] { "--timeout-seconds", SECONDS, "--num-threads", "1",
                "--num-queries", NUM_QUERIES, "duckdb", "--oracle", "NoREC" }));
        assertEquals(0, Main.executeMain(new String[] { "--timeout-seconds", SECONDS, "--num-threads", "1",
                "--num-queries", NUM_QUERIES, "duckdb", "--oracle", "QUERY_PARTITIONING" }));
    }

    @Test
    public void testMySQL() {
        String mysqlAvailable = System.getenv("MYSQL_AVAILABLE");
        boolean mysqlIsAvailable = mysqlAvailable != null && mysqlAvailable.equalsIgnoreCase("true");
        assumeTrue(mysqlIsAvailable);
        assertEquals(0, Main.executeMain(new String[] { "--timeout-seconds", SECONDS, "--max-expression-depth", "1",
                "--num-threads", "1", "--num-queries", NUM_QUERIES, "mysql" }));
    }

}

@@ -848,16 +848,336 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testSqlite() %7B%0A        // run with one thread due to multithreading issues, see https://github.com/sqlancer/sqlancer/pull/45%0A        assertEquals(0, Main.executeMain(%0A                new String%5B%5D %7B %22--timeout-seconds%22, SECONDS, %22--num-threads%22, %221%22, %22--num-queries%22, %220%22, %22sqlite3%22 %7D));%0A    %7D%0A%0A
     @Tes

Integrate SQLite into the CI