Skip to content

Commit

Permalink
Skip temp-media files delete in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
thenav56 committed Nov 6, 2023
1 parent e5f8cc9 commit 05c653f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deep/tests/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def setUp(self):
# This should be called here to access roles later
self.create_project_roles()
self.deep_test_files_path = []
if not os.path.exists(TEST_MEDIA_ROOT):
# NOTE: CI will clean itself
if os.environ.get('CI', '').lower() != 'true' and not os.path.exists(TEST_MEDIA_ROOT):
os.makedirs(TEST_MEDIA_ROOT)
super().setUp()

Expand Down
4 changes: 3 additions & 1 deletion utils/graphene/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def tearDownClass(cls):
super().tearDownClass()
# clear the temporary media files
try:
shutil.rmtree(os.path.join(settings.BASE_DIR, TEST_MEDIA_ROOT), ignore_errors=True)
# NOTE: CI will clean itself
if os.environ.get('CI', '').lower() != 'true':
shutil.rmtree(os.path.join(settings.BASE_DIR, TEST_MEDIA_ROOT), ignore_errors=True)
except FileNotFoundError:
pass

Expand Down

0 comments on commit 05c653f

Please sign in to comment.