dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 441 forks source link

PHPCI not showing phpunit result #1330

Open simonchillier opened 7 years ago

simonchillier commented 7 years ago

Hi,

when I am running a build in my PHPCI environment, everything work fine... but just a small problem with the php_unit plugins. Is not showing the tests results

Here the build log Cloning into '/Users/xxxx/Projects/phpci/PHPCI/build/138_f2255'...

Working copy created: / RUNNING PLUGIN: php_unit PLUGIN: SUCCESS RUNNING PLUGIN: php_code_sniffer PLUGIN: SUCCESS BUILD SUCCESS RUNNING PLUGIN: email 1 emails sent 0 emails failed to send PLUGIN: SUCCESS Removing Build.

Here my phpci.yml

build_settings:

   verbose: true
    clone_depth: 2
    ignore:
        - "3rdparty"
        - "certs"
        - "SQL_changes"
        - "assets"
    mysql:
        host: "xxx"
        user: "xxx"
        pass: "xxxx"

test:

    php_unit:
        config:
            - "phpunit.xml"
        coverage: "build/coverage"
    php_code_sniffer:
        path: "certs"
        standard: "PSR1,PSR2"
        allowed_warnings: 999
        allowed_errors: 999

complete:
    email:
        default_mailto_address: xxx@xxx.com

Here my phpunit.xml

<phpunit>
    <testsuites>
        <testsuite name="Test suite">
            <directory>/Users/xxx/Projects/xxx/phpunit/</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory>/Users/xxx/Projects/xxx/phpunit</directory>
        </whitelist>
    </filter>
    <logging>
       <log type="json" target="/Users/xxx/Projects/xxx/logs/logfile.json"/>
    </logging>
</phpunit>

Here my test

final class LoginTest extends TestCase
{

    public function testLoginEnergyCloud2()
    {
    $this->assertEquals(
            [1, 2, 33, 4, 5, 6], 
            [1, 2, 3, 4, 5, 6]
        );

    }
}

The test should be return a Failure result. When I am run manually the test, with this command : phpunit --configuration /Users/xxx/Projects/xxx/phpunit.xml is working correctly and i receive a test failure result.

I did something wrong but I don't know why. Is a log file for PHPCI ? while my logging in my phpunit config file is not working properly (the file logfile.json is empty)

Thanks Simon

Ooypunk commented 7 years ago

Have you checked the "Information" tab?

Logfile being empty: curious. Could it be that PHPCI intercepts the output?

simonchillier commented 7 years ago

yes I checked the information tab. I will continue my research and keep you in touch.

Thanks