Skip to content
Permalink
Browse files

Merge branch 'MENT-28' into develop

# Conflicts:
#	src/test/java/org/mariadb/jdbc/BaseTest.java
#	src/test/java/org/mariadb/jdbc/ConnectionTest.java
#	src/test/java/org/mariadb/jdbc/DriverTest.java
#	src/test/java/org/mariadb/jdbc/LocalInfileInputStreamTest.java
#	src/test/java/org/mariadb/jdbc/StatementTest.java
  • Loading branch information...
rusher committed Jun 24, 2019
2 parents 99d8802 + d0e04eb commit f8bcbc10dc8d30f1b0d0d6eb7ea60645119532b5
@@ -0,0 +1,191 @@
resources:
containers:

- container: ubuntu-1604
image: ubuntu:16.04
options: "--name ubuntu-1604 --add-host=mariadb.example.com:127.0.0.1 -v /usr/bin/docker:/tmp/docker:ro"

- container: ubuntu-1804
image: ubuntu:18.04
options: "--name ubuntu-1804 --add-host=mariadb.example.com:127.0.0.1 -v /usr/bin/docker:/tmp/docker:ro"

jobs:

- job: SSLFiles
displayName: 'Creating SSL Files'
pool:
vmImage: 'ubuntu-16.04'
container: $[ variables['containerImage'] ]
steps:
- script: |
java --version
mkdir tmp
.travis/gen-ssl.sh mariadb.example.com tmp
ls -lrt tmp
cp -R tmp $BUILD_ARTIFACTSTAGINGDIRECTORY
displayName: 'create SSL certificates'
- task: PublishPipelineArtifact@0
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: ssl_certs

- job: windowsTest
displayName: 'test windows'
pool:
vmImage: 'win1803'
dependsOn:
- SSLFiles
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: ssl_certs
targetPath: $(System.DefaultWorkingDirectory)

- task: DownloadPipelineArtifact@1
displayName: 'Download server artifact files'
inputs:
buildType: 'specific'
project: 'test mariadb ent'
pipeline: 'rusher.MariaDBEnterprise'
artifactName: Windows
#buildVersionToDownload: 'latest'
buildId: 73
buildVersionToDownload: 'specific'
downloadPath: $(System.DefaultWorkingDirectory)
- script: |
choco install jdk8 -ia "INSTALLDIR=""c:\java"""
type C:\ProgramData\chocolatey\logs\chocolatey.log
Get-EnvironmentVariable -Name 'JAVA_HOME' -Scope 'Machine'
choco install maven
echo %PATH%
echo %JAVA_HOME%
refreshenv
echo %PATH%
echo %JAVA_HOME%
displayName: 'install java + maven'
- script: |
msiexec /i $(System.DefaultWorkingDirectory)\win_build\win\packaging\mariadb-10.4.5-winx64.msi INSTALLDIR=c:\projects\server SERVICENAME=mariadb ALLOWREMOTEROOTACCESS=true /qn
c:\projects\server\bin\mysql.exe -e "create database testj" --user=root
displayName: 'install server'
- script: |
echo 127.0.0.1 mariadb.example.com >> %WINDIR%\System32\Drivers\Etc\Hosts
dir
displayName: 'set hostname'
- script: |
set JAVA_HOME=C:\java\
set PATH=%PATH%;%JAVA_HOME%\bin
java -version
C:\ProgramData\chocolatey\bin\mvn -version
C:\ProgramData\chocolatey\bin\mvn clean test -DdbUrl="jdbc:mariadb://mariadb.example.com:3306/testj?user=root" -DkeystorePath="$(System.DefaultWorkingDirectory)/tmp/client-keystore.jks" -DkeystorePassword="kspass" -DserverCertificatePath="$(System.DefaultWorkingDirectory)/tmp/server.crt" -Dkeystore2Path="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.jks" -Dkeystore2Password="kspass" -DkeyPassword="kspasskey" -Dkeystore2PathP12="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.p12" -DrunLongTest=false
displayName: 'run tests'
- job: RunInContainer
pool:
vmImage: 'ubuntu-16.04'
dependsOn:
- SSLFiles
strategy:
matrix:
ubuntu-1604:
containerImage: ubuntu-1604
containerName: xenial
ubuntu-1804:
containerImage: ubuntu-1804
containerName: bionic

container: $[variables['containerImage']]

steps:

- task: DownloadPipelineArtifact@0
inputs:
artifactName: ssl_certs
targetPath: $(System.DefaultWorkingDirectory)

- script: /tmp/docker exec -t -u 0 $(containerImage) sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: Set up sudo

- task: DownloadPipelineArtifact@1
displayName: 'Download server artifact files'
inputs:
buildType: 'specific'
project: 'test mariadb ent'
pipeline: 'rusher.MariaDBEnterprise'
artifactName: $(containerImage)
#buildVersionToDownload: 'latest'
buildId: 47
buildVersionToDownload: 'specific'
downloadPath: $(System.DefaultWorkingDirectory)

- script: |
sudo apt-get install -y software-properties-common wget
wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
sudo apt-key adv --recv-keys --keyserver ha.pool.sks-keyservers.net F1656F24C74CD1D8
displayName: 'Add galera signature keys'
- script: |
sudo bash -c "echo 'deb http://yum.mariadb.org/galera/repo/deb xenial main' > /etc/apt/sources.list.d/galera-test-repo.list"
condition: eq(variables['containerImage'], 'ubuntu-1604')
displayName: 'Add xenial galera repo'
- script: |
sudo bash -c "echo 'deb http://yum.mariadb.org/galera/repo/deb bionic main' > /etc/apt/sources.list.d/galera-test-repo.list"
condition: eq(variables['containerImage'], 'ubuntu-1804')
displayName: 'Add bionic galera repo'
- script: |
ls -lrt .
echo "Installing server from deb"
sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
rm -R mariadb-plugin*
rm -R *-dev.deb
rm -R *-test.deb
chmod 777 .
sudo apt-get update && sudo apt-get install -y --no-install-recommends apt-transport-https ca-certificates tzdata pwgen
export DEBIAN_FRONTEND="noninteractive"
sudo debconf-set-selections <<< "mariadb-server-10.4 mysql-server/root_password password !Passw0rd"
sudo debconf-set-selections <<< "mariadb-server-10.4 mysql-server/root_password_again password !Passw0rd"
sudo apt-get update -y
sudo apt-get install --allow-unauthenticated -y curl libdbi-perl rsync socat libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 galera-4 gawk lsof psmisc libaio1 perl libreadline5
echo 'Installing deb files'
sudo apt install -f -y ./*.deb
sudo ls -lrt /etc/mysql/
sudo bash -c 'echo "ssl-ca=$(System.DefaultWorkingDirectory)/tmp/ca.crt" >> /etc/mysql/mariadb-enterprise.cnf'
sudo bash -c 'echo "ssl-cert=$(System.DefaultWorkingDirectory)/tmp/server.crt" >> /etc/mysql/mariadb-enterprise.cnf'
sudo bash -c 'echo "ssl-key=$(System.DefaultWorkingDirectory)/tmp/server.key" >> /etc/mysql/mariadb-enterprise.cnf'
sudo tail -n 500 /etc/mysql/mariadb-enterprise.cnf
sudo service mysql restart
displayName: 'install server'
- script: |
sudo mysql -e "CREATE USER 'root'@'%' identified by 'Passw@rd2';"
sudo mysql -e "GRANT ALL on *.* to 'root'@'%' identified by 'Passw@rd2' with grant option;"
sudo mysql -e "CREATE DATABASE testj;"
displayName: 'Add non socket user'
- script: |
sudo apt install -y default-jdk
sudo apt install -y maven
mvn -version
java -version
displayName: 'Install java + maven'
- script: |
ls -lrt /usr/share/maven/bin/
/usr/share/maven/bin/mvn clean test -DdbUrl="jdbc:mariadb://mariadb.example.com:3306/testj?user=root&password=Passw@rd2" -DkeystorePath="$(System.DefaultWorkingDirectory)/tmp/client-keystore.jks" -DkeystorePassword="kspass" -DserverCertificatePath="$(System.DefaultWorkingDirectory)/tmp/server.crt" -Dkeystore2Path="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.jks" -Dkeystore2Password="kspass" -DkeyPassword="kspasskey" -Dkeystore2PathP12="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.p12" -DrunLongTest=false
env:
JAVA_HOME: "/usr/lib/jvm/default-java"
MAVEN_HOME: "/opt/maven"
displayName: 'run tests'
@@ -1768,7 +1768,7 @@ public void prolog(long maxRows, boolean hasProxy, MariaDbConnection connection,
MariaDbStatement statement)
throws SQLException {
if (explicitClosed) {
throw new SQLException("execute() is called on closed connection");
throw new SQLNonTransientConnectionException("execute() is called on closed connection");
}
//old failover handling
if (!hasProxy && shouldReconnectWithoutProxy()) {
@@ -148,11 +148,14 @@ protected void finished(Description description) {
} catch (SQLNonTransientConnectionException connFail) {
connFail.printStackTrace();
try {
beforeClassBaseTest();
} catch (SQLException e) {
System.out.println("ERROR reconnecting");
e.printStackTrace();
}
beforeClassBaseTest();
} catch (SQLException e) {
System.out.println("ERROR reconnecting");
e.printStackTrace();
}
fail("Prepare after test fail for " + description.getClassName() + "." + description
.getMethodName());

} catch (Exception e) {
e.printStackTrace();
fail("Prepare after test fail for " + description.getClassName() + "." + description

0 comments on commit f8bcbc1

Please sign in to comment.
You can’t perform that action at this time.