Skip to content

Commit 6e6c3d6

Browse files
authored
Removing hardcoding skip test from pipelines and making changes in tests (#1589)
1 parent 62e87f0 commit 6e6c3d6

11 files changed

Lines changed: 27 additions & 74 deletions

azure-pipelines.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -331,54 +331,6 @@ jobs:
331331
ls -la $(REPO_ROOT)/test/functional/run-tests.php
332332
displayName: 'Get run-tests.php'
333333
334-
#########################################
335-
# Configure Test Skip Files
336-
#########################################
337-
- script: |
338-
set -e
339-
cd $(REPO_ROOT)/test/functional
340-
341-
echo "Configuring skip files for tests that require unavailable features..."
342-
343-
# Skip Chinese locale test (has macOS-specific encoding issues)
344-
if [[ -f "pdo_sqlsrv/pdo_ansi_locale_zh.phpt" ]]; then
345-
mv pdo_sqlsrv/pdo_ansi_locale_zh.phpt pdo_sqlsrv/pdo_ansi_locale_zh.phpt.skip || true
346-
echo "Skipped pdo_ansi_locale_zh.phpt"
347-
fi
348-
349-
# Skip MemoryCheck tests (timeout on macOS CI)
350-
for memtest in sqlsrv/TC81_MemoryCheck.phpt pdo_sqlsrv/PDO81_MemoryCheck.phpt; do
351-
if [[ -f "$memtest" ]]; then
352-
mv "$memtest" "${memtest}.skip" || true
353-
echo "Skipped $memtest (times out on macOS CI)"
354-
fi
355-
done
356-
357-
# Skip large data streaming test (timeout on macOS CI)
358-
if [[ -f "sqlsrv/test_stream_large_data.phpt" ]]; then
359-
mv sqlsrv/test_stream_large_data.phpt sqlsrv/test_stream_large_data.phpt.skip || true
360-
echo "Skipped test_stream_large_data.phpt (times out on macOS CI)"
361-
fi
362-
363-
# Skip tests that cause BORKED errors
364-
for borktest in pdo_sqlsrv/pdo_azure_ad_access_token.phpt pdo_sqlsrv/pdo_connect_encrypt_attributes.phpt; do
365-
if [[ -f "$borktest" ]]; then
366-
mv "$borktest" "${borktest}.skip" || true
367-
echo "Skipped $borktest (causes BORKED error)"
368-
fi
369-
done
370-
371-
# Skip Connection Pooling tests
372-
for pooltest in sqlsrv/sqlsrv_ConnPool_Unix.phpt pdo_sqlsrv/PDO_ConnPool_Unix.phpt; do
373-
if [[ -f "$pooltest" ]]; then
374-
mv "$pooltest" "${pooltest}.skip" || true
375-
echo "Skipped $pooltest (requires ODBC pooling config)"
376-
fi
377-
done
378-
379-
echo "Skip files configured"
380-
displayName: 'Configure Test Skip Files'
381-
382334
#########################################
383335
# Run PHP Functional Tests
384336
#########################################

test/functional/pdo_sqlsrv/PDO81_MemoryCheck.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ emalloc (which only allocate memory in the memory space allocated for the PHP pr
77
PHPT_EXEC=true
88
--SKIPIF--
99
<?php require('skipif_azure_dw.inc'); ?>
10+
<?php if (PHP_OS === 'Darwin') die('skip Memory check test times out on macOS CI'); ?>
1011
--FILE--
1112
<?php
1213
include 'MsCommon.inc';

test/functional/pdo_sqlsrv/PDO_ConnPool_Unix.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This test assumes the default odbcinst.ini has not been modified.
77
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
88
die("Skip test for Linux and Mac only.");
99
}
10+
if (extension_loaded('pdo_odbc')) {
11+
die('skip pdo_odbc extension forces ODBC pooling, interfering with this test');
12+
}
1013
?>
1114
--FILE--
1215
<?php

test/functional/pdo_sqlsrv/pdo_ansi_locale_zh.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ PHPT_EXEC=true
1515
--SKIPIF--
1616
<?php
1717
require('skipif_unix_ansitests.inc');
18+
if (PHP_OS === 'Darwin') {
19+
die("skip Test has encoding issues on macOS");
20+
}
1821
$loc = setlocale(LC_ALL, 'zh_CN.gb18030');
1922
if (empty($loc)) {
2023
die("skip required gb18030 locale not available");

test/functional/pdo_sqlsrv/pdo_connect_encrypt_attributes.phpt

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@ Test various encrypt attributes
44
This test does not test if any connection is successful but mainly test if the Encrypt keyword takes
55
different attributes.
66
--SKIPIF--
7-
<?php
8-
require('skipif.inc');
9-
require_once 'MsSetup.inc';
10-
// Skip on LocalDB which doesn't support Force Encryption
11-
try {
12-
$conn = new PDO("sqlsrv:server = $server;Encrypt=$encrypt", $uid, $pwd);
13-
$stmt = $conn->query("SELECT SERVERPROPERTY('Edition') AS Edition");
14-
$row = $stmt->fetch(PDO::FETCH_ASSOC);
15-
if ($row && strpos($row['Edition'], 'Express') !== false) {
16-
die("skip LocalDB/Express Edition doesn't support Force Encryption");
17-
}
18-
} catch (PDOException $e) {
19-
// If we can't check, assume it might not support encryption
7+
<?php require('skipif_mid-refactor.inc');
8+
$conn = connect();
9+
$stmt = $conn->query("SELECT SERVERPROPERTY('Edition') AS Edition");
10+
$row = $stmt->fetch(PDO::FETCH_ASSOC);
11+
if ($row && strpos($row['Edition'], 'Express') !== false) {
12+
die("skip LocalDB/Express Edition doesn't support Force Encryption");
2013
}
2114
?>
2215
--FILE--

test/functional/pdo_sqlsrv/pdo_connection_resiliency.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ try {
163163
} catch (PDOException $e) {
164164
echo "Error executing statement 6.\n";
165165
$err = $e->getMessage();
166-
if (strpos($err, 'SQLSTATE[08S02]')===false or (strpos($err, 'TCP Provider')===false and strpos($err, 'SMux Provider')===false)) {
166+
if (strpos($err, 'SQLSTATE[08S02]')===false or (strpos($err, 'TCP Provider')===false and strpos($err, 'SMux Provider')===false and strpos($err, 'SSL Provider')===false)) {
167167
echo "Error: Wrong error message.\n";
168168
print_r($err);
169169
}

test/functional/pdo_sqlsrv/pdo_construct_dsn_error.phpt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,15 @@ catch( PDOException $e ) {
105105
}
106106

107107

108-
?>
109-
110-
--EXPECTREGEX--
111-
112-
An extra semi-colon was encountered in the DSN string at character \(byte-count\) position '[0-9]+' \.
113-
An unescaped right brace \(\}\) was found in the DSN string for keyword 'Database'\. All right braces must be escaped with another right brace \(\}\}\)\.
114-
An expected right brace \(\}\) was not found in the DSN string for the value of the keyword 'Database'\.
115-
An invalid value was specified for the keyword 'Database' in the DSN string\.
116-
The DSN string ended unexpectedly\.
117-
An invalid DSN string was specified\.
118-
Server keyword was not specified in the DSN string\.
108+
?>
109+
--EXPECTF--
110+
An extra semi-colon was encountered in the DSN string at character (byte-count) position '%d' .
111+
An unescaped right brace (}) was found in the DSN string for keyword 'Database'. All right braces must be escaped with another right brace (}}).
112+
An expected right brace (}) was not found in the DSN string for the value of the keyword 'Database'.
113+
An invalid value was specified for the keyword 'Database' in the DSN string.
114+
The DSN string ended unexpectedly.
115+
An invalid DSN string was specified.
116+
Server keyword was not specified in the DSN string.
119117

