Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Core Test & Binary Build
on:
push:
branches: [ master, eugene/* ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Init submodules
run: ./git-init-submodules.sh
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }}
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: Setup gradle binaries
run: ./gradlew
- name: Pull dependencies libs, and perform initial compile
run: ./gradlew src
- name: Run unit tests
run: ./gradlew test
- name: Run the build
run: ./gradlew build
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: |
build/reports/**/*
build/test-results/**/*
build/jacoco/**/*
- name: Archive binary files
uses: actions/upload-artifact@v2
with:
name: binary-libs
path: |
build/libs/**/*
25 changes: 0 additions & 25 deletions .github/workflows/gradle.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/mysql-5-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: MySql 5.7 Support Test
on:
push:
branches: [ master, eugene/* ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: JAVACOMMONS
MYSQL_USER: JAVACOMMONS
MYSQL_PASSWORD: JAVACOMMONS
MYSQL_ROOT_PASSWORD: ROOTPASSWD
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v1
- name: Init submodules
run: ./git-init-submodules.sh
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }}
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: Setup gradle binaries
run: ./gradlew
- name: Pull dependencies libs, and perform initial compile
run: ./gradlew src
- name: Run unit tests
run: ./gradlew test -Ptest_mysql
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: |
build/reports/**/*
build/test-results/**/*
build/jacoco/**/*
51 changes: 51 additions & 0 deletions .github/workflows/mysql-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: MySql 8.0 Support Test
on:
push:
branches: [ master, eugene/* ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: JAVACOMMONS
MYSQL_USER: JAVACOMMONS
MYSQL_PASSWORD: JAVACOMMONS
MYSQL_ROOT_PASSWORD: ROOTPASSWD
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v1
- name: Init submodules
run: ./git-init-submodules.sh
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Gradle packages
uses: actions/cache@v2
with:
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }}
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: Setup gradle binaries
run: ./gradlew
- name: Pull dependencies libs, and perform initial compile
run: ./gradlew src
- name: Run unit tests
run: ./gradlew test -Ptest_mysql
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: |
build/reports/**/*
build/test-results/**/*
build/jacoco/**/*
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ test/tmp
# Include back .gitignore
#
!.gitignore
!.travis.yml
!.travis.yml
!.github/
!.github/workflows/*
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
// id "com.github.onslip.gradle-one-jar" version "1.0.5"

// Shadow plugin used to build the shade jar
id 'com.github.johnrengelman.plugin-shadow' version '2.0.2'
id 'com.github.johnrengelman.shadow' version '2.0.4'

// jacoco code coverage for test
id 'jacoco'
Expand Down Expand Up @@ -92,7 +92,7 @@ dependencies {

// api files("./lib/jsql/ojdbc6.jar") // for oracle
api "org.xerial:sqlite-jdbc:3.25.2" // for sqlite
api "mysql:mysql-connector-java:6.0.6" // for mysql
api "mysql:mysql-connector-java:8.0.26" // for mysql

// Newer MSSQL connection (THIS DOES NOT WORK)
// api "com.microsoft.sqlserver:mssql-jdbc:7.2.1.jre8" // for mssql
Expand Down Expand Up @@ -266,6 +266,12 @@ test {
// As our test tends to be io-blocked rather then cpu
// we will run more tests in parallels
maxParallelForks = (Runtime.runtime.availableProcessors() * 2) as int

// We clamp this to 12 threads, because the high volume of SQL test
// can currently cause connection errors on the test servers
if( maxParallelForks > 12 ) {
maxParallelForks = 12;
}
}

// Set up the number of tests per fork
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/picoded/dstack/connector/jsql/HikaricpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static HikariDataSource mysql(GenericConvertMap config) {
}

// Setup the configured connection URL + DB
hconfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
// hconfig.setDriverClassName("com.mysql.cj.jdbc.Driver");

hconfig.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + name);

Expand All @@ -233,7 +233,7 @@ public static HikariDataSource mysql(GenericConvertMap config) {
config.getBoolean("cachePrepStmts", true) //
);
hconfig.addDataSourceProperty("prepStmtCacheSize", //
config.getInt("prepStmtCacheSize", 250) //
config.getInt("prepStmtCacheSize", 500) //
);
hconfig.addDataSourceProperty("prepStmtCacheSqlLimit", //
config.getInt("prepStmtCacheSqlLimit", 2048) //
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picoded/dstack/jsql/JSqlTestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static boolean isLocalPortInUse(int port) {
//-------------------------------//
// Default Credentials for MYSQL //
//-------------------------------//
static private String MYSQL_HOST = "demodb-mysql.picoded-dev.com";
static private String MYSQL_HOST = "localhost";
static private String MYSQL_DATA = "JAVACOMMONS";
static private String MYSQL_USER = "JAVACOMMONS";
static private String MYSQL_PASS = "JAVACOMMONS";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package picoded.dstack.jsql.mysql;

// Test depends
import picoded.dstack.*;
import picoded.dstack.jsql.*;
import picoded.dstack.connector.jsql.*;
import picoded.dstack.struct.simple.*;

public class JSql_DataObjectMap_Mysql_test extends JSql_DataObjectMap_test {

// To override for implementation
//-----------------------------------------------------

/// Note that this SQL connector constructor
/// is to be overriden for the various backend
/// specific test cases
public JSql jsqlConnection() {
return JSqlTestConnection.mysql();
}

}