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
ef89c75b
Commit
ef89c75b
authored
Jun 22, 2016
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate paver arguments with '_' in them in favor of versions with '-'
parent
206cedf5
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
88 additions
and
46 deletions
+88
-46
lms/djangoapps/course_structure_api/v0/tests.py
+1
-1
pavelib/acceptance_test.py
+2
-1
pavelib/bok_choy.py
+28
-9
pavelib/js_test.py
+2
-1
pavelib/servers.py
+13
-6
pavelib/tests.py
+26
-13
pavelib/utils/test/suites/nose_suite.py
+1
-1
pavelib/utils/test/utils.py
+3
-2
scripts/accessibility-tests.sh
+1
-1
scripts/circle-ci-tests.sh
+6
-6
scripts/generic-ci-tests.sh
+5
-5
No files found.
lms/djangoapps/course_structure_api/v0/tests.py
View file @
ef89c75b
"""
Run these tests @ Devstack:
paver test_system -s lms --fasttest --verbose --test
_
id=lms/djangoapps/course_structure_api
paver test_system -s lms --fasttest --verbose --test
-
id=lms/djangoapps/course_structure_api
"""
# pylint: disable=missing-docstring,invalid-name,maybe-no-member,attribute-defined-outside-init
from
datetime
import
datetime
...
...
pavelib/acceptance_test.py
View file @
ef89c75b
...
...
@@ -20,12 +20,13 @@ __test__ = False # do not collect
)
@cmdopts
([
(
"system="
,
"s"
,
"System to act on"
),
(
"default
_
store="
,
"m"
,
"Default modulestore to use for course creation"
),
(
"default
-
store="
,
"m"
,
"Default modulestore to use for course creation"
),
(
"fasttest"
,
"a"
,
"Run without collectstatic"
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
),
make_option
(
"--pdb"
,
action
=
"store_true"
,
help
=
"Launches an interactive debugger upon error"
),
(
"default_store="
,
None
,
"deprecated in favor of default-store"
),
(
'extra_args='
,
'e'
,
'deprecated, pass extra options directly in the paver commandline'
),
])
@PassthroughTask
...
...
pavelib/bok_choy.py
View file @
ef89c75b
...
...
@@ -18,23 +18,42 @@ except ImportError:
__test__
=
False
# do not collect
BOKCHOY_OPTS
=
[
(
'test
_
spec='
,
't'
,
'Specific test to run'
),
(
'test
-
spec='
,
't'
,
'Specific test to run'
),
(
'fasttest'
,
'a'
,
'Skip some setup'
),
(
'skip
_
clean'
,
'C'
,
'Skip cleaning repository before running tests'
),
(
'skip
-
clean'
,
'C'
,
'Skip cleaning repository before running tests'
),
(
'serversonly'
,
'r'
,
'Prepare suite and leave servers running'
),
(
'testsonly'
,
'o'
,
'Assume servers are running and execute tests only'
),
(
'default
_
store='
,
's'
,
'Default modulestore'
),
(
'test
_
dir='
,
'd'
,
'Directory for finding tests (relative to common/test/acceptance)'
),
(
'imports
_
dir='
,
'i'
,
'Directory containing (un-archived) courses to be imported'
),
(
'num
_
processes='
,
'n'
,
'Number of test threads (for multiprocessing)'
),
(
'verify
_
xss'
,
'x'
,
'Run XSS vulnerability tests'
),
(
'default
-
store='
,
's'
,
'Default modulestore'
),
(
'test
-
dir='
,
'd'
,
'Directory for finding tests (relative to common/test/acceptance)'
),
(
'imports
-
dir='
,
'i'
,
'Directory containing (un-archived) courses to be imported'
),
(
'num
-
processes='
,
'n'
,
'Number of test threads (for multiprocessing)'
),
(
'verify
-
xss'
,
'x'
,
'Run XSS vulnerability tests'
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
),
make_option
(
"--pdb"
,
action
=
"store_true"
,
help
=
"Drop into debugger on failures or errors"
),
make_option
(
"--skip_firefox_version_validation"
,
action
=
'store_false'
,
dest
=
"validate_firefox_version"
),
make_option
(
"--save_screenshots"
,
action
=
'store_true'
,
dest
=
"save_screenshots"
),
make_option
(
"--skip-firefox-version-validation"
,
action
=
'store_false'
,
dest
=
"validate_firefox_version"
),
make_option
(
"--save-screenshots"
,
action
=
'store_true'
,
dest
=
"save_screenshots"
),
(
'default_store='
,
None
,
'deprecated in favor of default-store'
),
(
'extra_args='
,
'e'
,
'deprecated, pass extra options directly in the paver commandline'
),
(
'imports_dir='
,
None
,
'deprecated in favor of imports-dir'
),
(
'num_processes='
,
None
,
'deprecated in favor of num-processes'
),
(
'skip_clean'
,
None
,
'deprecated in favor of skip-clean'
),
(
'test_dir='
,
None
,
'deprecated in favor of test-dir'
),
(
'test_spec='
,
None
,
'Specific test to run'
),
(
'verify_xss'
,
None
,
'deprecated in favor of verify-xss'
),
make_option
(
"--skip_firefox_version_validation"
,
action
=
'store_false'
,
dest
=
"validate_firefox_version"
,
help
=
"deprecated in favor of --skip-firefox-version-validation"
),
make_option
(
"--save_screenshots"
,
action
=
'store_true'
,
dest
=
"save_screenshots"
,
help
=
"deprecated in favor of save-screenshots"
),
]
...
...
pavelib/js_test.py
View file @
ef89c75b
...
...
@@ -19,7 +19,8 @@ __test__ = False # do not collect
(
"mode="
,
"m"
,
"dev or run"
),
(
"coverage"
,
"c"
,
"Run test under coverage"
),
(
"port="
,
"p"
,
"Port to run test server on (dev mode only)"
),
(
'skip_clean'
,
'C'
,
'skip cleaning repository before running tests'
),
(
'skip-clean'
,
'C'
,
'skip cleaning repository before running tests'
),
(
'skip_clean'
,
None
,
'deprecated in favor of skip-clean'
),
],
share_with
=
[
"pavelib.utils.tests.utils.clean_reports_dir"
])
def
test_js
(
options
):
"""
...
...
pavelib/servers.py
View file @
ef89c75b
...
...
@@ -164,14 +164,21 @@ def celery(options):
@needs
(
'pavelib.prereqs.install_prereqs'
)
@cmdopts
([
(
"settings="
,
"s"
,
"Django settings for both LMS and Studio"
),
(
"asset
_
settings="
,
"a"
,
"Django settings for updating assets for both LMS and Studio (defaults to settings)"
),
(
"worker
_
settings="
,
"w"
,
"Celery worker Django settings"
),
(
"asset
-
settings="
,
"a"
,
"Django settings for updating assets for both LMS and Studio (defaults to settings)"
),
(
"worker
-
settings="
,
"w"
,
"Celery worker Django settings"
),
(
"fast"
,
"f"
,
"Skip updating assets"
),
(
"optimized"
,
"o"
,
"Run with optimized assets"
),
(
"settings_lms="
,
"l"
,
"Set LMS only, overriding the value from --settings (if provided)"
),
(
"asset_settings_lms="
,
None
,
"Set LMS only, overriding the value from --asset_settings (if provided)"
),
(
"settings_cms="
,
"c"
,
"Set Studio only, overriding the value from --settings (if provided)"
),
(
"asset_settings_cms="
,
None
,
"Set Studio only, overriding the value from --asset_settings (if provided)"
),
(
"settings-lms="
,
"l"
,
"Set LMS only, overriding the value from --settings (if provided)"
),
(
"asset-settings-lms="
,
None
,
"Set LMS only, overriding the value from --asset-settings (if provided)"
),
(
"settings-cms="
,
"c"
,
"Set Studio only, overriding the value from --settings (if provided)"
),
(
"asset-settings-cms="
,
None
,
"Set Studio only, overriding the value from --asset-settings (if provided)"
),
(
"asset_settings="
,
None
,
"deprecated in favor of asset-settings"
),
(
"asset_settings_cms="
,
None
,
"deprecated in favor of asset-settings-cms"
),
(
"asset_settings_lms="
,
None
,
"deprecated in favor of asset-settings-lms"
),
(
"settings_cms="
,
None
,
"deprecated in favor of settings-cms"
),
(
"settings_lms="
,
None
,
"deprecated in favor of settings-lms"
),
(
"worker_settings="
,
None
,
"deprecated in favor of worker-settings"
),
])
def
run_all_servers
(
options
):
"""
...
...
pavelib/tests.py
View file @
ef89c75b
...
...
@@ -24,12 +24,12 @@ __test__ = False # do not collect
)
@cmdopts
([
(
"system="
,
"s"
,
"System to act on"
),
(
"test
_
id="
,
"t"
,
"Test id"
),
(
"test
-
id="
,
"t"
,
"Test id"
),
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"fail
_
fast"
,
"x"
,
"Fail suite on first failed test"
),
(
"fail
-
fast"
,
"x"
,
"Fail suite on first failed test"
),
(
"fasttest"
,
"a"
,
"Run without collectstatic"
),
(
'cov
_
args='
,
'c'
,
'adds as args to coverage for the test run'
),
(
'skip
_
clean'
,
'C'
,
'skip cleaning repository before running tests'
),
(
'cov
-
args='
,
'c'
,
'adds as args to coverage for the test run'
),
(
'skip
-
clean'
,
'C'
,
'skip cleaning repository before running tests'
),
(
'processes='
,
'p'
,
'number of processes to use running tests'
),
make_option
(
'-r'
,
'--randomize'
,
action
=
'store_true'
,
dest
=
'randomize'
,
help
=
'run the tests in a random order'
),
make_option
(
'--no-randomize'
,
action
=
'store_false'
,
dest
=
'randomize'
,
help
=
"don't run the tests in a random order"
),
...
...
@@ -43,7 +43,11 @@ __test__ = False # do not collect
dest
=
'disable_migrations'
,
help
=
"Create tables directly from apps' models. Can also be used by exporting DISABLE_MIGRATIONS=1."
),
(
"fail_fast"
,
None
,
"deprecated in favor of fail-fast"
),
(
"test_id="
,
None
,
"deprecated in favor of test-id"
),
(
'cov_args='
,
None
,
'deprecated in favor of cov-args'
),
(
'extra_args='
,
'e'
,
'deprecated, pass extra options directly in the paver commandline'
),
(
'skip_clean'
,
None
,
'deprecated in favor of skip-clean'
),
],
share_with
=
[
'pavelib.utils.test.utils.clean_reports_dir'
])
@PassthroughTask
def
test_system
(
options
,
passthrough_options
):
...
...
@@ -92,16 +96,20 @@ def test_system(options, passthrough_options):
)
@cmdopts
([
(
"lib="
,
"l"
,
"lib to test"
),
(
"test
_
id="
,
"t"
,
"Test id"
),
(
"test
-
id="
,
"t"
,
"Test id"
),
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"fail
_
fast"
,
"x"
,
"Run only failed tests"
),
(
'cov
_
args='
,
'c'
,
'adds as args to coverage for the test run'
),
(
'skip
_
clean'
,
'C'
,
'skip cleaning repository before running tests'
),
(
"fail
-
fast"
,
"x"
,
"Run only failed tests"
),
(
'cov
-
args='
,
'c'
,
'adds as args to coverage for the test run'
),
(
'skip
-
clean'
,
'C'
,
'skip cleaning repository before running tests'
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
,
default
=
1
),
make_option
(
"--pdb"
,
action
=
"store_true"
,
help
=
"Drop into debugger on failures or errors"
),
(
'cov_args='
,
None
,
'deprecated in favor of cov-args'
),
(
'extra_args='
,
'e'
,
'deprecated, pass extra options directly in the paver commandline'
),
(
"fail_fast"
,
None
,
"deprecated in favor of fail-fast"
),
(
'skip_clean'
,
None
,
'deprecated in favor of skip-clean'
),
(
"test_id="
,
None
,
"deprecated in favor of test-id"
),
],
share_with
=
[
'pavelib.utils.test.utils.clean_reports_dir'
])
@PassthroughTask
def
test_lib
(
options
,
passthrough_options
):
...
...
@@ -142,8 +150,8 @@ def test_lib(options, passthrough_options):
)
@cmdopts
([
(
"failed"
,
"f"
,
"Run only failed tests"
),
(
"fail
_
fast"
,
"x"
,
"Run only failed tests"
),
(
'cov
_
args='
,
'c'
,
'adds as args to coverage for the test run'
),
(
"fail
-
fast"
,
"x"
,
"Run only failed tests"
),
(
'cov
-
args='
,
'c'
,
'adds as args to coverage for the test run'
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
,
default
=
1
),
...
...
@@ -154,7 +162,9 @@ def test_lib(options, passthrough_options):
dest
=
'disable_migrations'
,
help
=
"Create tables directly from apps' models. Can also be used by exporting DISABLE_MIGRATIONS=1."
),
(
'cov_args='
,
None
,
'deprecated in favor of cov-args'
),
(
'extra_args='
,
'e'
,
'deprecated, pass extra options directly in the paver commandline'
),
(
"fail_fast"
,
None
,
"deprecated in favor of fail-fast"
),
])
@PassthroughTask
def
test_python
(
options
,
passthrough_options
):
...
...
@@ -182,11 +192,12 @@ def test_python(options, passthrough_options):
)
@cmdopts
([
(
"suites"
,
"s"
,
"List of unit test suites to run. (js, lib, cms, lms)"
),
(
'cov
_
args='
,
'c'
,
'adds as args to coverage for the test run'
),
(
'cov
-
args='
,
'c'
,
'adds as args to coverage for the test run'
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
make_option
(
"-q"
,
"--quiet"
,
action
=
"store_const"
,
const
=
0
,
dest
=
"verbosity"
),
make_option
(
"-v"
,
"--verbosity"
,
action
=
"count"
,
dest
=
"verbosity"
,
default
=
1
),
make_option
(
"--pdb"
,
action
=
"store_true"
,
help
=
"Drop into debugger on failures or errors"
),
(
'cov_args='
,
None
,
'deprecated in favor of cov-args'
),
(
'extra_args='
,
'e'
,
'deprecated, pass extra options directly in the paver commandline'
),
])
@PassthroughTask
...
...
@@ -213,7 +224,8 @@ def test(options, passthrough_options):
@task
@needs
(
'pavelib.prereqs.install_prereqs'
)
@cmdopts
([
(
"compare_branch="
,
"b"
,
"Branch to compare against, defaults to origin/master"
),
(
"compare-branch="
,
"b"
,
"Branch to compare against, defaults to origin/master"
),
(
"compare_branch="
,
None
,
"deprecated in favor of compare-branch"
),
])
def
coverage
(
options
):
"""
...
...
@@ -249,7 +261,8 @@ def coverage(options):
@task
@needs
(
'pavelib.prereqs.install_prereqs'
)
@cmdopts
([
(
"compare_branch="
,
"b"
,
"Branch to compare against, defaults to origin/master"
),
(
"compare-branch="
,
"b"
,
"Branch to compare against, defaults to origin/master"
),
(
"compare_branch="
,
None
,
"deprecated in favor of compare-branch"
),
])
def
diff_coverage
(
options
):
"""
...
...
pavelib/utils/test/suites/nose_suite.py
View file @
ef89c75b
...
...
@@ -95,7 +95,7 @@ class NoseTestSuite(TestSuite):
opts
+=
"--failed"
# This makes it so we use nose's fail-fast feature in two cases.
# Case 1: --fail
_
fast is passed as an arg in the paver command
# Case 1: --fail
-
fast is passed as an arg in the paver command
# Case 2: The environment variable TESTS_FAIL_FAST is set as True
env_fail_fast_set
=
(
'TESTS_FAIL_FAST'
in
os
.
environ
and
os
.
environ
[
'TEST_FAIL_FAST'
]
...
...
pavelib/utils/test/utils.py
View file @
ef89c75b
...
...
@@ -39,14 +39,15 @@ def clean_dir(directory):
@task
@cmdopts
([
(
'skip_clean'
,
'C'
,
'skip cleaning repository before running tests'
),
(
'skip-clean'
,
'C'
,
'skip cleaning repository before running tests'
),
(
'skip_clean'
,
None
,
'deprecated in favor of skip-clean'
),
])
def
clean_reports_dir
(
options
):
"""
Clean coverage files, to ensure that we don't use stale data to generate reports.
"""
if
getattr
(
options
,
'skip_clean'
,
False
):
print
'--skip
_
clean is set, skipping...'
print
'--skip
-
clean is set, skipping...'
return
# We delete the files but preserve the directory structure
...
...
scripts/accessibility-tests.sh
View file @
ef89c75b
...
...
@@ -24,7 +24,7 @@ paver a11y_coverage
if
[
"
$RUN_PA11YCRAWLER
"
=
"1"
]
then
echo
"Running pa11ycrawler against test course..."
paver pa11ycrawler
--fasttest
--skip
_
clean
--fetch-course
--with-html
paver pa11ycrawler
--fasttest
--skip
-
clean
--fetch-course
--with-html
echo
"Generating coverage report..."
paver pa11ycrawler_coverage
...
...
scripts/circle-ci-tests.sh
View file @
ef89c75b
...
...
@@ -37,11 +37,11 @@ if [ "$CIRCLE_NODE_TOTAL" == "1" ] ; then
echo
"via the CircleCI UI and adjust scripts/circle-ci-tests.sh to match."
echo
"Running tests for common/lib/ and pavelib/"
paver test_lib
--with-flaky
--cov
_
args
=
"-p"
||
EXIT
=
1
paver test_lib
--with-flaky
--cov
-
args
=
"-p"
||
EXIT
=
1
echo
"Running python tests for Studio"
paver test_system
-s
cms
--with-flaky
--cov
_
args
=
"-p"
||
EXIT
=
1
paver test_system
-s
cms
--with-flaky
--cov
-
args
=
"-p"
||
EXIT
=
1
echo
"Running python tests for lms"
paver test_system
-s
lms
--with-flaky
--cov
_
args
=
"-p"
||
EXIT
=
1
paver test_system
-s
lms
--with-flaky
--cov
-
args
=
"-p"
||
EXIT
=
1
exit
$EXIT
else
...
...
@@ -74,15 +74,15 @@ else
;;
1
)
# run all of the lms unit tests
paver test_system
-s
lms
--with-flaky
--cov
_
args
=
"-p"
paver test_system
-s
lms
--with-flaky
--cov
-
args
=
"-p"
;;
2
)
# run all of the cms unit tests
paver test_system
-s
cms
--with-flaky
--cov
_
args
=
"-p"
paver test_system
-s
cms
--with-flaky
--cov
-
args
=
"-p"
;;
3
)
# run the commonlib unit tests
paver test_lib
--with-flaky
--cov
_
args
=
"-p"
paver test_lib
--with-flaky
--cov
-
args
=
"-p"
;;
*
)
...
...
scripts/generic-ci-tests.sh
View file @
ef89c75b
...
...
@@ -99,7 +99,7 @@ case "$TEST_SUITE" in
;;
"lms-unit"
)
PAVER_ARGS
=
"--with-flaky --processes=-1 --cov
_
args='-p' -v"
PAVER_ARGS
=
"--with-flaky --processes=-1 --cov
-
args='-p' -v"
case
"
$SHARD
"
in
"all"
)
paver test_system
-s
lms
$PAVER_ARGS
...
...
@@ -128,11 +128,11 @@ case "$TEST_SUITE" in
;;
"cms-unit"
)
paver test_system
-s
cms
--with-flaky
--cov
_
args
=
"-p"
-v
paver test_system
-s
cms
--with-flaky
--cov
-
args
=
"-p"
-v
;;
"commonlib-unit"
)
paver test_lib
--with-flaky
--cov
_
args
=
"-p"
-v
paver test_lib
--with-flaky
--cov
-
args
=
"-p"
-v
;;
"js-unit"
)
...
...
@@ -141,8 +141,8 @@ case "$TEST_SUITE" in
;;
"commonlib-js-unit"
)
paver test_js
--coverage
--skip
_
clean
||
{
EXIT
=
1
;
}
paver test_lib
--skip
_clean
--with-flaky
--cov_
args
=
"-p"
||
{
EXIT
=
1
;
}
paver test_js
--coverage
--skip
-
clean
||
{
EXIT
=
1
;
}
paver test_lib
--skip
-clean
--with-flaky
--cov-
args
=
"-p"
||
{
EXIT
=
1
;
}
# This is to ensure that the build status of the shard is properly set.
# Because we are running two paver commands in a row, we need to capture
...
...
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