Skip to content

Commit

Permalink
chore(ci): make logging file available after e2e test (DEV-3436) (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Mar 22, 2024
1 parent d0061db commit 5825b3c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/tests-on-push.yml
Expand Up @@ -91,6 +91,13 @@ jobs:
run: poetry exec e2e-tests
- name: stop stack # see if this command can run (it isn't tested anywhere else)
run: poetry run dsp-tools stop-stack
- name: make logging file available
uses: actions/upload-artifact@v4
if: always()
with:
name: logging.log
path: /home/runner/.dsp-tools/logging.log
compression-level: 0


distribution:
Expand Down
2 changes: 1 addition & 1 deletion src/dsp_tools/utils/logger_config.py
Expand Up @@ -20,7 +20,7 @@ def logger_config() -> None:
text_format = "<level>{time:YYYY-MM-DD HH:mm:ss.SSS} | {level: <8} | {message}</level>"
rotation_size = "100 MB"
retention_number = 30
timestamp_str = datetime.now().strftime("%Y%m%d-%H%M")
timestamp_str = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")

logger.add(
sink=logger_savepath,
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/conftest.py
@@ -0,0 +1,10 @@
from dsp_tools.utils.logger_config import logger_config


def pytest_sessionstart() -> None:
"""
Called after the Session object has been created
and before performing collection and entering the run test loop.
See https://docs.pytest.org/en/latest/reference/reference.html#pytest.hookspec.pytest_sessionstart.
"""
logger_config()

0 comments on commit 5825b3c

Please sign in to comment.