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

Implement continuous integration on Travis #37

Closed
whikloj opened this issue Mar 27, 2019 · 7 comments
Closed

Implement continuous integration on Travis #37

whikloj opened this issue Mar 27, 2019 · 7 comments
Assignees

Comments

@whikloj
Copy link
Contributor

whikloj commented Mar 27, 2019

Guessing it would be good to make sure this builds in multiple PHP versions. A simple travis matrix would allow it to check that it installs and that your tests pass.

@mjordan
Copy link
Owner

mjordan commented Mar 27, 2019

@whikloj great idea, I will add that.

@mjordan mjordan self-assigned this Mar 27, 2019
@whikloj
Copy link
Contributor Author

whikloj commented Mar 27, 2019

@mjordan I have a simple travis setup in my branch for #35 to ensure it works. Currently its failing on code sniffer. So I might have some of those fixes too.
https://travis-ci.org/whikloj/riprap

@whikloj
Copy link
Contributor Author

whikloj commented Mar 27, 2019

I can't seem to run your tests, is there something I might need to do first?

@mjordan
Copy link
Owner

mjordan commented Mar 28, 2019

What is the output from ./bin/phpunit?

@whikloj
Copy link
Contributor Author

whikloj commented Mar 28, 2019

[/sw/var/www/DAM2/riprap] 
> ./bin/phpunit
zsh: no such file or directory: ./bin/phpunit

Should phpunit be a dev requirement of the riprap?

Instead I was running it using my installed phpunit, which could be the problem.

> phpunit -v    
PHPUnit 7.4.0 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.26
Configuration: /sw/var/www/DAM2/riprap/phpunit.xml

Testing Project Test Suite
EEsh: /usr/bin/sha1sum: No such file or directory
E....                                                             7 / 7 (100%)

Time: 241 ms, Memory: 18.00MB

There were 3 errors:

1) App\Tests\Command\CheckFixityCommandTest::testExecute
Symfony\Component\Yaml\Exception\ParseException: File "resources/sample_csv_config.yml" does not exist.

/sw/var/www/DAM2/riprap/src/Command/CheckFixityCommand.php:47
/sw/var/www/DAM2/riprap/vendor/symfony/console/Command/Command.php:255
/sw/var/www/DAM2/riprap/vendor/symfony/console/Tester/CommandTester.php:76
/sw/var/www/DAM2/riprap/tests/Command/CheckFixityCommandTest.php:26

2) App\Tests\Controller\FixityControllerTest::testGetResponseCode
Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (fe80::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?

/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php:73
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:169
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:155
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php:48
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:356
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:420
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:380
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:324
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:789
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:619
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:162
/sw/var/www/DAM2/riprap/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:305
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78
/sw/var/www/DAM2/riprap/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:183
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:283
/sw/var/www/DAM2/riprap/vendor/doctrine/doctrine-bundle/Repository/ContainerRepositoryFactory.php:45
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:713
/sw/var/www/DAM2/riprap/src/Plugin/PluginPersistToDatabase.php:61
/sw/var/www/DAM2/riprap/src/Controller/FixityController.php:43
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/HttpKernel.php:150
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/HttpKernel.php:67
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/Kernel.php:198
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/Client.php:68
/sw/var/www/DAM2/riprap/vendor/symfony/framework-bundle/Client.php:131
/sw/var/www/DAM2/riprap/vendor/symfony/browser-kit/Client.php:405
/sw/var/www/DAM2/riprap/tests/Controller/FixityControllerTest.php:12

Caused by
Doctrine\DBAL\Driver\PDOException: SQLSTATE[08006] [7] could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (fe80::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?

/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php:27
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:356
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:420
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:380
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:324
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:789
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:619
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:162
/sw/var/www/DAM2/riprap/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:305
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78
/sw/var/www/DAM2/riprap/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:183
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:283
/sw/var/www/DAM2/riprap/vendor/doctrine/doctrine-bundle/Repository/ContainerRepositoryFactory.php:45
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:713
/sw/var/www/DAM2/riprap/src/Plugin/PluginPersistToDatabase.php:61
/sw/var/www/DAM2/riprap/src/Controller/FixityController.php:43
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/HttpKernel.php:150
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/HttpKernel.php:67
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/Kernel.php:198
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/Client.php:68
/sw/var/www/DAM2/riprap/vendor/symfony/framework-bundle/Client.php:131
/sw/var/www/DAM2/riprap/vendor/symfony/browser-kit/Client.php:405
/sw/var/www/DAM2/riprap/tests/Controller/FixityControllerTest.php:12

Caused by
PDOException: SQLSTATE[08006] [7] could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (fe80::1) and accepting
	TCP/IP connections on port 5432?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 5432?

/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php:27
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:356
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:420
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:380
/sw/var/www/DAM2/riprap/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:324
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:789
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:619
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:162
/sw/var/www/DAM2/riprap/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:305
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78
/sw/var/www/DAM2/riprap/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:183
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:283
/sw/var/www/DAM2/riprap/vendor/doctrine/doctrine-bundle/Repository/ContainerRepositoryFactory.php:45
/sw/var/www/DAM2/riprap/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:713
/sw/var/www/DAM2/riprap/src/Plugin/PluginPersistToDatabase.php:61
/sw/var/www/DAM2/riprap/src/Controller/FixityController.php:43
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/HttpKernel.php:150
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/HttpKernel.php:67
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/Kernel.php:198
/sw/var/www/DAM2/riprap/vendor/symfony/http-kernel/Client.php:68
/sw/var/www/DAM2/riprap/vendor/symfony/framework-bundle/Client.php:131
/sw/var/www/DAM2/riprap/vendor/symfony/browser-kit/Client.php:405
/sw/var/www/DAM2/riprap/tests/Controller/FixityControllerTest.php:12

3) App\Plugin\PluginFetchDigestFromShellTest::testPluginFetchDigestFromShell
Error: Call to a member function warning() on null

/sw/var/www/DAM2/riprap/src/Plugin/PluginFetchDigestFromShell.php:58
/sw/var/www/DAM2/riprap/tests/Plugin/PluginFetchDigestFromShellTest.php:22

ERRORS!
Tests: 7, Assertions: 7, Errors: 3.

Remaining deprecation notices (2)

  1x: The "Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand" class is deprecated since Symfony 4.2, use "Symfony\Component\Console\Command\Command" with dependency injection instead.
    1x in CheckFixityCommandTest::testExecute from App\Tests\Command

  1x: The "App\Command\CheckFixityCommand" class extends "Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand" that is deprecated since Symfony 4.2, use {@see Command} instead.
    1x in CheckFixityCommandTest::testExecute from App\Tests\Command

@whikloj
Copy link
Contributor Author

whikloj commented Mar 28, 2019

Okay I did some reading and now I see I should be running

./vendor/bin/simple-phpunit

which installs phpunit and seems to result in the same errors as above.

mjordan added a commit that referenced this issue Mar 31, 2019
@mjordan
Copy link
Owner

mjordan commented Mar 31, 2019

Resolved with e182620. Thanks @whikloj.

@mjordan mjordan closed this as completed Mar 31, 2019
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

No branches or pull requests

2 participants