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

Fixed error: ImportError: No module named notmigrations #17850

Merged
merged 1 commit into from
Apr 2, 2018

Conversation

amir-qayyum-khan
Copy link
Contributor

Background:

Was facing exception on running SGA xblock on master.

Traceback (most recent call last):
  File "manage.py", line 121, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 29, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 62, in handle
    failures = test_runner.run_tests(test_labels)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/test/runner.py", line 601, in run_tests
    old_config = self.setup_databases()
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/test/runner.py", line 546, in setup_databases
    self.parallel, **kwargs
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/test/utils.py", line 187, in setup_databases
    serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 69, in create_test_db
    run_syncdb=True,
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 83, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 52, in __init__
    self.build_graph()
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 203, in build_graph
    self.load_disk()
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 82, in load_disk
    module = import_module(module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named notmigrations

solution:

picked this solution https://stackoverflow.com/questions/46002731/upgrading-to-django-1-11-4-importerror

@pdpinch @nedbat @ormsbee

@openedx-webhooks
Copy link

Thanks for the pull request, @amir-qayyum-khan! I've created OSPR-2329 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Apr 2, 2018
@edx-status-bot
Copy link

Your PR has finished running tests.

@nedbat
Copy link
Contributor

nedbat commented Apr 2, 2018

@edx/platform-team A little Django 1.11 work left?

Copy link
Contributor

@jmbowman jmbowman left a comment

Choose a reason for hiding this comment

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

This change looks good to me, but you might hit other issues using ./manage.py test; we now typically run tests using either paver or pytest. We hadn't hit this issue before because pytest-django uses the --nomigrations command line option, and our test runs weren't really looking at the MIGRATION_MODULES setting.

@macdiesel macdiesel merged commit 161bf69 into openedx:master Apr 2, 2018
@openedx-webhooks
Copy link

@amir-qayyum-khan 🎉 Your pull request was merged!

Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production on Tuesday, April 03, 2018.

@amir-qayyum-khan
Copy link
Contributor Author

@jmbowman can you guid us what approach should we use for testing xblocks. Right know we use this command for testing our xblock SGA.

python manage.py lms --settings=test test edx_sga.tests.integration_tests

https://github.com/mitodl/edx-sga
cc @pdpinch

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@jmbowman
Copy link
Contributor

jmbowman commented Apr 3, 2018

@amir-qayyum-khan I just got the tests to run via pytest --pyargs edx_sga.tests.integration_tests, although 9 out of 48 failed because the "test_data" directory wasn't available (it isn't installed with edx_sga); it looks like that was just added 3 months ago, so those are probably new failures. You can run individual classes or test cases like pytest --pyargs edx_sga.tests.integration_tests::StaffGradedAssignmentXblockTests::test_replace_url_1_True (ddt data parameters are added to the method name like this, if present).

@amir-qayyum-khan
Copy link
Contributor Author

thanks for your feedback @jmbowman, i made issue on SGA to look into this mitodl/edx-sga#240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged open-source-contribution PR author is not from Axim or 2U
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants