Shippable / support

Shippable SaaS customers can report issues and feature requests in this repository
101 stars 28 forks source link

Shippable does not display phpunit test results... #1557

Closed pennyarcade closed 8 years ago

pennyarcade commented 9 years ago

Hello Team,

I followed the documentation very closely to set up phpunit tests (among others) with shippable using the '--log-junit' option and the '--coverage.xml' option. I am using the standard image for now. My coverage results are displayed correctly and the phpunit output looks ok, too. (Failing as expected) Sadly I can't seem to get the phpunit results displayed in the testresults tab. I tried different filenames and triplechecked output directory and format. Please help.

Also my composer update fails when I turn caching on. It gets a permission denied on the cache directory. File permissions are OK, there might be an Issue of files already being open that I can't reproduce locally. I am trying to test a small Symfony application. The intendet result should be saving build time by caching but keeping dependencies up to date. Update: This only happens for the buildin global composer. I have no errors when using my own composer.phar in the project directory.

Third and least important, I'd like to also display my code sniffer results of PHPMD and PHPCS in the testresults tab. The output is set to xml, too.

Here is an example build with the above problems : https://app.shippable.com/builds/55812bf06cde2e0c0077a5b7 (Build 43)

Here is my shippable.yml for reference:

cache: true

# language setting
language: php

# php tag
php:
    # only test one php version until problems are solved.
    #- 5.3
    #- 5.4
    #- 5.5
    - 5.6
    #- hhvm

before_install:
    - cd imgboard
    # make sure the directories are writable (this shouldn't be nessessary and doesn't solve the problem!)
    - sudo chmod 777 -R app/cache
    - sudo chmod 777 -R app/logs
    # update composer (works fine)
    - php ./composer.phar selfupdate

install:
    # update dependencies (fails with obscure permission denied error when using builtin composer)
    # composer update
    - php ./composer.phar update
    - cd ..

before_script:
    # make sure the result folders exist
    - mkdir -p shippable/codecoverage
    - mkdir -p shippable/testresults
    - cd imgboard

script:
    # don't fail for code smells (|| true)
    # PHP mess detector HTML output for offline use
    - bin/phpmd src/ html cleancode,codesize,controversial,design,naming,unusedcode --reportfile ../shippable/testresults/phpmd.html --strict || true
    # PHP mess detector xml output to be displayed in testresults tab
    - bin/phpmd src/ xml cleancode,codesize,controversial,design,naming,unusedcode --reportfile ../shippable/testresults/phpmd.xml --strict || true
    # PHP CS text output for offline use only until above works
    - bin/phpcs --report-file=../shippable/testresults/phpcs.txt src/ || true
    # PHPUNIT Tests anc code coverage in different formats for display in testresults tab and for offline use
    - phpunit -c app/ --log-junit ../shippable/testresults/phpunit.xml --coverage-xml ../shippable/codecoverage --coverage-html ../shippable/codecoverage --testdox-html ../shippable/testresults/junit.html

after_script:
    # Prove the files were written correctly
    - cd ..
    - ls -a shippable/testresults
    - cat shippable/testresults/junit.xml
    # check in test results for offline use 
    - git add shippable
    - git add imgboard/composer.*
    # suppress infinite loop on ci
    - git commit -m 'update test results [skip ci]'
    - git push

notifications:
    email: false

Thank you very much for your help.

Martin

jdextraze commented 9 years ago

I also have this issue. Example build: https://app.shippable.com/builds/5581b0dd3d07800f0005ad74

benscholler commented 9 years ago

Bump. I'm encountering this issue as well. I used the example given in the docs. Command I'm running:

phpunit --log-junit shippable/testresults/junit.xml --coverage-xml shippable/codecoverage
manishas commented 8 years ago

This should be fixed with our recent build platform upgrade. Please let us know if you still run into this after your account is upgraded.

jdextraze commented 8 years ago

I'm still not seeing the tests results. Example build: https://app.shippable.com/runs/57071d133fa7e60d005fe887

manishas commented 8 years ago

@ric03uec we need to look at this asap.

jdextraze commented 8 years ago

Any ETA on this issue?

ric03uec commented 8 years ago

@jdextraze i see the following logs for the build link you posted above image

this means that there are no files in shippable/testresults and shippable/codecoverage folders because of which the report parser is returning null results for each. We have tested junit test parsing to be working correctly so this seems to be the most probable issue. Can you please verify that the folders have valid xml files.

jdextraze commented 8 years ago

Thanks, got it to work

manishas commented 8 years ago

@jdextraze thanks for confirming it works. Closing this issue.