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
9b806202
Commit
9b806202
authored
Apr 15, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set unique dirs for test reports
parent
6eda3ef7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
25 deletions
+49
-25
pavelib/paver_tests/test_paver_bok_choy_cmds.py
+7
-5
pavelib/tests.py
+12
-0
pavelib/utils/envs.py
+9
-0
pavelib/utils/test/suites/nose_suite.py
+12
-1
scripts/all-tests.sh
+4
-17
scripts/jenkins-report.sh
+5
-2
No files found.
pavelib/paver_tests/test_paver_bok_choy_cmds.py
View file @
9b806202
...
...
@@ -14,19 +14,21 @@ class TestPaverBokChoyCmd(unittest.TestCase):
def
_expected_command
(
self
,
expected_text_append
,
expected_default_store
=
None
):
if
expected_text_append
:
expected_text_append
=
"/"
+
expected_text_append
shard
=
os
.
environ
.
get
(
'SHARD'
)
expected_statement
=
(
"DEFAULT_STORE={default_store} "
"SCREENSHOT_DIR='{repo_dir}/test_root/log' "
"BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log/hars' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log' "
"SCREENSHOT_DIR='{repo_dir}/test_root/log
{shard}
' "
"BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log
{shard}
/hars' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log
{shard}
' "
"nosetests {repo_dir}/common/test/acceptance/tests{exp_text} "
"--with-xunit "
"--xunit-file={repo_dir}/reports/bok_choy/xunit.xml "
"--verbosity=2"
"--xunit-file={repo_dir}/reports/bok_choy
{shard}
/xunit.xml "
"--verbosity=2
"
)
.
format
(
default_store
=
expected_default_store
,
repo_dir
=
REPO_DIR
,
exp_text
=
expected_text_append
,
shard
=
'/shard_'
+
shard
if
shard
else
''
,
)
return
expected_statement
.
strip
()
...
...
pavelib/tests.py
View file @
9b806202
...
...
@@ -214,6 +214,18 @@ def coverage(options):
@task
@needs
(
'pavelib.prereqs.install_prereqs'
)
def
combine_coverage
():
"""
Combine coverage reports.
"""
for
directory
in
Env
.
LIB_TEST_DIRS
+
[
'cms'
,
'lms'
]:
report_dir
=
Env
.
REPORT_DIR
/
directory
if
report_dir
.
isdir
():
sh
(
"cd {} && coverage combine"
.
format
(
report_dir
))
@task
@needs
(
'pavelib.prereqs.install_prereqs'
)
@cmdopts
([
(
"compare_branch="
,
"b"
,
"Branch to compare against, defaults to origin/master"
),
])
...
...
pavelib/utils/envs.py
View file @
9b806202
...
...
@@ -28,6 +28,15 @@ class Env(object):
BOK_CHOY_REPORT_DIR
=
REPORT_DIR
/
"bok_choy"
BOK_CHOY_COVERAGERC
=
BOK_CHOY_DIR
/
".coveragerc"
# If set, put reports for run in "unique" directories.
# The main purpose of this is to ensure that the reports can be 'slurped'
# in the main jenkins flow job without overwriting the reports from other
# build steps. For local development/testing, this shouldn't be needed.
if
os
.
environ
.
get
(
"SHARD"
,
None
):
shard_str
=
"shard_{}"
.
format
(
os
.
environ
.
get
(
"SHARD"
))
BOK_CHOY_REPORT_DIR
=
BOK_CHOY_REPORT_DIR
/
shard_str
BOK_CHOY_LOG_DIR
=
BOK_CHOY_LOG_DIR
/
shard_str
# For the time being, stubs are used by both the bok-choy and lettuce acceptance tests
# For this reason, the stubs package is currently located in the Django app called "terrain"
# where other lettuce configuration is stored.
...
...
pavelib/utils/test/suites/nose_suite.py
View file @
9b806202
...
...
@@ -21,6 +21,15 @@ class NoseTestSuite(TestSuite):
self
.
fail_fast
=
kwargs
.
get
(
'fail_fast'
,
False
)
self
.
run_under_coverage
=
kwargs
.
get
(
'with_coverage'
,
True
)
self
.
report_dir
=
Env
.
REPORT_DIR
/
self
.
root
# If set, put reports for run in "unique" directories.
# The main purpose of this is to ensure that the reports can be 'slurped'
# in the main jenkins flow job without overwriting the reports from other
# build steps. For local development/testing, this shouldn't be needed.
if
os
.
environ
.
get
(
"SHARD"
,
None
):
shard_str
=
"shard_{}"
.
format
(
os
.
environ
.
get
(
"SHARD"
))
self
.
report_dir
=
self
.
report_dir
/
shard_str
self
.
test_id_dir
=
Env
.
TEST_DIR
/
self
.
root
self
.
test_ids
=
self
.
test_id_dir
/
'noseids'
self
.
extra_args
=
kwargs
.
get
(
'extra_args'
,
''
)
...
...
@@ -112,12 +121,14 @@ class SystemTestSuite(NoseTestSuite):
def
cmd
(
self
):
cmd
=
(
'./manage.py {system} test --verbosity={verbosity} '
'{test_id} {test_opts} --traceback --settings=test {extra}'
.
format
(
'{test_id} {test_opts} --traceback --settings=test {extra} '
'--with-xunit --xunit-file={xunit_report}'
.
format
(
system
=
self
.
root
,
verbosity
=
self
.
verbosity
,
test_id
=
self
.
test_id
,
test_opts
=
self
.
test_options_flags
,
extra
=
self
.
extra_args
,
xunit_report
=
self
.
report_dir
/
"nosetests.xml"
,
)
)
...
...
scripts/all-tests.sh
View file @
9b806202
...
...
@@ -98,14 +98,12 @@ END
"unit"
)
case
"
$SHARD
"
in
"lms"
)
paver test_system
-s
lms
--extra_args
=
"--with-flaky"
||
{
EXIT
=
1
;
}
paver coverage
SHARD
=
1 paver test_system
-s
lms
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
;;
"cms-js-commonlib"
)
paver test_system
-s
cms
--extra_args
=
"--with-flaky"
||
{
EXIT
=
1
;
}
paver test_js
--coverage
--skip_clean
||
{
EXIT
=
1
;
}
paver test_lib
--skip_clean
--extra_args
=
"--with-flaky"
||
{
EXIT
=
1
;
}
paver coverage
SHARD
=
1 paver test_system
-s
cms
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
SHARD
=
1 paver test_js
--coverage
--skip_clean
||
{
EXIT
=
1
;
}
SHARD
=
1 paver test_lib
--skip_clean
--extra_args
=
"--with-flaky"
--cov_args
=
"-p"
||
{
EXIT
=
1
;
}
;;
*
)
paver
test
--extra_args
=
"--with-flaky"
...
...
@@ -202,15 +200,4 @@ END
END
;;
esac
# Move the reports to a directory that is unique to the shard
# so that when they are 'slurped' to the main flow job, they
# do not conflict with and overwrite reports from other shards.
mv reports/ reports_tmp/
mkdir
-p
reports/
${
TEST_SUITE
}
/
${
SHARD
}
mv reports_tmp/
*
reports/
${
TEST_SUITE
}
/
${
SHARD
}
rm
-r
reports_tmp/
exit
$EXIT
;;
esac
scripts/jenkins-report.sh
View file @
9b806202
#!/usr/bin/env bash
source
scripts/jenkins-common.sh
# Run coverage again to get the diff coverage report
paver diff_coverage
# Run combine the data files that were generated using -p
paver combine_coverage
# Get the diff coverage and html reports for unit tests
paver coverage
# JUnit test reporter will fail the build
# if it thinks test results are old
...
...
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