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

feat: Emit Daemon logs for pytest test run #6671

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Dec 19, 2024

using watchdog to monitoring the daemon log in tmp pytest folder and emit in the debug logger level.

(I think there should be a better way to do this by not using circus to start the daemon in pytest)
To get the log in the daemon.log file, run test with:

pytest tests --log-cli-level=DEBUG

using watchdog to monitoring the daemon log in tmp pytest folder and
emit in the debug logger level.
@unkcpz unkcpz requested review from sphuber and agoscinski December 19, 2024 15:22
@unkcpz
Copy link
Member Author

unkcpz commented Dec 19, 2024

The implementation is a bit hacky, since it open a thread to run watchdog to monitoring the file and emit content to log.

f.seek(self._pos)
new_output = f.read()
if new_output:
logger.debug(new_output)
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe I should not use logger here since the content of the log file is in log format.

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 97.29730% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.95%. Comparing base (02cbe0c) to head (b689d3a).

Files with missing lines Patch % Lines
src/aiida/tools/pytest_fixtures/daemon.py 97.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6671      +/-   ##
==========================================
+ Coverage   77.94%   77.95%   +0.02%     
==========================================
  Files         563      563              
  Lines       41761    41796      +35     
==========================================
+ Hits        32545    32579      +34     
- Misses       9216     9217       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@unkcpz unkcpz changed the title Emit Daemon logs for pytest test run DevOps: Emit Daemon logs for pytest test run Dec 20, 2024
@unkcpz unkcpz changed the title DevOps: Emit Daemon logs for pytest test run feat: Emit Daemon logs for pytest test run Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant