Skip to content

Change the Travis to run differently the acceptance test #713

Closed

Description

@aaltat

Because there was some unexpected problems with Travis and the accessing the encrypted information (the Sauce Labs credentials) [1] we need to change how we run acceptance tests from the original plan.

  • For each PR, run with Firefox (provided by Travis), selenium 2/3 and Python 2/3.
  • Create nightly/weekly build to run from master and run by using Sauce Labs by using different browsers.

[1] https://docs.travis-ci.com/user/environment-variables/#Defining-encrypted-variables-in-.travis.yml

Activity

  1. added this to the milestone on Dec 14, 2016
  2. aaltat commented on Dec 14, 2016

    @aaltat
    ContributorAuthor

    We could define the .travis.yamllike this:

    language: python
    sudo: required
    dist: trusty
    addons:
      apt:
        sources:
          - google-chrome
        packages:
          - google-chrome-stable
    
    install:
      - pip install robotframework
      - pip install future
    matrix:
      include:
        - python: "2.7" # For PR and cron
          env:
            - BROWSER=chrome
            - SELENIUM=2.53.6
        - python: "3.3" # For PR and cron
          env:
            - BROWSER=chrome
            - SELENIUM=2.53.6
        - python: "3.3" # For PR and cron
          env:
            - BROWSER=chrome
            - SELENIUM=3.0.2
        - python: "3.3" # For cron
          env:
            - BROWSER=firefox
            - SELENIUM=2.53.6
    before_script:
      - "export DISPLAY=:99.0"
      - "sh -e /etc/init.d/xvfb start"
      - pip install selenium==$SELENIUM
    script: python run_me.py $BROWSER
    

    And then run test runner we could do something like this:

    from __future__ import print_function
    import os
    import sys
    from selenium import webdriver
    
    print('start')
    browser = sys.argv[1]
    selenium = os.environ.get('SELENIUM')
    print(browser)
    print(selenium)
    travis_event_type = os.environ.get('TRAVIS_EVENT_TYPE')
    
    if travis_event_type == 'cron':
        print(os.environ.get('SAUCE_ACCESS_KEY'))
        print(os.environ.get('SAUCE_USERNAME'))
        # and other sstuff run with Sauce labs
    elif travis_event_type != 'cron' and browser != 'chorme':
        # exit fast if trying to use other browser than chrome
        print(
            'No cron, exting test with selenium-{} and {} from Sauce'.format(
                selenium,
                browser
            )
        )
        sys.exit(0)
    else:
        print('Running test for PR with {} using selenium'.format(browser, selenium))
        driver = webdriver.Chrome()
        driver.get("http://www.python.org")
        driver.close()
    
    print ('end')
    sys.exit(0)
    
  3. aaltat commented on Dec 18, 2016

    @aaltat
    ContributorAuthor

    #716 provides a PR to solve the problem with encrypted data. Changed quite lot of things in the PR

    • Acceptance test are run with Chrome for PR and not with Firefox.
    • Acceptance test for PR are run with selenium 2.53.6+Python 2.7, selenium 2.53.6+Python 3.3, selenium 3.0.2+Python 2.7.
    • Did take argparse to use in run_test.py
    • It is possible to use, users own, sauce labs account when running test locally.

    To do:

    • Configure Sauce Labs credentials
    • Create cron in Travis to run form master with different browsers from Sauce Labs
    • Update documentation and add README.rst to tests folder
    • Get rid of env.py file
  4. added
    taskGeneric task not listed in release notes
    and removed on Sep 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskGeneric task not listed in release notes

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions