Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create appveyor items #72

Merged
merged 73 commits into from
Jan 28, 2017
Merged

Create appveyor items #72

merged 73 commits into from
Jan 28, 2017

Conversation

photodude
Copy link
Contributor

Pull Request for Issue test mssql

Summary of Changes

the php unit file for appveyor DSN items
adds appveyor yml config

Testing Instructions

review with appveyor

Documentation Changes Required

none

@photodude
Copy link
Contributor Author

this is a first draft to attempt appveyor testing, configuration needs to be verified.

@photodude
Copy link
Contributor Author

photodude commented Jan 21, 2017

@mbabker seems the pdo drivers are having some issues with the password and others are not loading

PHP Startup: Unable to load dynamic library 'ext\php_pdo.dll' - The specified module could not be found.
PHP Startup: Unable to load dynamic library 'ext\php_pdo_mssql.dll' - The specified module could not be found.

@mbabker
Copy link
Contributor

mbabker commented Jan 21, 2017

Merge master in here please. I added checks in the test cases to make sure the driver being used for the test is supported on the platform, that should help switch some of the errors to skips.

@photodude
Copy link
Contributor Author

I'll see If I can get master merged in when I get back to my local in a couple of hours (unfortunately, this repo doesn't have the merge base in the web github set up)

@mbabker
Copy link
Contributor

mbabker commented Jan 21, 2017

The tweaks I've made look to have the build environment at least valid now. I put the passwords back into the config, we'll see what happens from here I guess.

@mbabker
Copy link
Contributor

mbabker commented Jan 21, 2017

I'm about to head out for the night, but we're at a state where we now need https://github.com/joomla-framework/database/blob/master/.travis.yml#L40-L43 for the MySQL and PostgreSQL cases to run. Then we just need to sort out the install of php_sqlsrv.dll and php_pdo_mssql.dll (the former because our driver is not a PDO driver and the latter because PHPUnit's DbUnit module requires PDO for its setup processes) and running the same database create statements to set up the SQL Server environment and I think we should be good.

@photodude
Copy link
Contributor Author

photodude commented Jan 22, 2017

Looks like all that is left is the SQL server items, and some windows specific issues in the Postgresql and PDO Postgresql drivers relating to the version number reporting and UTF-8

https://www.appveyor.com/docs/services-databases/#sql-server-2016

@mbabker
Copy link
Contributor

mbabker commented Jan 22, 2017

Try using http://jackstromberg.com/2014/12/how-to-import-large-sql-file-into-mssql-microsoft-sql-server/ to import the database versus the code example that came from the AppVeyor docs. http://stackoverflow.com/questions/8693561/how-to-use-sqlcmd-to-create-a-database might be a good page too.

@photodude
Copy link
Contributor Author

With the last push to fix the power scripting in the yml file; the appvoyer MSSQL is working, just need to tweak the items to point to the right resources. I'll take a look at it and the references you posted when I get back in about 3 hours.

@mbabker
Copy link
Contributor

mbabker commented Jan 22, 2017

So if there's a way to detect the PHP version, you can download the needed DLLs this way:

PHP 7.1:

    - IF %PHP%==1 appveyor DownloadFile https://github.com/Microsoft/msphpsql/releases/download/4.1.5-Windows/7.1.zip
    - IF %PHP%==1 7z x 7.1.zip >nul
    - IF %PHP%==1 copy 7.1\x64\php_pdo_sqlsrv_71_ts.dll ext\php_pdo_sqlsrv_ts.dll
    - IF %PHP%==1 del /Q *.zip

PHP 7.0:

    - IF %PHP%==1 appveyor DownloadFile https://github.com/Microsoft/msphpsql/releases/download/4.1.4-Windows/7.0.zip
    - IF %PHP%==1 7z x 7.0.zip >nul
    - IF %PHP%==1 copy 7.0\x64\php_pdo_sqlsrv_70_ts.dll ext\php_pdo_sqlsrv_ts.dll
    - IF %PHP%==1 del /Q *.zip

It looks like their PHP 5 tags require you to build the extensions yourself, but from searching around there seems to be a source with the built DLLs:

    - IF %PHP%==1 appveyor DownloadFile https://files.nette.org/misc/php-sqlsrv.zip
    - IF %PHP%==1 7z x php-sqlsrv.zip >nul
    - IF %PHP%==1 copy SQLSRV\php_sqlsrv_56_ts.dll ext\php_sqlsrv_ts.dll
    - IF %PHP%==1 copy SQLSRV\php_pdo_sqlsrv_56_ts.dll ext\php_pdo_sqlsrv_ts.dll
    - IF %PHP%==1 del /Q *.zip

@photodude
Copy link
Contributor Author

So I think we can use the php_target_version to "detect" what version we are running on, although after adding the DLL downloads I got a memory exhausted error

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in C:\projects\database\vendor\sebastian\version\src\Version.php on line 135

