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

Ensure all package loads in setUpClass() take place inside a transaction #10719

Closed
jacobtylerwalls opened this issue Mar 27, 2024 · 1 comment · Fixed by #11438
Closed

Ensure all package loads in setUpClass() take place inside a transaction #10719

jacobtylerwalls opened this issue Mar 27, 2024 · 1 comment · Fixed by #11438
Assignees

Comments

@jacobtylerwalls
Copy link
Member

#10711 works toward isolating the package loads necessary for test cases, but there were a handful of package loads that couldn't fully be moved after super().setUpClass() initiates a transaction (so that they roll back cleanly when the class is torn down).

if not models.GraphModel.objects.filter(pk=cls.data_type_graphid).exists():
# TODO: pull this up higher so that it's not depending on running outside a transaction
# same issue in command_line_tests.py
test_pkg_path = os.path.join(test_settings.TEST_ROOT, "fixtures", "testing_prj", "testing_prj", "pkg")

This can cause annoying red herring test failures if the package load fails for unrelated reasons as experienced in #9613 (comment).

We should identify the root cause and fix the setup (or adjust the failing tests).

@jacobtylerwalls
Copy link
Member Author

  • permission_tests
  • api_tests
  • command_line_tests
  • resource_tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant