Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

(WIP) Problem: Django tests fail when run consecutively #511

Conversation

julianpistorius
Copy link
Contributor

In particular failures happen in the VCR checks for whether the
cassettes have all been played. This is because the TAS API results are
cached on disk.

Solution: Disable caching when testing by using the DummyCache backend

Checklist before merging Pull Requests

  • [ ] New test(s) included to reproduce the bug/verify the feature
  • [ ] Documentation created/updated at Example link to documentation to give context to the feature
  • Reviewed and approved by at least one other contributor.
  • [ ] If necessary, include a snippet in CHANGELOG.md
  • [ ] New variables supported in Clank
  • [ ] New variables committed to secrets repos

In particular failures happen in the VCR checks for whether the
cassettes have all been played. This is because the TAS API results are
cached on disk.

Solution: Disable caching when testing by using the `DummyCache` backend
@coveralls
Copy link

coveralls commented Sep 12, 2017

Coverage Status

Coverage decreased (-0.003%) to 35.743% when pulling 3fd27ad on julianpistorius:disable-cache-when-testing into 3d8a85a on cyverse:v28.

Copy link
Contributor

@steve-gregory steve-gregory left a comment

Choose a reason for hiding this comment

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

This will work, but we might be able to provide a better experience and example for other setting overrides in test

'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This could lead to unintended consequences.. TESTING previously enabled the ability to run ./manage.py test.

Rather than overloading TESTING perhaps we could go this route instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't be the first time I'm confused about the historical purpose for a variable/setting. The problem is we probably need caching disabled for all tests - so it becomes very tedious very quickly. But maybe your idea of making the caching backend configurable is the answer.

@julianpistorius
Copy link
Contributor Author

Ok, I'll rework this PR to make the backend configurable instead.

@julianpistorius julianpistorius changed the title Problem: Django tests fail when run consecutively (WIP) Problem: Django tests fail when run consecutively Sep 14, 2017
@steve-gregory steve-gregory added this to the Beneficent-Bolide (v28) milestone Sep 19, 2017
@steve-gregory steve-gregory removed this from the Beneficent-Bolide (v28) milestone Sep 28, 2017
@steve-gregory steve-gregory changed the base branch from v28 to master September 28, 2017 15:24
@cdosborn
Copy link
Contributor

Closed in favor of #626

@cdosborn cdosborn closed this Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants