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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Travis] Running JavaScript tests #3055

Merged
merged 10 commits into from Sep 17, 2015

Conversation

Projects
None yet
3 participants
@pamil
Member

pamil commented Jul 17, 2015

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets #3241
License MIT

Main changes:

  • Javascript based scenarios are executed since now
  • Repaired a few old and rusty Behat scenarios
  • Fixed #3241

Changes made by-the-way:

  • MongoDB won't install if not needed
  • PHP7 tests are running now (and passing, PhpSpec omitted) 馃帀
  • On failure, logs and screenshots will be provided (based on Lakion/MinkDebugExtension)
  • Added --strict toggle to every Behat execution (it won't pass if there are pending or missing steps)
  • Introduced caching (speeds each job up for ~2-3 minutes )
  • Cleaned up Travis a little bit :)
Show outdated Hide outdated .travis.yml
# - if [ $TRAVIS_PHP_VERSION != "7.0" ]; then composer require jmikola/geojson="~1.0" --no-update; fi
# - if [ $TRAVIS_PHP_VERSION != "7.0" ]; then composer update doctrine/mongodb-odm jmikola/geojson --prefer-source --no-interaction; fi
- if [ $TEST_SUITE = "javascript" ]; then travis/prepare-to-javascript-tests; fi

This comment has been minimized.

@stloyd

stloyd Sep 9, 2015

Contributor

Don't waste resources to build apache, as we changed to PHP 5.5, use built-in webserver!

before_script:
    - php -S localhost:8000 -t web &> /dev/null;

    - curl http://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.1.jar > selenium.jar
    - java -jar selenium.jar > /dev/null &
    - sleep 5

Later add:

# behat.yml.dist
default:
    extensions:
        Behat\MinkExtension:
            base_url: 'http://localhost:8000/app_test.php'
@stloyd

stloyd Sep 9, 2015

Contributor

Don't waste resources to build apache, as we changed to PHP 5.5, use built-in webserver!

before_script:
    - php -S localhost:8000 -t web &> /dev/null;

    - curl http://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.1.jar > selenium.jar
    - java -jar selenium.jar > /dev/null &
    - sleep 5

Later add:

# behat.yml.dist
default:
    extensions:
        Behat\MinkExtension:
            base_url: 'http://localhost:8000/app_test.php'

This comment has been minimized.

@pamil

pamil Sep 9, 2015

Member

I wanted to check out how it will work with Apache2, but I think it's not worth the effort. Falling back to built-in webserver.

@pamil

pamil Sep 9, 2015

Member

I wanted to check out how it will work with Apache2, but I think it's not worth the effort. Falling back to built-in webserver.

This comment has been minimized.

@stloyd

stloyd Sep 9, 2015

Contributor

We have done this that many times that you could avoid that ;) (just look for closed PRs with "travis" in title 馃槣 )

@stloyd

stloyd Sep 9, 2015

Contributor

We have done this that many times that you could avoid that ;) (just look for closed PRs with "travis" in title 馃槣 )

@stloyd

This comment has been minimized.

Show comment
Hide comment
@stloyd

stloyd Sep 9, 2015

Contributor

@pamil @pjedrzejewski @michalmarcinkowski Dunno who got admin status on Travis, but PLEASE don't waste resources for Sylius and cancel ALL broken builds for PRs (just look how many times this PR started & blocked others)....

Contributor

stloyd commented Sep 9, 2015

@pamil @pjedrzejewski @michalmarcinkowski Dunno who got admin status on Travis, but PLEASE don't waste resources for Sylius and cancel ALL broken builds for PRs (just look how many times this PR started & blocked others)....

@pamil

This comment has been minimized.

Show comment
Hide comment
@pamil

pamil Sep 9, 2015

Member

@stloyd we're doing our best killing those builds, unfortunately I'm not able to do it myself, so there's some small communication delay as no one is watching builds list all the time :)

Member

pamil commented Sep 9, 2015

@stloyd we're doing our best killing those builds, unfortunately I'm not able to do it myself, so there's some small communication delay as no one is watching builds list all the time :)

Show outdated Hide outdated travis/prepare/prepare-javascript
# Installing google-chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb > /dev/null 2>&1
sudo dpkg -i google-chrome-stable_current_amd64.deb > /dev/null 2>&1

This comment has been minimized.

@stloyd

stloyd Sep 9, 2015

Contributor

Why using chrome while firefox is already available?

@stloyd

stloyd Sep 9, 2015

Contributor

Why using chrome while firefox is already available?

This comment has been minimized.

@pamil

pamil Sep 9, 2015

Member

Primo, Firefox is much slower than Chrome (about 2-3 times slower).
Secundo, Firefox has a random issues with some pages, sometimes it scrolls down the page and there's no possibility to scroll up; when it tries to do something with element that isn't visible and accessable for that moment, it throws an exception and test fails.

@pamil

pamil Sep 9, 2015

Member

