Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4c3dcda7
Commit
4c3dcda7
authored
Aug 16, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack to get around many types of string encodings
Changed the port listing Changing to better readability
parent
22b3f2b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
lms/envs/sauce.py
+15
-10
No files found.
lms/envs/sauce.py
View file @
4c3dcda7
...
@@ -9,12 +9,11 @@ so that we can run the lettuce acceptance tests on SauceLabs.
...
@@ -9,12 +9,11 @@ so that we can run the lettuce acceptance tests on SauceLabs.
from
selenium.webdriver.common.desired_capabilities
import
DesiredCapabilities
from
selenium.webdriver.common.desired_capabilities
import
DesiredCapabilities
import
os
import
os
import
json
PORTS
=
[
2000
,
2001
,
2020
,
2109
,
2222
,
2310
,
3000
,
3001
,
PORTS
=
[
2000
,
2001
,
2020
,
2109
,
2222
,
2310
,
3000
,
3001
,
3030
,
3210
,
3333
,
4000
,
4001
,
4040
,
4321
,
4502
,
4503
,
5000
,
5001
,
3030
,
3210
,
3333
,
4000
,
4001
,
4040
,
4321
,
4502
,
4503
,
5050
,
5555
,
5432
,
60
00
,
6001
,
60
60
,
6666
,
6543
,
7000
,
7070
,
7774
,
5050
,
5555
,
5432
,
6060
,
6666
,
6543
,
7000
,
7070
,
7774
,
7777
,
8003
,
8031
,
8080
,
8081
,
8765
,
8888
,
9000
,
9001
,
7777
,
8003
,
8031
,
8080
,
8081
,
8765
,
8888
,
9080
,
9090
,
9876
,
9999
,
49221
,
55001
]
9080
,
9090
,
9876
,
9999
,
49221
,
55001
]
DESIRED_CAPABILITIES
=
{
DESIRED_CAPABILITIES
=
{
...
@@ -28,19 +27,25 @@ DESIRED_CAPABILITIES = {
...
@@ -28,19 +27,25 @@ DESIRED_CAPABILITIES = {
'android'
:
DesiredCapabilities
.
ANDROID
'android'
:
DesiredCapabilities
.
ANDROID
}
}
DEFAULT_CONFIG
=
'{"PLATFORM":"Linux", "BROWSER":"chrome", "VERISON":"", "DEVICE":""}'
SAUCE_INFO
=
json
.
loads
(
os
.
environ
.
get
(
'SAUCE_INFO'
,
DEFAULT_CONFIG
))
#HACK
#This needs to be done because Jenkins needs to satisfy URLs, JSON, BASH, SAUCE, and PYTHON
#This is the simplest way to adhere to all of these requirements and still be readible
DEFAULT_CONFIG
=
'Linux-chrome--'
SAUCE_INFO
=
os
.
environ
.
get
(
'SAUCE_INFO'
,
DEFAULT_CONFIG
)
.
split
(
'-'
)
if
len
(
SAUCE_INFO
)
!=
4
:
SAUCE_INFO
=
DEFAULT_CONFIG
.
split
(
'-'
)
# Information needed to utilize Sauce Labs.
# Information needed to utilize Sauce Labs.
SAUCE
=
{
SAUCE
=
{
'SAUCE_ENABLED'
:
os
.
environ
.
get
(
'SAUCE_ENABLED'
),
'SAUCE_ENABLED'
:
os
.
environ
.
get
(
'SAUCE_ENABLED'
),
'USERNAME'
:
os
.
environ
.
get
(
'SAUCE_USER_NAME'
),
'USERNAME'
:
os
.
environ
.
get
(
'SAUCE_USER_NAME'
),
'ACCESS_ID'
:
os
.
environ
.
get
(
'SAUCE_API_KEY'
),
'ACCESS_ID'
:
os
.
environ
.
get
(
'SAUCE_API_KEY'
),
'BROWSER'
:
DESIRED_CAPABILITIES
.
get
(
SAUCE_INFO
.
get
(
'BROWSER'
,
'chrome'
)
.
lower
(),
DesiredCapabilities
.
CHROME
),
'BROWSER'
:
DESIRED_CAPABILITIES
.
get
(
SAUCE_INFO
[
0
]
.
lower
(),
DesiredCapabilities
.
CHROME
),
'PLATFORM'
:
SAUCE_INFO
.
get
(
'PLATFORM'
,
'Linux'
)
,
'PLATFORM'
:
SAUCE_INFO
[
0
]
,
'VERSION'
:
SAUCE_INFO
.
get
(
'VERSION'
,
''
)
,
'VERSION'
:
SAUCE_INFO
[
2
]
,
'DEVICE'
:
SAUCE_INFO
.
get
(
'DEVICE'
,
''
)
,
'DEVICE'
:
SAUCE_INFO
[
3
]
,
'SESSION'
:
'Jenkins Acceptance Tests'
,
'SESSION'
:
'Jenkins Acceptance Tests'
,
'BUILD'
:
os
.
environ
.
get
(
'JOB_NAME'
,
'LETTUCE TESTS'
),
'BUILD'
:
os
.
environ
.
get
(
'JOB_NAME'
,
'LETTUCE TESTS'
),
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment