-
Notifications
You must be signed in to change notification settings - Fork 41
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
Unified temp dir builder #1529
Unified temp dir builder #1529
Conversation
Test Results 3 files ±0 42 suites ±0 8m 22s ⏱️ +2s Results for commit 5f40284. ± Comparison against base commit 0451ff1. This pull request removes 1 and adds 8 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I left few comments/questions below.
…n the same module This was already the case for 'non-short' paths, for short path we append a sha of the 'module+name' to discrimate.
c6f512b
to
5f40284
Compare
Content
This PR add an api to generate temp directory in
mithril_common
test_tools
.It can be used in two ways:
With short path disabled (the default) the path generated is in the form of
/tmp/mithril_test/$module/$name
/var/folders/_k/7j0m5c_n4g94vgx9gxknp4tm0000gn/T/mithril_test/$module/$name
.Shorter path are generated by not including a subfolder with the module but instead appending the first 10 characters of the sha256 hash of both the module & name. If even with that the path total length is longer than the
short_path_max_len
then the name is truncated as much as needed.Example with the temp dir for
pallas_observer::test::get_current_stake_distribution_with_fallback
:/tmp/mithril_test/get_current_stake_distribution_with_fallback_5446f30db1
/var/folders/_k/7j0m5c_n4g94vgx9gxknp4tm0000gn/T/mithril_test/get_current_stake_5446f30db1
.In both cases if an a directory already exists with the same path it is removed alongside it's content.
Pre-submit checklist
Issue(s)
Closes #1508