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

Fix travis script for running tests and fix broken tests #11898

Merged
merged 14 commits into from Jan 2, 2019

Conversation

Projects
None yet
5 participants
@matks
Copy link
Contributor

matks commented Dec 21, 2018

Questions Answers
Branch? develop
Description? Travis indicates a PR is valid event if legacy tests fail because the travis script is wrong
Type? bug fix
Category? TE
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? Travis tests should be green AND the travis logs should display no errors

This change is Reviewable

@matks matks force-pushed the matks:fix-tests-develop branch from e8ead8a to 3d0983b Dec 21, 2018

matks added some commits Dec 21, 2018

@matks matks changed the title Fix travis script for running tests Fix travis script for running tests and fix broken tests Dec 23, 2018

@matks

This comment has been minimized.

Copy link
Contributor Author

matks commented Dec 26, 2018

How to run Travis locally (using docker) to reproduce failing unit tests

$ docker run --name travis-debug -dit travisci/ci-garnet:packer-1512502276-986baf0 /sbin/init
$ docker exec -it travis-debug bash -l 
// in docker
$ su - travis
// as travis user
$ git clone --depth=50 https://github.com/PrestaShop/PrestaShop.git PrestaShop/PrestaShop
$ cd PrestaShop/PrestaShop/
// 11898 is PR number
$ git fetch origin +refs/pull/11898/merge
$ git checkout -qf FETCH_HEAD
$ cp travis-scripts/.composer-auth.json ~/.composer/auth.json
$ bash travis-scripts/setup-php-fpm.sh
$ bash travis-scripts/setup-apache.sh
$ cp tests-legacy/parameters.yml.travis app/config/parameters.yml
$ composer install --prefer-dist --no-interaction
$ bash travis-scripts/install-prestashop
$ bash tests-legacy/check_phpunit.sh

@PierreRambaud PierreRambaud force-pushed the matks:fix-tests-develop branch from c1c3ea4 to c1f626c Dec 27, 2018

Show resolved Hide resolved classes/module/Module.php Outdated
Show resolved Hide resolved classes/module/Module.php Outdated
Show resolved Hide resolved classes/module/Module.php Outdated
Show resolved Hide resolved src/Adapter/Module/ModuleDataProvider.php Outdated
Show resolved Hide resolved src/Adapter/Module/ModuleDataProvider.php Outdated
Show resolved Hide resolved src/Core/Addon/Module/ModuleManager.php Outdated
Show resolved Hide resolved ...estaShopBundle/Controller/Api/Improve/Design/PositionsControllerTest.php
'pscsx32412',
'pscsx3241',

This comment has been minimized.

@eternoendless

eternoendless Dec 31, 2018

Member

Why was the order inverted?

This comment has been minimized.

@PierreRambaud

PierreRambaud Dec 31, 2018

Contributor

Something was broken somewhere in legacy tests :/ Inverted make it work.. It's magic :/

@@ -101,7 +101,7 @@ public function mockContext()
Phake::when($context->customer)->getGroups()->thenReturn(array());
$context->cookie = Phake::mock('Cookie');
$context->country = Phake::mock('Country');
$context->language = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
$context->language = new Language((int) Configuration::get('PS_DETECT_LANG'));

This comment has been minimized.

@eternoendless

eternoendless Dec 31, 2018

Member

Why this change?

This comment has been minimized.

@PierreRambaud

PierreRambaud Dec 31, 2018

Contributor

There is no value in database for PS_LANG_DEFAULT

This comment has been minimized.

@eternoendless

eternoendless Dec 31, 2018

Member

How come? That's usually the first setting to be inserted in DB

This comment has been minimized.

@PierreRambaud

PierreRambaud Dec 31, 2018

Contributor

I knew it was weird. I try to restore the old value. Waiting for ci.

/*
* module: pscsx32412
* date: 2015-07-13 16:05:31
* date: 2018-12-26 14:14:05

This comment has been minimized.

@eternoendless

eternoendless Dec 31, 2018

Member

What's this?

This comment has been minimized.

@PierreRambaud

PierreRambaud Dec 31, 2018

Contributor

This is something which is added when you add override in your module.

matks and others added some commits Dec 31, 2018

@matks

This comment has been minimized.

Copy link
Contributor Author

matks commented Dec 31, 2018

@eternoendless Requested changes have been applied

@eternoendless
Copy link
Member

eternoendless left a comment

LGTM

@PierreRambaud PierreRambaud added this to the 1.7.6.0 milestone Jan 2, 2019

@Quetzacoalt91 Quetzacoalt91 merged commit 5853927 into PrestaShop:develop Jan 2, 2019

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Quetzacoalt91

This comment has been minimized.

Copy link
Member

Quetzacoalt91 commented Jan 2, 2019

Thank you @matks

@matks matks deleted the matks:fix-tests-develop branch Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment