Temporarily disabled the saucelab integration (the tunnel keeps failing).
This commit is contained in:
parent
2f6bdb9d55
commit
6460d22c57
13
.travis.yml
13
.travis.yml
|
@ -4,14 +4,8 @@ language: python
|
|||
python:
|
||||
- 2.7
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: "MEfyEpYEBkPmgPYX3CDKhaoiOltH5lDcUOYZ/19Yflg6ee20IBZOywCmrKH7VouKlOHUrGTUQqHBou0npm93qBju3MrPCE2R62PiDV2EHCGl3AFpLkgt0m1/DceWCWKlL+gI8uvnEFzVUuaPm6cEcRn1ikzg5b084bTxJ2B1Bvs="
|
||||
- SAUCE_USERNAME="artica_pandorafms"
|
||||
|
||||
addons:
|
||||
firefox: "latest"
|
||||
sauce_connect: true
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
@ -20,12 +14,7 @@ before_install:
|
|||
- sudo apt-get install xvfb
|
||||
|
||||
install:
|
||||
- pip install selenium PyVirtualDisplay sauceclient testtools
|
||||
|
||||
#before_script:
|
||||
# - "export DISPLAY=:99.0"
|
||||
# - "sh -e /etc/init.d/xvfb start"
|
||||
# - sleep 4 # give xvfb some time to start
|
||||
- pip install selenium PyVirtualDisplay testtools
|
||||
|
||||
script:
|
||||
- docker run --name pandorafms -h pandorafms -dt -v "$TRAVIS_BUILD_DIR:/tmp/pandorafms" -p 127.0.0.1:80:80 pandorafms/pandorafms-base tail -f /var/log/messages
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
from unittest import TestResult, TestCase
|
||||
from common_functions_60 import *
|
||||
from datetime import datetime
|
||||
from pyvirtualdisplay import Display
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
from selenium.webdriver.support.ui import Select
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import NoAlertPresentException
|
||||
from sauceclient import SauceClient
|
||||
#from sauceclient import SauceClient
|
||||
from os import environ
|
||||
import os
|
||||
|
||||
|
@ -25,17 +26,17 @@ class PandoraWebDriverTestCase(TestCase):
|
|||
time_started = None
|
||||
time_elapsed = None #Total time of the test
|
||||
tickets_associated = []
|
||||
sauce_username = environ["SAUCE_USERNAME"]
|
||||
sauce_access_key = environ["SAUCE_ACCESS_KEY"]
|
||||
sauce_client = None
|
||||
sauce_labs_job_id = None
|
||||
#sauce_username = environ["SAUCE_USERNAME"]
|
||||
#sauce_access_key = environ["SAUCE_ACCESS_KEY"]
|
||||
#sauce_client = None
|
||||
#sauce_labs_job_id = None
|
||||
|
||||
desired_cap = {
|
||||
'tunnel-identifier': environ["TRAVIS_JOB_NUMBER"],
|
||||
'platform': "Windows 10",
|
||||
'browserName': "firefox",
|
||||
'version': "46",
|
||||
}
|
||||
#desired_cap = {
|
||||
# 'tunnel-identifier': environ["TRAVIS_JOB_NUMBER"],
|
||||
# 'platform': "Windows 10",
|
||||
# 'browserName': "firefox",
|
||||
# 'version': "46",
|
||||
#}
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
@ -46,14 +47,17 @@ class PandoraWebDriverTestCase(TestCase):
|
|||
cls.base_url = os.getenv('DEVELOPMENT_URL')
|
||||
else:
|
||||
#Start VM in Sauce Labs
|
||||
cls.driver = webdriver.Remote(command_executor='http://'+cls.sauce_username+':'+cls.sauce_access_key+'@ondemand.saucelabs.com:80/wd/hub',desired_capabilities=cls.desired_cap)
|
||||
cls.sauce_labs_job_id = cls.driver.session_id
|
||||
#cls.driver = webdriver.Remote(command_executor='http://'+cls.sauce_username+':'+cls.sauce_access_key+'@ondemand.saucelabs.com:80/wd/hub',desired_capabilities=cls.desired_cap)
|
||||
#cls.sauce_labs_job_id = cls.driver.session_id
|
||||
display = Display(visible=0, size=(800, 600))
|
||||
display.start()
|
||||
cls.driver = webdriver.Firefox()
|
||||
cls.base_url = "http://127.0.0.1/"
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
if cls.is_development == False:
|
||||
display.stop()
|
||||
cls.driver.quit()
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from unittest import *
|
||||
from console.include.common_functions_60 import *
|
||||
from console.include.common_classes_60 import *
|
||||
from sauceclient import SauceClient
|
||||
#from sauceclient import SauceClient
|
||||
from os import environ, getenv
|
||||
import subprocess, time, sys
|
||||
|
||||
|
@ -20,22 +20,22 @@ tests = a.discover(start_dir='console',pattern='*.py')
|
|||
c = ArticaTestResult()
|
||||
tests.run(c)
|
||||
|
||||
#sauce_client = SauceClient(environ["SAUCE_USERNAME"], environ["SAUCE_ACCESS_KEY"])
|
||||
#for test,error_msg in c.failures+c.errors:
|
||||
# try:
|
||||
# sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=False,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
||||
# except:
|
||||
# print "Could not annotate Sauce Labs job #%s" % str(test)
|
||||
# next
|
||||
#
|
||||
#for test,error_msg in c.success+c.skipped:
|
||||
# try:
|
||||
# sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=True,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
||||
#
|
||||
# except:
|
||||
# print "Could not annotate Sauce Labs job #%s" % str(test)
|
||||
# next
|
||||
#Update Saouce Labs jobs
|
||||
sauce_client = SauceClient(environ["SAUCE_USERNAME"], environ["SAUCE_ACCESS_KEY"])
|
||||
for test,error_msg in c.failures+c.errors:
|
||||
try:
|
||||
sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=False,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
||||
except:
|
||||
print "Could not annotate Sauce Labs job #%s" % str(test)
|
||||
next
|
||||
|
||||
for test,error_msg in c.success+c.skipped:
|
||||
try:
|
||||
sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=True,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
||||
|
||||
except:
|
||||
print "Could not annotate Sauce Labs job #%s" % str(test)
|
||||
next
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue