[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] com =?UTF-8?Q?pecl/database/ibm=5Fdb=32=3A=20Ensure=20no=20false-positive?= =?UTF-8?Q?s=2
From:       venkatesh babu ks <vnkbabu () php ! net>
Date:       2019-04-16 7:10:41
Message-ID: php-mail-ab2bb073dabc3844e6a1da1ade861f9f1212635109 () git ! php ! net
[Download RAW message or body]

Commit:    04471d207a7f6c732af846369108ff8708a8b443
Author:    Kevin Adler <kadler@us.ibm.com>         Fri, 21 Dec 2018 15:49:49 -0600
Committer: Abhinav Radke <aradke@rocketsoftware.com>      Tue, 16 Apr 2019 12:40:41 \
                +0530
Parents:   c15a39592c928df0b3b441c186e6f9d1b25ab878
Branches:  master

Link:       http://git.php.net/?p=pecl/database/ibm_db2.git;a=commitdiff;h=04471d207a7f6c732af846369108ff8708a8b443


Log:
Ensure no false-positives when run in the CI due to inability to connect

Check for IBM_DB2_TEST_SKIP_CONNECT_FAILURE if it's set to an empty string
or 0, instead of skipping the test it continues onward (and probaby fails).

Changed paths:
  M  .travis.yml
  M  tests/connection.inc


Diff:
diff --git a/.travis.yml b/.travis.yml
index de03e08..cdaab11 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,6 +30,8 @@ script:
   Database=sample
   EOF
 - cat db2cli.ini
+# Ensure that tests are not skipped (false positive) due to bad configuration
+- export IBM_DB2_TEST_SKIP_CONNECT_FAILURE=0
 # Ensure CLI can find the configuration
 - export DB2CLIINIPATH=$PWD
 # Ensure make returns non-zero when a test fails
diff --git a/tests/connection.inc b/tests/connection.inc
index acddd0a..d043a61 100644
--- a/tests/connection.inc
+++ b/tests/connection.inc
@@ -39,9 +39,19 @@ else {
 date_default_timezone_set('UTC');
 
 
+$skip_on_connect_failure = getenv("IBM_DB2_TEST_SKIP_CONNECT_FAILURE") !== FALSE ?
+                            getenv("IBM_DB2_TEST_SKIP_CONNECT_FAILURE") : true;
+
+
 // test connection ok
 $prepconn = db2_connect($database, $user, $password);
-if (!$prepconn) die('skip');
-db2_close($prepconn);
+if (!$prepconn) {
+  if($skip_on_connect_failure) die("skip - Couldn't connect");
+}
+else {
+  db2_close($prepconn);
+}
+
+unset($skip_on_connect_failure);
 
 ?>


--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic