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

Dump audit table to file specified by DANDI_TESTS_AUDIT_CSV envvar #1486

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Aug 14, 2024

Closes #1484.

@jwodder jwodder added the tests Add or improve existing tests label Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.62%. Comparing base (37b6350) to head (9abc18f).
Report is 34 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1486      +/-   ##
==========================================
+ Coverage   88.54%   88.62%   +0.07%     
==========================================
  Files          77       77              
  Lines       10565    10568       +3     
==========================================
+ Hits         9355     9366      +11     
+ Misses       1210     1202       -8     
Flag Coverage Δ
unittests 88.62% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

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

This is awesome, thank you!

That added code ATM not covered on CI. So we do not miss when code starts to rot (e.g. changes to dandi-archive etc), please add setting this env var to some tmp file in a single CI run, and verifying that file is created and has some representative number of records/lines.

note: I am trying to run tests locally with DANDI_TESTS_AUDIT_CSV=/tmp/audit.csv python -m pytest -v dandi/tests/test_dandiapi.py but they lead to 100% CPU utilization by celery although nothing alarming in that container's logs, very slow progress through tests, and some tests even failing... odd, likely unrelated, but may be worth checking run times of CI before / after this monday when I believe audit was merged...

if auditfile := os.environ.get("DANDI_TESTS_AUDIT_CSV", ""):
with open(auditfile, "wb") as fp:
run(
[
Copy link
Member

Choose a reason for hiding this comment

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

codecov still reports this block not covered by tests -- any idea why?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's just due to the annotations on GitHub not being updated. If I go to the Codecov site, the lines are marked covered.

@yarikoptic
Copy link
Member

3.10 failed with unrelated (just making note)

=========================== short test summary info ============================
ERROR dandi/tests/test_fixtures.py::test_organized_nwb_dir2 - pytest.PytestUnhandledThreadExceptionWarning: Exception in thread ExecutorManagerThread

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/joblib/externals/loky/process_executor.py", line 602, in run
    self.process_result_item(result_item)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/joblib/externals/loky/process_executor.py", line 752, in process_result_item
    warnings.warn(
UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.

@yarikoptic yarikoptic merged commit 44e097f into master Aug 15, 2024
27 of 28 checks passed
@yarikoptic yarikoptic deleted the gh-1484 branch August 15, 2024 15:00
Copy link

github-actions bot commented Sep 9, 2024

🚀 PR was released in 0.63.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released tests Add or improve existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to dump content of Audit table from Docker env upon completion of testing
2 participants