Extension Development - The cloud is the limit! (T3EE15)

1,008 views

Published on

Some people might think that extension development is hard, but it does not need to be. How do we make it easier? How can one ensure that the quality is kept? without running the full-scale QA engine. There are a lots of tools that one can use for free in the cloud. The primary topic for this talk will be Travis CI and the tools one can use together with it.

Video of presentation can be found here:
https://youtu.be/_hCOIxlxb8k

Published in: Internet
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,008
On SlideShare
0
From Embeds
0
Number of Embeds
79
Actions
Shares
0
Downloads
6
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Extension Development - The cloud is the limit! (T3EE15)

  1. 1. November 14th, 2015 Extension Development The cloud is the limit!
  2. 2. November 14th, 2015 • Introduction • Extension Development • Travis CI • Scrutinizer • Examples • Questions
  3. 3. November 14th, 2015 Tomas Norre Mikkelsen
 • TYPO3 - 2004 (Version: 3.6) • AOE - June 2013 • TYPO3.org, TER, Crawler, PHPUnit • Golf, #t3runners • @tomasnorre •
  4. 4. November 14th, 2015 Some people might think that extension development is hard, but it does not need to be!
  5. 5. November 14th, 2015 Working with Open Source • Pull request (patches) • Code Reviews • Code Tests / Validation
  6. 6. November 14th, 2015 • PHP Unit (Unit / Functional tests) • PHP Linting • JavaScript Linting • TypoScript Linting • XML Linting Toolset
  7. 7. November 14th, 2015 Developers are lazy
  8. 8. November 14th, 2015 How can this be solved? Client-specific Extensions Open Source Extensions
  9. 9. November 14th, 2015 The benefits of using Github • “All” have an account • Public code • Pull requests • Get feedback • Issue tracking • Wiki page • Travis CI integration (free) • Scrutinizer integration (free)
  10. 10. November 14th, 2015 Travis
  11. 11. November 14th, 2015
  12. 12. November 14th, 2015
  13. 13. November 14th, 2015
  14. 14. November 14th, 2015
  15. 15. November 14th, 2015 Scrutinizer CI
  16. 16. November 14th, 2015
  17. 17. November 14th, 2015
  18. 18. November 14th, 2015
  19. 19. November 14th, 2015 How to use it?
  20. 20. November 14th, 2015 Extension t3ee_example https://github.com/tomasnorre/t3ee_example • Simple Domain Model • Unit / Functional Test Coverage • Xliff, TypoScript, JavaScript • Travis CI • Scrutinizer
  21. 21. November 14th, 2015 Version Metrics PHP/ TYPO3 6.2.15 7.6 (LTS) dev-master 5.4 x - - 5.5 x x (c) ? 5.6 x x ? 7.0 ? ? ? hhvm x x ?
  22. 22. November 14th, 2015
  23. 23. November 14th, 2015
  24. 24. November 14th, 2015 .travis.yml
  25. 25. November 14th, 2015 php: - 5.4 - 5.5 - 5.6 - 7.0 - hhvm env: - TYPO3_VERSION=6.2.15 COVERAGE=0 - TYPO3_VERSION=7.6 COVERAGE=0 - TYPO3_VERSION=dev-master COVERAGE=0 Which versions to use?
  26. 26. November 14th, 2015 matrix: exclude: - env: TYPO3_VERSION=7.6 COVERAGE=0 php: 5.4 - env: TYPO3_VERSION=dev-master COVERAGE=0 php: 5.4 include: - php: 5.5 env: TYPO3_VERSION=7.6 COVERAGE=1 allow_failures: - env: TYPO3_VERSION=dev-master COVERAGE=0 - php: 7.0 Exclude/Include matrix
  27. 27. November 14th, 2015 addons: apt: packages: - parallel - libxml2-utils - nodejs - npm cache: directories: - $HOME/.composer/cache before_install: - composer self-update - composer --version What do we need to run the planned test? 1/3
  28. 28. November 14th, 2015 before_script: - composer require typo3/cms=$TYPO3_VERSION # Install TypoScript Linter - mkdir -p scripts - cd scripts - git clone https://github.com/tomasnorre/ typo3-typoscript-lint.git tslint - cd tslint - composer install - cd ../../ # Restore composer.json - git checkout composer.json - export TYPO3_PATH_WEB=$PWD/.Build/Web What do we need to run the planned test? 2/3
  29. 29. November 14th, 2015 # Before-script continued # Locating UnitTests.xml - export "UNIT_XML"=`find . -name 'UnitTests.xml' -type f` # Location FunctionalTests.xml - export "FUNCTIONAL_XML"=`find . -name 'FunctionalTests.xml' -type f` What do we need to run the planned test? 3/3
  30. 30. November 14th, 2015 Still awake?
  31. 31. November 14th, 2015 echo; echo "Running xmllint (Xliff)"; find Resources/Private/Language/ -name ’*.xlf' -type f | xargs xmllint --noout --schema Misc/ Validation/Xliff.xsd Linting | Xliff
  32. 32. November 14th, 2015 echo; echo "Running php lint"; find . -name *.php ! -path "./.Build/*" ! - path "./scripts/*" ! -path "./typo3_src/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null ; Linting | PHP
  33. 33. November 14th, 2015 echo; echo "Running JavaScript lint"; npm install -g jslint; find Resources/Public/JavaScript/ -name '*.js' -type f | xargs jslint Linting | JavaScript
  34. 34. November 14th, 2015 Linting | TypoScript
  35. 35. November 14th, 2015 Dreaming?
  36. 36. November 14th, 2015 PHPUnit (Unit) if [[ "$COVERAGE" == "1" ]]; then echo; echo "Running unit tests"; .Build/bin/phpunit --coverage-clover=unittest-coverage.clover --colors -c $UNIT_XML Tests/Unit/ fi
  37. 37. November 14th, 2015 PHPUnit (Functional) if [[ "$COVERAGE" == "1" ]]; then echo; echo "Running functional tests"; export typo3DatabaseName="typo3"; export typo3DatabaseHost="localhost"; export typo3DatabaseUsername="root"; export typo3DatabasePassword=""; find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --coverage-clover={} functionaltest-coverage.clover --colors -c $FUNCTIONAL_XML {}' fi
  38. 38. November 14th, 2015 Scrutinizer Upload if [[ "$COVERAGE" == "1" ]]; then echo; echo "Uploading code coverage results"; wget https://scrutinizer-ci.com/ocular.phar php ocular.phar code-coverage:upload -- format=php-clover unittest-coverage.clover find 'Tests/Functional' -wholename '*Test.php' -exec php ocular.phar code-coverage:upload -- format=php-clover {}functionaltest- coverage.clover ; fi
  39. 39. November 14th, 2015 .scrutinizer.yml
  40. 40. November 14th, 2015 Scrutinizer (.scrutinizer.yml) tools: external_code_coverage: timeout: 700 runs: 1 php_code_sniffer: enabled: true config: standard: TYPO3CMS php_cs_fixer: enabled: true php_mess_detector: enabled: true config: controversial_rules: superglobals: false
  41. 41. November 14th, 2015
  42. 42. November 14th, 2015
  43. 43. November 14th, 2015 PHP Unit • 15 Unit tests run • 1 Functional test run Lint Tests • 15 Xliff Runs • 15 PHP Runs • 15 TypoScript Runs • 15 Javascript Runs Total • 76 Test runs Scrutinizer • Code Coverage • Code Sniffer • Mess Detection Test coverage
  44. 44. November 14th, 2015 The cloud is the limit!
  45. 45. November 14th, 2015 Questions? @tomasnorre tomas.mikkelsen@aoe.com
  46. 46. November 14th, 2015 • https://github.com/tomasnorre/t3ee_example • https://travis-ci.org/ • https://scrutinizer-ci.com/ • https://github.com/tomasnorre/typo3-typoscript-lint Done by: Martin Helmich Links

×