Print error messages for managed identity test (#1392)

* Print error messages for managed identity test

* Skip appveyor MSI tests

* Skip msi tests for unix
This commit is contained in:
Sicong 2022-09-12 10:15:04 -07:00 committed by GitHub
parent e2c15977ef
commit ed96718152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 3 deletions

9
.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
.vs
.vscode
__pycache__
*.diff
*.exp
*.log
*.sh
*.out
test/**/**/*.php

View file

@ -12,6 +12,7 @@ environment:
SQLSRV_DBNAME: msphpsql_sqlsrv
PDOSQLSRV_DBNAME: msphpsql_pdosqlsrv
PYTHON: c:\Python36
APPVEYOR: true
# For details about Appveyor build worker images (VM template): https://www.appveyor.com/docs/build-environment/#build-worker-images
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

View file

@ -3,7 +3,11 @@ Test some error conditions of Azure AD Managed Identity support
--DESCRIPTION--
This test expects certain exceptions to be thrown under some conditions.
--SKIPIF--
<?php require('skipif.inc');?>
<?php
require('skipif.inc');
require('skipif_Appveyor.inc');
require('skipif_unix.inc');
?>
--FILE--
<?php
require_once("MsCommon_mid-refactor.inc");
@ -41,7 +45,9 @@ function connectInvalidServer()
$conn = new PDO("sqlsrv:server = invalidServer; $connectionInfo", null, null);
echo $message . $testCase . PHP_EOL;
} catch(PDOException $e) {
// TODO: check the exception message here
echo "Failed to connect\n";
print_r($e->getMessage());
echo "\n";
}
} catch(PDOException $e) {
print_r($e->getMessage());
@ -72,7 +78,9 @@ function connectInvalidServerWithUser()
$conn = new PDO("sqlsrv:server = invalidServer; $connectionInfo", $user, null);
echo $message . $testCase . PHP_EOL;
} catch(PDOException $e) {
// TODO: check the exception message here
echo "Failed to connect\n";
print_r($e->getMessage());
echo "\n";
}
} catch(PDOException $e) {
print_r($e->getMessage());

View file

@ -0,0 +1,4 @@
<?php
if (getenv('APPVEYOR')) {
die("skip Appveyor pipeline");
}