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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions dandi/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,27 @@
raise RuntimeError("Django container did not start up in time")
yield {"django_api_key": django_api_key}
finally:
if auditfile := os.environ.get("DANDI_TESTS_AUDIT_CSV", ""):
with open(auditfile, "wb") as fp:
run(

Check warning on line 493 in dandi/tests/fixtures.py

View check run for this annotation

Codecov / codecov/patch

dandi/tests/fixtures.py#L492-L493

Added lines #L492 - L493 were not covered by tests
[
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.

"docker",
"compose",
"exec",
"postgres",
"psql",
"-U",
"postgres",
"-d",
"django",
"--csv",
"-c",
"SELECT * FROM api_auditrecord;",
],
stdout=fp,
cwd=str(LOCAL_DOCKER_DIR),
check=True,
)
if persist in (None, "0"):
run(
["docker", "compose", "down", "-v"],
Expand Down
Loading