Primo, Firefox is much slower than Chrome (about 2-3 times slower).
Secundo, Firefox has a random issues with some pages, sometimes it scrolls down the page and there's no possibility to scroll up; when it tries to do something with element that isn't visible and accessable for that moment, it throws an exception and test fails.

This comment has been minimized.

@pamil

pamil Sep 9, 2015

Member

Btw. we may come back to container-based infrastructure, if there was a possibility to install Google Chrome on that. There's a PR for that: travis-ci/apt-source-whitelist#35

@pamil

pamil Sep 9, 2015

Member

Btw. we may come back to container-based infrastructure, if there was a possibility to install Google Chrome on that. There's a PR for that: travis-ci/apt-source-whitelist#35

@pjedrzejewski

This comment has been minimized.

Show comment
Hide comment
@pjedrzejewski

pjedrzejewski Sep 9, 2015

Member

@stloyd What @pamil said, we kill them as quickly as humanly possible.

Member

pjedrzejewski commented Sep 9, 2015

@stloyd What @pamil said, we kill them as quickly as humanly possible.

pjedrzejewski added a commit that referenced this pull request Sep 17, 2015

Merge pull request #3055 from pamil/travis-on-steroids
[Travis] Running JavaScript tests

@pjedrzejewski pjedrzejewski merged commit 1723d42 into Sylius:master Sep 17, 2015

2 checks passed

Scrutinizer 2 new issues, 8 updated code elements
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pjedrzejewski

This comment has been minimized.

Show comment
Hide comment
@pjedrzejewski

pjedrzejewski Sep 17, 2015

Member

@pamil you smashed it. Thank you Kamil! 馃憤

Member

pjedrzejewski commented Sep 17, 2015

@pamil you smashed it. Thank you Kamil! 馃憤

@pamil

This comment has been minimized.

Show comment
Hide comment
@pamil

pamil Sep 17, 2015

Member

My biggest achievement in Sylius development so far :) 馃帀

Member

pamil commented Sep 17, 2015

My biggest achievement in Sylius development so far :) 馃帀

@pamil pamil deleted the pamil:travis-on-steroids branch Sep 17, 2015

{{ buttons.delete(path('sylius_backend_customer_delete', {'id': customer.id}), null, false, false) }}
{% elseif customer.user.id is not sameas(app.user.id) %}
{{ buttons.delete(path('sylius_backend_customer_delete', {'id': customer.id}), null, false, false) }}
{% if customer.user is null or customer.user.id is not sameas(app.user.id) %}

This comment has been minimized.

@stloyd

stloyd Sep 17, 2015

Contributor

You should use same as.

@stloyd

stloyd Sep 17, 2015

Contributor

You should use same as.

This comment has been minimized.

@pamil

pamil Sep 17, 2015

Member

Same as below, just copied it, I didn't want to change more things that needed in this PR.

@pamil

pamil Sep 17, 2015

Member

Same as below, just copied it, I didn't want to change more things that needed in this PR.

This comment has been minimized.

@stloyd

stloyd Sep 17, 2015

Contributor

Problem with sameas it will not work with latest Twig...

@stloyd

stloyd Sep 17, 2015

Contributor

Problem with sameas it will not work with latest Twig...

This comment has been minimized.

@pamil

pamil Sep 17, 2015

Member

Do you mean Twig 2? I only found that same as is an alias for sameas.

@pamil

pamil Sep 17, 2015

Member

Do you mean Twig 2? I only found that same as is an alias for sameas.

This comment has been minimized.

This comment has been minimized.

@pamil

pamil Sep 17, 2015

Member

I'll make a PR for that 馃憤

@pamil

pamil Sep 17, 2015

Member

I'll make a PR for that 馃憤

if [ -f $SYLIUS_CACHE_DIR/composer-mongodb.lock ]; then
cp $SYLIUS_CACHE_DIR/composer-mongodb.lock composer.lock
else
composer require doctrine/mongodb-odm="1.0.*@dev" --no-update

This comment has been minimized.

@stloyd

stloyd Sep 17, 2015

Contributor

You should use stable version.

@stloyd

stloyd Sep 17, 2015

Contributor

You should use stable version.

This comment has been minimized.

@pamil

pamil Sep 17, 2015

Member

Just copied it from original Travis configuration file, feel free to contribute :)

@pamil

pamil Sep 17, 2015

Member

Just copied it from original Travis configuration file, feel free to contribute :)

@@ -57,5 +57,5 @@ Feature: Shipments
Then I should be on the shipment page with method "DHL"
Scenario: Displaying the shipment state on details page
Given I am on the shipment page with method "DHL"
When I am on the shipment page with method "DHL"

This comment has been minimized.

@stloyd

stloyd Sep 17, 2015

Contributor

Given was proper one here IMO.

@stloyd

stloyd Sep 17, 2015

Contributor

Given was proper one here IMO.

This comment has been minimized.

@pamil

pamil Sep 17, 2015

Member

I don't think Given / Then workflow is correct, especially if there's Given included from the background.

@pamil

pamil Sep 17, 2015

Member

I don't think Given / Then workflow is correct, especially if there's Given included from the background.

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