diff --git a/common/lib/xmodule/xmodule/modulestore/perf_tests/test_asset_import_export.py b/common/lib/xmodule/xmodule/modulestore/perf_tests/test_asset_import_export.py index 087fdcfc2bb517fdc34aed9947ea3b56a2346e9a..47b89d6c339ec5e0193727d4e381db8e09ab9bca 100644 --- a/common/lib/xmodule/xmodule/modulestore/perf_tests/test_asset_import_export.py +++ b/common/lib/xmodule/xmodule/modulestore/perf_tests/test_asset_import_export.py @@ -22,13 +22,6 @@ from xmodule.modulestore.tests.utils import ( ) from xmodule.modulestore.perf_tests.generate_asset_xml import make_asset_xml, validate_xml, ASSET_XSD_FILE -# The dependency below needs to be installed manually from the development.txt file, which doesn't -# get installed during unit tests! -try: - from code_block_timer import CodeBlockTimer -except ImportError: - CodeBlockTimer = None - # Number of assets saved in the modulestore per test run. ASSET_AMOUNT_PER_TEST = (0, 1, 10, 100, 1000, 10000) @@ -139,86 +132,6 @@ class CrossStoreXMLRoundtrip(unittest.TestCase): ) -@ddt.ddt -@unittest.skip -class FindAssetTest(unittest.TestCase): - """ - This class exists to time asset finding in different modulestore - classes with different amounts of asset metadata. - """ - - # Use this attr to skip this test on regular unittest CI runs. - perf_test = True - - def setUp(self): - super(FindAssetTest, self).setUp() - self.export_dir = mkdtemp() - self.addCleanup(rmtree, self.export_dir, ignore_errors=True) - - @ddt.data(*itertools.product( - MODULESTORE_SETUPS, - ASSET_AMOUNT_PER_TEST, - )) - @ddt.unpack - def test_generate_find_timings(self, source_ms, num_assets): - """ - Generate timings for different amounts of asset metadata and different modulestores. - """ - if CodeBlockTimer is None: - pytest.skip("CodeBlockTimer undefined.") - - desc = "FindAssetTest:{}:{}".format( - SHORT_NAME_MAP[source_ms], - num_assets, - ) - - with CodeBlockTimer(desc): - - with CodeBlockTimer("fake_assets"): - # First, make the fake asset metadata. - make_asset_xml(num_assets, ASSET_XML_PATH) - validate_xml(ASSET_XSD_PATH, ASSET_XML_PATH) - - with source_ms.build() as (source_content, source_store): - source_course_key = source_store.make_course_key('a', 'course', 'course') - asset_key = source_course_key.make_asset_key( - AssetMetadata.GENERAL_ASSET_TYPE, 'silly_cat_picture.gif' - ) - - with CodeBlockTimer("initial_import"): - import_course_from_xml( - source_store, - 'test_user', - TEST_DATA_ROOT, - source_dirs=TEST_COURSE, - static_content_store=source_content, - target_id=source_course_key, - create_if_not_present=True, - raise_on_failure=True, - ) - - with CodeBlockTimer("find_nonexistent_asset"): - # More correct would be using the AssetManager.find() - but since the test - # has created its own test modulestore, the AssetManager can't be used. - __ = source_store.find_asset_metadata(asset_key) - - # Perform get_all_asset_metadata for each sort. - for sort in ALL_SORTS: - with CodeBlockTimer("get_asset_list:{}-{}".format( - sort[0], - 'asc' if sort[1] == ModuleStoreEnum.SortOrder.ascending else 'desc' - )): - # Grab two ranges of 50 assets using different sorts. - # Why 50? That's how many are displayed on the current Studio "Files & Uploads" page. - start_middle = num_assets / 2 - __ = source_store.get_all_asset_metadata( - source_course_key, 'asset', start=0, sort=sort, maxresults=50 - ) - __ = source_store.get_all_asset_metadata( - source_course_key, 'asset', start=start_middle, sort=sort, maxresults=50 - ) - - @ddt.ddt @unittest.skip class TestModulestoreAssetSize(unittest.TestCase): diff --git a/requirements/edx/development.in b/requirements/edx/development.in index db76c97814ad408b46fa07bd9ef4baf7340fbca7..132a1c90385942313ad9ea0840edee894733f31c 100644 --- a/requirements/edx/development.in +++ b/requirements/edx/development.in @@ -22,8 +22,5 @@ sphinx # Developer documentation builder vulture # Detects possible dead/unused code, used in scripts/find-dead-code.sh modernize # Used to make Python 2 code more modern with the intention of eventually porting it over to Python 3. -# Performance timer used in modulestore/perf_tests/test_asset_import_export.py --e git+https://github.com/doctoryes/code_block_timer.git@f3d0629f086bcc649c3c77f4bc5b9c2c8172c3bf#egg=code_block_timer - # The officially released version of django-debug-toolbar-mongo doesn't support DJDT 1.x. This commit does. -e git+https://github.com/hmarr/django-debug-toolbar-mongo.git@b0686a76f1ce3532088c4aee6e76b9abe61cc808#egg=django-debug-toolbar-mongo==0.1.10 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 188050556d9c9af63523449da0f98b964e0767fe..74acee7ecd4ba077cb08626359a96adf33a9fda9 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -8,7 +8,6 @@ -e common/lib/calc -e common/lib/capa -e common/lib/chem --e git+https://github.com/doctoryes/code_block_timer.git@f3d0629f086bcc649c3c77f4bc5b9c2c8172c3bf#egg=code_block_timer -e git+https://github.com/edx/codejail.git@a320d43ce6b9c93b17636b2491f724d9e433be47#egg=codejail git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd39158450639e2e1dc#egg=crowdsourcehinter-xblock==0.1 git+https://github.com/mitodl/django-cas.git@afac57bc523f145ae826f4ed3d4fa8b2c86c5364#egg=django-cas==2.1.1 diff --git a/scripts/dependencies/development.py b/scripts/dependencies/development.py index 546dd21b3e0570acbf12ab279bdf32616f2dd4b3..506d7c34d81dad0d72d5f0a5e5bf7706835c4924 100755 --- a/scripts/dependencies/development.py +++ b/scripts/dependencies/development.py @@ -20,7 +20,6 @@ pattern_fragments = [ r'^xmodule/modulestore/perf_tests' # modulestore performance tests # Development-only package dependencies - r'^code_block_timer', # code_block_timer r'^debug_toolbar', # django-debug-toolbar ]