When building a project from the composer create-project command as suggested in the documentation, the resulting build will not be green in Travis CI. I know there is some handling necessary (like some execution permissions and building your auth.json) but when all is set, still all kinds of tests fail
Magento 2.2 installed from composer repository
PHP 7.1
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2cd magento2 && git init && git remote add origin https://github.com/SemExpert/magento2-composer-built.gitchmod +x dev/travis/*.sh.travis.yml, add auth.json setup according to https://gordonlesti.com/magento2-extension-development-with-travis-ci/.travis.yml, remove PHP 7.0 from matrix and add execution permission to dev/travis/before_script.sh in before_script sectioncd magento2 && composer installcd magento2 && git add . && git commit -m "commit" && git pushPlease provide a place in official documentation suggesting Travis usage like described.
@orlangur There is no mention on how to use Travis in the documentation. I am trying to self-discover this process in the hopes of actually writing such missing documentation. My current attempt is trying to use the travis file as it is provided by Magento, ideally, without modifications.
The few modifications made were to circumvent the initialization errors as they showed up, up to the point where tests were actually run.
before_install.sh and before_script.sh would not run without manually granting execution permissionsauth.json with my credentials to be able to pull packages from Magento repositoryEven if this attempt is completely invalidated and Magento does no expect developers to use the provided .travis.yml and instead create their own, still, all tests fail when running them as described in this documentation http://devdocs.magento.com/guides/v2.2/test/testing.html in the same ways described in the linked Travis report.
At this moment, the whole test suite is of little use to agencies trying to build a CI process (using Travis or any other tool) as it fails out of the box.
Summary of the errors, for your convenience:
Unit tests 1 error 6 failures
Magento\Setup\Test\Unit\Module\Di\Code\Reader\FileClassScannerTest::testClassKeywordInMiddleOfFileMagento\ProductVideo\Test\Unit\Controller\Adminhtml\Product\Gallery\RetrieveImageTest::testExecuteMagento\Framework\Api\Test\Unit\Code\Generator\GenerateMapperTest::testGenerateMagento\Framework\Code\Test\Unit\Generator\InterfaceGeneratorTest::testGenerate with data set "Valid data" (array(), '', '')Magento\Framework\ObjectManager\Test\Unit\Code\Generator\FactoryTest::testGenerateMagento\Framework\ObjectManager\Test\Unit\Code\Generator\GenerateRepositoryTest::testGenerate with data set #0 ('Magento\Framework\ObjectManag...sitory', 'Magento\Framework\ObjectManag...Sample', 'SampleRepository')Magento\Framework\ObjectManager\Test\Unit\Code\Generator\GenerateRepositoryTest::testGenerate with data set #1 ('Magento\Framework\ObjectManag...sitory', 'Magento\Framework\ObjectManag...Sample', 'TSampleRepository')Static tests 2 files with 39 errors
vendor/shopialfb/facebook-module/Controller/Adminhtml/Index/Index.phpvendor/shopialfb/facebook-module/view/adminhtml/templates/connect_facebook_view.phtmlJS Spec All green =)
JS Static Extreme number of errors. No summary is provided
* Integration tests* 5 failures
Magento\Framework\Code\GeneratorTest::testGenerateClassFactoryWithNamespaceMagento\Framework\Code\GeneratorTest::testGenerateClassProxyWithNamespaceMagento\Framework\Code\GeneratorTest::testGenerateClassInterceptorWithNamespaceMagento\Framework\Code\GeneratorTest::testGenerateClassExtensionAttributesInterfaceFactoryWithNamespaceMagento\Ui\Component\ConfigurationTest::testConfigurationFuncional tests Timeout
You cannot expect green builds using Travis configuration the way it is not used (= enforced) in core.
First unit test failure was fixed recently in https://github.com/magento/magento2/pull/12144.
vendor/shopialfb
Not even a part of this repository.
all tests fail when running them as described in this documentation http://devdocs.magento.com/guides/v2.2/test/testing.html in the same ways described in the linked Travis report
Only in case of Composer-based installation which is not a part of CICD loop currently. Feel free to report concrete issues similar to https://github.com/magento/magento2/issues/11230 and/or contribute corresponding fixes as pull requests.
Most helpful comment
@orlangur There is no mention on how to use Travis in the documentation. I am trying to self-discover this process in the hopes of actually writing such missing documentation. My current attempt is trying to use the travis file as it is provided by Magento, ideally, without modifications.
The few modifications made were to circumvent the initialization errors as they showed up, up to the point where tests were actually run.
before_install.shandbefore_script.shwould not run without manually granting execution permissionsauth.jsonwith my credentials to be able to pull packages from Magento repositoryEven if this attempt is completely invalidated and Magento does no expect developers to use the provided
.travis.ymland instead create their own, still, all tests fail when running them as described in this documentation http://devdocs.magento.com/guides/v2.2/test/testing.html in the same ways described in the linked Travis report.At this moment, the whole test suite is of little use to agencies trying to build a CI process (using Travis or any other tool) as it fails out of the box.
Summary of the errors, for your convenience:
Unit tests 1 error 6 failures
Magento\Setup\Test\Unit\Module\Di\Code\Reader\FileClassScannerTest::testClassKeywordInMiddleOfFileMagento\ProductVideo\Test\Unit\Controller\Adminhtml\Product\Gallery\RetrieveImageTest::testExecuteMagento\Framework\Api\Test\Unit\Code\Generator\GenerateMapperTest::testGenerateMagento\Framework\Code\Test\Unit\Generator\InterfaceGeneratorTest::testGenerate with data set "Valid data" (array(), '', '')Magento\Framework\ObjectManager\Test\Unit\Code\Generator\FactoryTest::testGenerateMagento\Framework\ObjectManager\Test\Unit\Code\Generator\GenerateRepositoryTest::testGenerate with data set #0 ('Magento\Framework\ObjectManag...sitory', 'Magento\Framework\ObjectManag...Sample', 'SampleRepository')Magento\Framework\ObjectManager\Test\Unit\Code\Generator\GenerateRepositoryTest::testGenerate with data set #1 ('Magento\Framework\ObjectManag...sitory', 'Magento\Framework\ObjectManag...Sample', 'TSampleRepository')Static tests 2 files with 39 errors
vendor/shopialfb/facebook-module/Controller/Adminhtml/Index/Index.phpvendor/shopialfb/facebook-module/view/adminhtml/templates/connect_facebook_view.phtmlJS Spec All green =)
JS Static Extreme number of errors. No summary is provided
* Integration tests* 5 failures
Magento\Framework\Code\GeneratorTest::testGenerateClassFactoryWithNamespaceMagento\Framework\Code\GeneratorTest::testGenerateClassProxyWithNamespaceMagento\Framework\Code\GeneratorTest::testGenerateClassInterceptorWithNamespaceMagento\Framework\Code\GeneratorTest::testGenerateClassExtensionAttributesInterfaceFactoryWithNamespaceMagento\Ui\Component\ConfigurationTest::testConfigurationFuncional tests Timeout