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
0b6e6298
Commit
0b6e6298
authored
Aug 15, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using requests instead of a HTTPConnect
parent
58bb6e1e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
cms/envs/acceptance.py
+1
-1
common/djangoapps/terrain/browser.py
+5
-7
lms/envs/acceptance.py
+2
-1
No files found.
cms/envs/acceptance.py
View file @
0b6e6298
...
...
@@ -101,7 +101,7 @@ MITX_FEATURES['SAUCE'] = {
'SAUCE_ENABLED'
:
os
.
environ
.
get
(
'SAUCE_ENABLED'
),
'USERNAME'
:
os
.
environ
.
get
(
'SAUCE_USER_NAME'
),
'ACCESS_ID'
:
os
.
environ
.
get
(
'SAUCE_API_KEY'
),
'BROWSER'
:
DESIRED_CAPABILITIES
.
get
(
os
.
environ
.
get
(
'SAUCE_BROWSER'
,
'chrome'
),
DesiredCapabilities
.
CHROME
),
'BROWSER'
:
DESIRED_CAPABILITIES
.
get
(
os
.
environ
.
get
(
'SAUCE_BROWSER'
,
'chrome'
)
.
lower
()
,
DesiredCapabilities
.
CHROME
),
'PLATFORM'
:
os
.
environ
.
get
(
'SAUCE_PLATFORM'
,
'Linux'
),
'VERSION'
:
os
.
environ
.
get
(
'SAUCE_VERSION'
,
''
),
'DEVICE'
:
os
.
environ
.
get
(
'SAUCE_DEVICE'
,
''
),
...
...
common/djangoapps/terrain/browser.py
View file @
0b6e6298
...
...
@@ -43,7 +43,7 @@ LOGGER.info("Loading the lettuce acceptance testing terrain file...")
MAX_VALID_BROWSER_ATTEMPTS
=
20
# https://gist.github.com/santiycr/1644439
import
httplib
import
requests
import
base64
try
:
import
json
...
...
@@ -75,12 +75,10 @@ base64string = base64.encodestring('{}:{}'.format(config['username'], config['ac
def
set_job_status
(
jobid
,
passed
=
True
):
body_content
=
json
.
dumps
({
"passed"
:
passed
})
connection
=
httplib
.
HTTPConnection
(
"saucelabs.com"
)
connection
.
request
(
'PUT'
,
'/rest/v1/
%
s/jobs/
%
s'
%
(
config
[
'username'
],
jobid
),
body_content
,
headers
=
{
"Authorization"
:
"Basic
%
s"
%
base64string
})
result
=
connection
.
getresponse
()
return
result
.
status
==
200
result
=
requests
.
put
(
'http://saucelabs.com/rest/v1/{}/jobs/{}'
.
format
(
config
[
'username'
],
jobid
),
data
=
body_content
,
headers
=
{
"Authorization"
:
"Basic {}"
.
format
(
base64string
)})
return
result
.
status_code
==
200
@before.harvest
...
...
lms/envs/acceptance.py
View file @
0b6e6298
...
...
@@ -109,7 +109,7 @@ MITX_FEATURES['SAUCE'] = {
'SAUCE_ENABLED'
:
os
.
environ
.
get
(
'SAUCE_ENABLED'
),
'USERNAME'
:
os
.
environ
.
get
(
'SAUCE_USER_NAME'
),
'ACCESS_ID'
:
os
.
environ
.
get
(
'SAUCE_API_KEY'
),
'BROWSER'
:
DESIRED_CAPABILITIES
.
get
(
os
.
environ
.
get
(
'SAUCE_BROWSER'
,
'chrome'
),
DesiredCapabilities
.
CHROME
),
'BROWSER'
:
DESIRED_CAPABILITIES
.
get
(
os
.
environ
.
get
(
'SAUCE_BROWSER'
,
'chrome'
)
.
lower
()
,
DesiredCapabilities
.
CHROME
),
'PLATFORM'
:
os
.
environ
.
get
(
'SAUCE_PLATFORM'
,
'Linux'
),
'VERSION'
:
os
.
environ
.
get
(
'SAUCE_VERSION'
,
''
),
'DEVICE'
:
os
.
environ
.
get
(
'SAUCE_DEVICE'
,
''
),
...
...
@@ -117,6 +117,7 @@ MITX_FEATURES['SAUCE'] = {
'BUILD'
:
os
.
environ
.
get
(
'JOB_NAME'
,
'LMS TESTS'
),
}
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
INSTALLED_APPS
+=
(
'lettuce.django'
,)
LETTUCE_APPS
=
(
'courseware'
,)
...
...
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