Skip to content
This repository was archived by the owner on Sep 22, 2019. It is now read-only.

Fix Travis CI build #10

Merged
merged 1 commit into from
Aug 31, 2019
Merged

Conversation

peter279k
Copy link
Contributor

Changed log

  • Fix Travis CI build.
  • Let the php-7.2 remove from allow_failures setting because this version is stable and should be successful.
  • Add php-7.3 test because this version is stable.
  • In the dist Xenial, it should add the services setting to setup the MySQL service.
  • Since this Travis CI blog post is published, the default dist is Xenial.
    To support php-5.4 and php-5.5 version tests completely, it should setup the trusty dist for these versions.

@peter279k
Copy link
Contributor Author

peter279k commented Aug 27, 2019

The Travis CI build result is failed due to following error message:

1) HTTP_AYO_Tests::test_api_check_in_various_scenario with data set #0 ('Case 0', null, true)
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'option_value' cannot be null
/home/travis/build/YOURLS/YOURLS-unit-tests/YOURLS/includes/vendor/aura/sql/src/ExtendedPdo.php:748
/home/travis/build/YOURLS/YOURLS-unit-tests/YOURLS/includes/vendor/aura/sql/src/ExtendedPdo.php:306
/home/travis/build/YOURLS/YOURLS-unit-tests/YOURLS/includes/Database/Options.php:163
/home/travis/build/YOURLS/YOURLS-unit-tests/YOURLS/includes/functions.php:1152
/home/travis/build/YOURLS/YOURLS-unit-tests/tests/http/api-check.php:216
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/Framework/TestCase.php:908
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/Framework/TestCase.php:768
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/Framework/TestResult.php:612
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/Framework/TestCase.php:724
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php:722
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php:722
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/Framework/TestSuite.php:722
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:440
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/TextUI/Command.php:149
/home/travis/build/YOURLS/YOURLS-unit-tests/vendor/phpunit/phpunit/src/TextUI/Command.php:100

It seems that the test case or test codes are failed when PHPUnit executes unit tests.

We should check the test codes and we can make sure that the Travis CI build script and setting are worked fine.

And according to this PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'option_value' cannot be null message, I think this table schema for this option_value should not be null.

To pass this test, I guess we can let this column can be null.

@ozh
Copy link
Member

ozh commented Aug 27, 2019

We can remove PHP prior to 5.6, to match YOURLS reqs

I'm really wondering why all of a sudden test fails when the option table is passed a null value.... This has worked for ages....

@LeoColomb
Copy link
Member

This has worked for ages

Since then, third party software (specifically MySQL and PHPUnit) has been updated and brought incompatibilities...

@peter279k
Copy link
Contributor Author

This has worked for ages

Since then, third party software (specifically MySQL and PHPUnit) has been updated and brought incompatibilities...

@LeoColomb , thanks for your reply. I will check that at my available time and try to fix them :).

@LeoColomb
Copy link
Member

LeoColomb commented Aug 29, 2019

try to fix them

Wow, thanks! That would be awesome!

@peter279k peter279k force-pushed the fix_travis_ci branch 3 times, most recently from b2eae0d to 1e58d73 Compare August 30, 2019 17:42
@peter279k
Copy link
Contributor Author

peter279k commented Aug 30, 2019

Hi @ozh , @LeoColomb, finally, I've fixed the failed Travis CI build.

Let me explain each error and how I fix.

HTTP_AYO_Tests::test_api_check_in_various_scenario with data set #0 ('Case 0', null, true)
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'option_value' cannot be null

This error message is straightforward and the problem is about table option_value column.
The option_value column is defined as a ......option_value longtext NOT NULL,........
The current fix is to let these test cases be empty string, not null.
I think we don't need to let this column accept null.

Function create_function() is deprecated

This will happen on php-7.2+ version because this function is deprecated.
Using the anonymous function instead.

  • Using the PHPUnit ^5.7 version because the php-7.x uses low PHPUnit version will cause PHP Deprecated: The each() function is deprecated. This message will be suppressed on further calls .... error message.

Copy link
Member

@LeoColomb LeoColomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many unrelated space changes, but that's OK, LGTM 👍

A huge thanks, @peter279k, very nice contribution!

@ozh ozh merged commit dccc12a into YOURLS:master Aug 31, 2019
@peter279k peter279k deleted the fix_travis_ci branch August 31, 2019 08:56
@ozh ozh mentioned this pull request Sep 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants