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
1aa156ca
Commit
1aa156ca
authored
Jan 22, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bok choy tests output XUnit reports
parent
591470df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
rakelib/bok_choy.rake
+21
-11
No files found.
rakelib/bok_choy.rake
View file @
1aa156ca
...
...
@@ -16,6 +16,9 @@ BOK_CHOY_TEST_DIR = File.join(REPO_ROOT, "common", "test", "acceptance", "tests"
BOK_CHOY_LOG_DIR
=
File
.
join
(
REPO_ROOT
,
"test_root"
,
"log"
)
directory
BOK_CHOY_LOG_DIR
BOK_CHOY_XUNIT_REPORT
=
report_dir_path
(
"bok_choy_xunit.xml"
)
BOK_CHOY_SERVERS
=
{
:lms
=>
{
:port
=>
8003
,
:log
=>
File
.
join
(
BOK_CHOY_LOG_DIR
,
"bok_choy_lms.log"
)
},
:cms
=>
{
:port
=>
8031
,
:log
=>
File
.
join
(
BOK_CHOY_LOG_DIR
,
"bok_choy_studio.log"
)
}
...
...
@@ -74,15 +77,6 @@ def is_mysql_running()
end
def
nose_cmd
(
test_spec
)
cmd
=
[
"SCREENSHOT_DIR='
#{
BOK_CHOY_LOG_DIR
}
'"
,
"nosetests"
,
test_spec
]
if
BOK_CHOY_NUM_PARALLEL
>
1
cmd
+=
[
"--processes=
#{
BOK_CHOY_NUM_PARALLEL
}
"
,
"--process-timeout=
#{
BOK_CHOY_TEST_TIMEOUT
}
"
]
end
return
cmd
.
join
(
" "
)
end
# Run the bok choy tests
# `test_spec` is a nose-style test specifier relative to the test directory
# Examples:
...
...
@@ -91,11 +85,27 @@ end
# - path/to/test.py:TestFoo.test_bar
# It can also be left blank to run all tests in the suite.
def
run_bok_choy
(
test_spec
)
# Default to running all tests if no specific test is specified
if
test_spec
.
nil?
sh
(
nose_cmd
(
BOK_CHOY_TEST_DIR
))
test_spec
=
BOK_CHOY_TEST_DIR
else
sh
(
nose_cmd
(
File
.
join
(
BOK_CHOY_TEST_DIR
,
test_spec
))
)
test_spec
=
File
.
join
(
BOK_CHOY_TEST_DIR
,
test_spec
)
end
# Construct the nosetests command, specifying where to save screenshots and XUnit XML reports
cmd
=
[
"SCREENSHOT_DIR='
#{
BOK_CHOY_LOG_DIR
}
'"
,
"nosetests"
,
test_spec
,
"--with-xunit"
,
"--xunit-file=
#{
BOK_CHOY_XUNIT_REPORT
}
"
]
# Configure parallel test execution, if specified
if
BOK_CHOY_NUM_PARALLEL
>
1
cmd
+=
[
"--processes=
#{
BOK_CHOY_NUM_PARALLEL
}
"
,
"--process-timeout=
#{
BOK_CHOY_TEST_TIMEOUT
}
"
]
end
# Run the nosetests command
sh
(
cmd
.
join
(
" "
))
end
...
...
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