120118
value in curly braces OK
121119
value in curly braces followed by a semicolon OK

test/functional/pdo_sqlsrv/pdo_utf8_conn.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if ($c !== false) {
2222
?>
2323
--EXPECTREGEX--
2424

25-
Fatal error: Uncaught PDOException: SQLSTATE\[(28000|08001|HYT00)\]: .*\[Microsoft\]\[ODBC Driver 1[0-9] for SQL Server\](\[SQL Server\])?(Named Pipes Provider: Could not open a connection to SQL Server \[2\]\. |TCP Provider: Error code (0x2726|0x2AF9)|Login timeout expired|Login failed for user 'sa'\.) in .+(\/|\\)pdo_utf8_conn\.php:[0-9]+
25+
Fatal error: Uncaught PDOException: SQLSTATE\[(28000|08001|08S01|HYT00)\]: .*\[Microsoft\]\[ODBC Driver [0-9]+ for SQL Server\](\[SQL Server\])?(Named Pipes Provider: Could not open a connection to SQL Server \[2\]\. |TCP Provider: Error code (0x[0-9a-fA-F]+)|SSL Provider: .*|Login timeout expired|Login failed for user 'sa'\.) in .+(\/|\\)pdo_utf8_conn\.php:[0-9]+
2626
Stack trace:
2727
#0 .+(\/|\\)pdo_utf8_conn\.php\([0-9]+\): PDO->__construct(\(\)|\('sqlsrv:Server=l\.\.\.', 'sa', ('Sunshine4u'|Object\(SensitiveParameterValue\))\))
2828
#1 {main}

test/functional/sqlsrv/TC81_MemoryCheck.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ PHPT_EXEC=true
88
--SKIPIF--
99
<?php require('skipif_versions_old.inc'); ?>
1010
<?php require('skipif_azure_dw.inc'); ?>
11+
<?php if (PHP_OS === 'Darwin') die('skip Memory check test times out on macOS CI'); ?>
1112
--FILE--
1213
<?php
1314
require_once('MsCommon.inc');

test/functional/sqlsrv/sqlsrv_ConnPool_Unix.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SQLSRV Connection Pooling Test on Unix
44
This test assumes the default odbcinst.ini has not been modified.
55
--SKIPIF--
66
<?php if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') die("Skipped: Test for Linux and Mac"); ?>
7+
<?php if (extension_loaded('pdo_odbc')) die('skip pdo_odbc extension forces ODBC pooling, interfering with this test'); ?>
78
--FILE--
89
<?php
910
function findODBCDriver($content, $lines_to_add)

0 commit comments

Comments
 (0)