Skip to content

Commit

Permalink
update the temp_output_directory to include python version
Browse files Browse the repository at this point in the history
  • Loading branch information
bgunnar5 committed Sep 13, 2024
1 parent 7050822 commit 0c74021
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
This module contains pytest fixtures to be used throughout the entire test suite.
"""
import os
import sys
from copy import copy
from glob import glob
from time import sleep
Expand Down Expand Up @@ -110,7 +111,9 @@ def temp_output_dir(tmp_path_factory: TempPathFactory) -> str:
"""
# Log the cwd, then create and move into the temporary one
cwd = os.getcwd()
temp_integration_outfile_dir = tmp_path_factory.mktemp("integration_outfiles_")
temp_integration_outfile_dir = tmp_path_factory.mktemp(
f"python_{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}_"
)
os.chdir(temp_integration_outfile_dir)

yield temp_integration_outfile_dir
Expand Down
2 changes: 1 addition & 1 deletion tests/context_managers/celery_workers_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def start_worker(self, worker_launch_cmd: List[str]):
app.worker_main instead of the normal "celery -A <app name> worker" command to launch the workers
since our celery app is created in a pytest fixture and is unrecognizable by the celery command.
For each worker, the output of it's logs are sent to
/tmp/`whoami`/pytest-of-`whoami`/pytest-current/integration_outfiles_current/ under a file with a name
/tmp/`whoami`/pytest-of-`whoami`/pytest-current/python_{major}.{minor}.{micro}_current/ under a file with a name
similar to: test_worker_*.log.
NOTE: pytest-current/ will have the results of the most recent test run. If you want to see a previous run
check under pytest-<integer value>/. HOWEVER, only the 3 most recent test runs will be saved.
Expand Down
2 changes: 1 addition & 1 deletion tests/context_managers/server_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __exit__(self, exc_type: Type[Exception], exc_value: Exception, traceback: T
def initialize_server(self):
"""
Initialize the setup for the local redis server. We'll write the folder to:
/tmp/`whoami`/pytest-of-`whoami`/pytest-current/integration_outfiles_current/
/tmp/`whoami`/pytest-of-`whoami`/pytest-current/python_{major}.{minor}.{micro}_current/
We'll set the password to be 'merlin-test-server' so it'll be easy to shutdown if necessary
"""
subprocess.run(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/common/test_sample_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TestSampleIndex:
NOTE to see output of creating any hierarchy, change `write_all_hierarchies` to True.
The results of each hierarchy will be written to:
/tmp/`whoami`/pytest/pytest-of-`whoami`/pytest-current/integration_outfiles_current/test_sample_index/<name of the test>
/tmp/`whoami`/pytest/pytest-of-`whoami`/pytest-current/python_{major}.{minor}.{micro}_current/test_sample_index/<name of the test>
"""

write_all_hierarchies = False
Expand Down

0 comments on commit 0c74021

Please sign in to comment.