Permalink
Browse files

test: add PostgreSQL 9.6 to CI tests (#560)

  • Loading branch information...
vlsi committed May 14, 2016
1 parent dc3bdda commit 3ff47daf68bf45694d5671eef1d9d32fb87f00d3
@@ -41,6 +41,13 @@ cache:
matrix:
fast_finish: true
include:
- jdk: oraclejdk8
sudo: required
dist: trusty
env:
- PG_VERSION=9.6
- XA=true
- COVERAGE=Y
- jdk: oraclejdk8
sudo: required
dist: trusty
@@ -120,7 +127,7 @@ matrix:
postgresql: "9.4"
env:
- PG_VERSION=9.4
- MVN_CUSTOM_ARGS='-DwaffleEnabled=false -DosgiEnabled=false -DexcludePackageNames=org.postgresql.osgi:org.postgresql.sspi'
- NO_WAFFLE_NO_OSGI=Y

# Deploy snapshots to Maven Central
after_success:
@@ -20,6 +20,10 @@ For problems with this driver, refer to driver's [home page](http://jdbc.postgre
Most people do not need to compile PgJDBC. You can download prebuilt versions of the driver
from the [Postgresql JDBC site](http://jdbc.postgresql.org/) or using your chosen dependency management tool:

## Supported PostgreSQL versions

Pgjdbc regression tests are run against PostgreSQL 8.4, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6.

### Maven
```xml
<dependency>
@@ -26,7 +26,9 @@
v9_2("9.2.0"),
v9_3("9.3.0"),
v9_4("9.4.0"),
v9_5("9.5.0"),;
v9_5("9.5.0"),
v9_6("9.6.0"),
;

private final int version;

@@ -2853,13 +2853,16 @@ private static void addACLPrivileges(String acl, Map<String, Map<String, List<St
+ " END AS TYPE, "
+ " (i.keys).n AS ORDINAL_POSITION, "
+ " trim(both '\"' from pg_catalog.pg_get_indexdef(ci.oid, (i.keys).n, false)) AS COLUMN_NAME, "
+ " CASE am.amcanorder "
+ " WHEN true THEN CASE i.indoption[(i.keys).n - 1] & 1 "
+ " WHEN 1 THEN 'D' "
+ " ELSE 'A' "
+ " END "
+ " ELSE NULL "
+ " END AS ASC_OR_DESC, "
// TODO: Implement ASC_OR_DESC for PostgreSQL 9.6+
+ (connection.haveMinimumServerVersion(ServerVersion.v9_6)
? "NULL AS ASC_OR_DESC, "
: " CASE am.amcanorder "
+ " WHEN true THEN CASE i.indoption[(i.keys).n - 1] & 1 "
+ " WHEN 1 THEN 'D' "
+ " ELSE 'A' "
+ " END "
+ " ELSE NULL "
+ " END AS ASC_OR_DESC, ")
+ " ci.reltuples AS CARDINALITY, "
+ " ci.relpages AS PAGES, "
+ " pg_catalog.pg_get_expr(i.indpred, i.indrelid) AS FILTER_CONDITION "
@@ -8,6 +8,7 @@

package org.postgresql.test.jdbc2;

import org.postgresql.core.ServerVersion;
import org.postgresql.test.TestUtil;

import junit.framework.TestCase;
@@ -588,12 +589,22 @@ public void testAscDescIndexInfo() throws SQLException {
assertTrue(rs.next());
assertEquals("idx_a_d", rs.getString("INDEX_NAME"));
assertEquals("id", rs.getString("COLUMN_NAME"));
assertEquals("A", rs.getString("ASC_OR_DESC"));
if (TestUtil.haveMinimumServerVersion(con, ServerVersion.v9_6)) {
assertNull("ASC_OR_DESC for index is not yet supported for PostgreSQL 9.6",
rs.getString("ASC_OR_DESC"));
} else {
assertEquals("A", rs.getString("ASC_OR_DESC"));
}

assertTrue(rs.next());
assertEquals("idx_a_d", rs.getString("INDEX_NAME"));
assertEquals("quest", rs.getString("COLUMN_NAME"));
assertEquals("D", rs.getString("ASC_OR_DESC"));
if (TestUtil.haveMinimumServerVersion(con, ServerVersion.v9_6)) {
assertNull("ASC_OR_DESC for index is not yet supported for PostgreSQL 9.6",
rs.getString("ASC_OR_DESC"));
} else {
assertEquals("D", rs.getString("ASC_OR_DESC"));
}
}

public void testPartialIndexInfo() throws SQLException {
@@ -3,7 +3,10 @@ set -x -e

# Skip tests and checkstype to speed up snapshot deployment
MVN_ARGS="clean deploy -B -V -DskipTests -Dcheckstyle.skip=true -Dskip.assembly=true --settings settings.xml"
MVN_ARGS="$MVN_ARGS $MVN_CUSTOM_ARGS"
if [[ "${NO_WAFFLE_NO_OSGI}" == *"Y"* ]];
then
MVN_ARGS="$MVN_ARGS -DwaffleEnabled=false -DosgiEnabled=false -DexcludePackageNames=org.postgresql.osgi:org.postgresql.sspi"
fi

if [[ "${TRAVIS_JDK_VERSION}" == *"jdk6"* ]];
then
@@ -6,7 +6,7 @@ sudo service postgresql stop
sudo cp /etc/postgresql/9.1/main/pg_hba.conf ./
sudo apt-get remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common -qq --purge
source /etc/lsb-release
echo "deb http://apt.postgresql.org/pub/repos/apt/ $DISTRIB_CODENAME-pgdg main" > pgdg.list
echo "deb http://apt.postgresql.org/pub/repos/apt/ $DISTRIB_CODENAME-pgdg main ${PG_VERSION}" > pgdg.list
sudo mv pgdg.list /etc/apt/sources.list.d/
wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

0 comments on commit 3ff47da

Please sign in to comment.