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

Problem with run tests #87

Open
orehush opened this issue Feb 28, 2019 · 1 comment
Open

Problem with run tests #87

orehush opened this issue Feb 28, 2019 · 1 comment

Comments

@orehush
Copy link

orehush commented Feb 28, 2019

I want to add support another bot type but faced problem with running tests.

My OS is Linux Mint 18.2, python version is 3.5.2

Steps to reproduce

  1. Clone the project:
$ git clone [email protected]:orehush/permabots.git
Cloning into 'permabots'...
remote: Enumerating objects: 2431, done.
remote: Total 2431 (delta 0), reused 0 (delta 0), pack-reused 2431
Receiving objects: 100% (2431/2431), 2.61 MiB | 2.21 MiB/s, done.
Resolving deltas: 100% (1760/1760), done.
Checking connectivity... done.

$ cd permabots/
  1. Create virtualenv:
$ mkvirtualenv permabots_dev -p /usr/bin/python3
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/orehush/.virtualenvs/permabots_dev/bin/python3
Also creating executable in /home/orehush/.virtualenvs/permabots_dev/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
  1. Install requirements:
$ pip install -r requirements/test.txt 
...
Installing collected packages: pytz, django, djangorestframework, future, python-telegram-bot, MarkupSafe, Jinja2, six, python-dateutil, arrow, jinja2-time, requests, billiard, amqp, anyjson, kombu, celery, shortuuid, kik, messengerbot, coverage, pbr, mock, entrypoints, pycodestyle, mccabe, pyflakes, flake8, virtualenv, pluggy, toml, filelock, py, tox, fake-factory, factory-boy, django-filter
Successfully installed Jinja2-2.8 MarkupSafe-1.1.1 amqp-1.4.9 anyjson-0.3.3 arrow-0.13.1 billiard-3.3.0.23 celery-3.1.23 coverage-4.5.2 django-2.1.7 django-filter-0.13.0 djangorestframework-3.9.1 entrypoints-0.3 factory-boy-2.7.0 fake-factory-9999.9.9 filelock-3.0.10 flake8-3.7.7 future-0.17.1 jinja2-time-0.1.0 kik-1.0.7 kombu-3.0.37 mccabe-0.6.1 messengerbot-0.1.4 mock-2.0.0 pbr-5.1.2 pluggy-0.9.0 py-1.8.0 pycodestyle-2.5.0 pyflakes-2.1.0 python-dateutil-2.8.0 python-telegram-bot-4.2.0 pytz-2018.9 requests-2.10.0 shortuuid-0.4.3 six-1.10.0 toml-0.10.0 tox-3.7.0 virtualenv-16.4.1

  1. Run tests:
$ make test
python runtests.py tests
Creating test database for alias 'default'...
Traceback (most recent call last):
  File "runtests.py", line 38, in <module>
    run_tests(*sys.argv[1:])
  File "runtests.py", line 31, in run_tests
    failures = test_runner.run_tests(test_args)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/test/runner.py", line 604, in run_tests
    old_config = self.setup_databases()
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/test/runner.py", line 551, in setup_databases
    self.parallel, **kwargs
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/test/utils.py", line 174, in setup_databases
    serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/backends/base/creation.py", line 68, in create_test_db
    run_syncdb=True,
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/__init__.py", line 148, in call_command
    return command.execute(*args, **defaults)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/base.py", line 83, in wrapped
    res = handle_func(*args, **kwargs)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 203, in handle
    fake_initial=fake_initial,
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/migration.py", line 124, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/migrations/operations/models.py", line 330, in database_forwards
    new_model._meta.db_table,
  File "/home/orehush/.virtualenvs/permabots_dev/lib/python3.5/site-packages/django/db/backends/sqlite3/schema.py", line 93, in alter_db_table
    ) % old_db_table)
django.db.utils.NotSupportedError: Renaming the 'permabots_bot' table while in a transaction is not supported on SQLite because it would break referential integrity. Try adding `atomic = False` to the Migration class.
Makefile:30: recipe for target 'test' failed
make: *** [test] Error 1

Have I missed some configurations ?

@ckarrie
Copy link

ckarrie commented Nov 29, 2019

Add atomic = False to all Migration Classes

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

No branches or pull requests

2 participants