Deprecate paver arguments with '_' in them in favor of versions with '-'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user