@photodude
Copy link
Contributor Author

I think the general concept of the Conditionals are correct, but I am not sure if they are executing the commands. I think we should be seeing 1 file(s) copied. after the DLL install IF block when they work.

Additionally, I'm still seeing the memory exhausted error.

@mbabker
Copy link
Contributor

mbabker commented Jan 23, 2017

Well, so far they aren't being copied over correctly because I just enabled the PHP modules and started getting PHP warnings about them being missing. So once those clear that should be a sign we're on the right track.

@photodude
Copy link
Contributor Author

Conditional is now working, but the install of the DLL is failing at the 7z line with
Redirection to 'nul' failed: FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\.\" in the path.

@photodude
Copy link
Contributor Author

Now just need to fix the del /Q *.zip

Remove-Item : A positional parameter cannot be found that accepts argument '*.zip'.
At line:7 char:5
+     del /Q *.zip}

@photodude
Copy link
Contributor Author

These are the new errors I'm seeing

PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_pdo_sqlsrv_ts.dll' - %1 is not a valid Win32 application.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'ext\php_sqlsrv_ts.dll' - %1 is not a valid Win32 application.
 in Unknown on line 0
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in C:\projects\database\vendor\sebastian\version\src\Version.php on line 135

@photodude
Copy link
Contributor Author

Looks like the dll's are not valid win32, maybe we are installing the wrong versions or need to link something in the windows dir

@mbabker
Copy link
Contributor

mbabker commented Jan 23, 2017

It's only the 5.6 DLL that's invalid (so far). The 7.x DLLs still aren't getting registered into PHP correctly.

@photodude
Copy link
Contributor Author

photodude commented Jan 24, 2017

So the "not thread safe versions" of the DLLs are registering with PHP7 now

  • the PHP 5.6 versions are still invalid
  • the PHP 5.6 versions are exceeding the memory
  • SQL Server - Login failed for user 'sa' (DNS issue?)
  • the php 7 versions are not creating the tables for MySQL and PostgreSQL

@photodude
Copy link
Contributor Author

Now that things on PHP 7 are working here are the current results

There were 36 errors:
1) Joomla\Database\Tests\DriverSqlsrvTest::test__destruct
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
2) Joomla\Database\Tests\DriverSqlsrvTest::testConnected
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
3) Joomla\Database\Tests\DriverSqlsrvTest::testDropTable
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
4) Joomla\Database\Tests\DriverSqlsrvTest::testEscape with data set #0 (''%_abc123', false, '''%_abc123')
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
5) Joomla\Database\Tests\DriverSqlsrvTest::testEscape with data set #1 (''%_abc123', true, '''%[_]abc123')
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
6) Joomla\Database\Tests\DriverSqlsrvTest::testGetAffectedRows
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
7) Joomla\Database\Tests\DriverSqlsrvTest::testGetCollation
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
8) Joomla\Database\Tests\DriverSqlsrvTest::testGetExporter
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
9) Joomla\Database\Tests\DriverSqlsrvTest::testGetImporter
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
10) Joomla\Database\Tests\DriverSqlsrvTest::testGetNumRows
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
11) Joomla\Database\Tests\DriverSqlsrvTest::testGetTableCreate
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
12) Joomla\Database\Tests\DriverSqlsrvTest::testGetTableColumns
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
13) Joomla\Database\Tests\DriverSqlsrvTest::testGetTableKeys
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
14) Joomla\Database\Tests\DriverSqlsrvTest::testGetTableList
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
15) Joomla\Database\Tests\DriverSqlsrvTest::testGetVersion
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
16) Joomla\Database\Tests\DriverSqlsrvTest::testInsertid
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
17) Joomla\Database\Tests\DriverSqlsrvTest::testLoadAssoc
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
18) Joomla\Database\Tests\DriverSqlsrvTest::testLoadAssocList
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
19) Joomla\Database\Tests\DriverSqlsrvTest::testLoadColumn
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
20) Joomla\Database\Tests\DriverSqlsrvTest::testLoadObject
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
21) Joomla\Database\Tests\DriverSqlsrvTest::testLoadObjectList
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
22) Joomla\Database\Tests\DriverSqlsrvTest::testLoadResult
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
23) Joomla\Database\Tests\DriverSqlsrvTest::testLoadRow
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
24) Joomla\Database\Tests\DriverSqlsrvTest::testLoadRowList
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
25) Joomla\Database\Tests\DriverSqlsrvTest::testExecute
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
26) Joomla\Database\Tests\DriverSqlsrvTest::testRenameTable
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
27) Joomla\Database\Tests\DriverSqlsrvTest::testSelect
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
28) Joomla\Database\Tests\DriverSqlsrvTest::testSetUtf
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
29) Joomla\Database\Tests\DriverSqlsrvTest::testIsSupported
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
30) Joomla\Database\Tests\DriverSqlsrvTest::testUpdateObject
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
31) Joomla\Database\Tests\IteratorSqlsrvTest::testForEach with data set #0 ('title', '#__dbtest', null, 'stdClass', 0, 0, array(stdClass Object (...), stdClass Object (...), stdClass Object (...), stdClass Object (...)), null)
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
32) Joomla\Database\Tests\IteratorSqlsrvTest::testForEach with data set #1 ('title', '#__dbtest', null, 'stdClass', 2, 0, array(stdClass Object (...), stdClass Object (...)), null)
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
33) Joomla\Database\Tests\IteratorSqlsrvTest::testForEach with data set #2 ('title', '#__dbtest', null, 'stdClass', 20, 2, array(stdClass Object (...), stdClass Object (...)), null)
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
34) Joomla\Database\Tests\IteratorSqlsrvTest::testForEach with data set #3 ('title, id', '#__dbtest', 'title', 'stdClass', 0, 0, array(stdClass Object (...), stdClass Object (...), stdClass Object (...), stdClass Object (...)), null)
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
35) Joomla\Database\Tests\IteratorSqlsrvTest::testForEach with data set #4 ('title', '#__dbtest', 'title', 'UnexistingClass', 0, 0, array(), 'InvalidArgumentException')
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
36) Joomla\Database\Tests\IteratorSqlsrvTest::testCount
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[DELETE_ALL] operation failed on query: 
                DELETE FROM jos_dbtest
             using args: Array
(
)
 [SQLSTATE[42S02]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'jos_dbtest'.]
C:\projects\database\vendor\joomla\test\src\TestDatabase.php:218
--
There were 4 failures:
1) Joomla\Database\Tests\DriverPgsqlTest::testGetCollation
224
Failed asserting that 'English_United States.1252' contains "UTF-8".
C:\projects\database\Tests\DriverPgsqlTest.php:224
2) Joomla\Database\Tests\DriverPgsqlTest::testGetVersion
465
Failed asserting that '9.4.7' is equal to <string:9.4.7,> or is greater than '9.4.7,'.
C:\projects\database\Tests\DriverPgsqlTest.php:465
3) Joomla\Database\Tests\DriverPostgresqlTest::testGetCollation
224
Failed asserting that 'English_United States.1252' contains "UTF-8".
C:\projects\database\Tests\DriverPostgresqlTest.php:224
4) Joomla\Database\Tests\DriverPostgresqlTest::testGetVersion
465
Failed asserting that '9.4.7' is equal to <string:9.4.7,> or is greater than '9.4.7,'.
C:\projects\database\Tests\DriverPostgresqlTest.php:465

@photodude
Copy link
Contributor Author

All that is left to do here is to fix the PHP 5.6 sqlsvr DLLs

@photodude
Copy link
Contributor Author

photodude commented Jan 25, 2017

I've fixed the php 5.6 with MSSQL by forcing PHP to an x86 install rather than the default x64. Apparently, the PHP 5.6 MSSQL DLL's only come in a x86 version. (PHP 7+ is still x64 since that is valid)

Unless there are other needed changes, this can be merged now; even though the builds are failing from specific problems with our drivers on windows.

only need to check once If ($env:PHP -eq "1") for the block of echo's
multiple errors of the following type
```bat
The output stream for this command is already redirected
```
We no longer need this debug info as we solved the DLL load issue by using the right file version
Information based on the references below
It seems that PHPUnit deletes the content of the table in question before setting up the table to execute a test. That only works, if the table already exists. Therefore I’ve added a create table jos_dbtest statement with the PDO to fix the issue

PHP unit will perform a ‘clean insert’ operation on our database using the the dataset returned by getDataSet. The clean insert operation will truncate or delete_all any tables in the data set (not all tables in the database) and then insert the rows in the dataset. The solution is to create the table before running the test.

Additionally we can modify the default functionality by overriding the getSetUpOperation() and getTearDownOperation() methods

- https://andreas.heigl.org/2015/08/16/database-testing-with-phpunit-and-sqlite/
- http://stackoverflow.com/questions/10948273/loading-schema-from-sql-file-in-phpunit-test
@photodude
Copy link
Contributor Author

e4f85d5 fixes the MSSQL errors related to PHPunit and closes #74

@photodude
Copy link
Contributor Author

Odd Travis just failed, but HHVM didn't run as an allowed failure... Travis must be having a moment.

@mbabker mbabker merged commit 2319805 into joomla-framework:master Jan 28, 2017
@photodude photodude deleted the patch-10 branch January 28, 2017 17:23
@photodude
Copy link
Contributor Author

@mbabker please add the appveyor badge to the readme, the code for the badge is in the appveyor repo and only the repo owner can get it.

@mbabker
Copy link
Contributor

mbabker commented Jan 28, 2017

Done - dc06343

@photodude
Copy link
Contributor Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants