Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up all modulestore testcases #6078

Merged
merged 2 commits into from
Dec 2, 2014
Merged

Conversation

jzoldak
Copy link
Contributor

@jzoldak jzoldak commented Nov 26, 2014

@cpennington @ormsbee

I'm breaking the work of mocking out the modulestore into a couple pieces so it's not in a huge PR that touches a bazillion files.

This first PR is a cleanup of all unit testcases that need a modulestore but aren't actually testing the modulestore implementation. Let's get this in first. Next will be the PR that mocks out the modulestore.

Included in this PR:

  1. Cleaned up the test modulestore configs to only the ones we want. See common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
  2. Changed all the tests that are using modulestore configs but are not testing modulestore implementation to use the lightest weight choice. There are still a few tests that are expecting certain setup from the toy course that I just left like that. We can circle back around to these later, they will be much easier to find now.
  3. Tagged tests that are relying on mongo to actually be running with a nose attrib "mongo". Thought this might be useful later. And for now I was using it to exclude those tests in the experimental PR that I have going for mocking out the mongo modulestore.
  4. While I was in there I cleaned up the imports on tests that I was touching. Fixed a number of them, but not all. And I got sick of doing that because it was slowing me down, but still it's nice on the ones I did get to.

An interesting aside is that PR #6061 that mocks out mongo is running unit tests in ~30 min. :)

@jzoldak jzoldak force-pushed the zoldak/modulestore-test-refactor branch 8 times, most recently from 7a12f8d to c0833af Compare November 30, 2014 21:37
@jzoldak
Copy link
Contributor Author

jzoldak commented Dec 1, 2014

@benpatterson @muhammad-ammar could you please review?

@@ -66,7 +67,12 @@ def get_json(self, path, data=None, follow=False, **extra):
return self.get(path, data or {}, follow, HTTP_ACCEPT="application/json", **extra)


@override_settings(MODULESTORE=TEST_DATA_MOCK_MODULESTORE)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review note: This will make sure that the studio tests use the lightest weight modulestore by default. The studio testcases rely on this CourseTestCase class rather than ModuleStoreTestCase directly.

@jzoldak jzoldak force-pushed the zoldak/modulestore-test-refactor branch 3 times, most recently from 7d83887 to ddb2858 Compare December 1, 2014 23:58
@benpatterson
Copy link
Contributor

@jzoldak as discussed, I 👍 the changes, with the idea that the tests being skipped now will be addressed in a subsequent PR.

@jzoldak jzoldak force-pushed the zoldak/modulestore-test-refactor branch from ddb2858 to 4bb9ffe Compare December 2, 2014 01:16
Jesse Zoldak added 2 commits December 2, 2014 07:09
Move modulestore config for tests to an importable location
Disable pylnt warning for lms imports in common tests
Refactor all testcases that loaded all xml courses
TE-610
TE-489
@jzoldak jzoldak force-pushed the zoldak/modulestore-test-refactor branch from 4bb9ffe to 121b313 Compare December 2, 2014 12:09
jzoldak pushed a commit that referenced this pull request Dec 2, 2014
@jzoldak jzoldak merged commit 17379f4 into master Dec 2, 2014
@jzoldak jzoldak deleted the zoldak/modulestore-test-refactor branch December 15, 2014 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants