-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Improve dataset test infrastructure #3450
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3450 +/- ##
=======================================
Coverage 76.11% 76.11%
=======================================
Files 105 105
Lines 9697 9697
Branches 1556 1556
=======================================
Hits 7381 7381
Misses 1836 1836
Partials 480 480 Continue to review full report at Codecov.
|
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.
Thanks!
Summary: * always use default config as base * fix test_all_configs decorator * lint * add a utility function to create a random string * move output check of inject_fake_data to dedicated method * always disable download and extract functionality Reviewed By: fmassa Differential Revision: D26756261 fbshipit-source-id: a720dce48148d4d69678d43a2c5ec50ac92d69a0
Currently, we only use the default config if the user didn't specify any
CONFIGS
. This means on the other hand that if he specifies a config, only the specified values are forwarded toinject_fake_data
.Since it may be the case that the user only specifies a part of available parameters and wants to leave the others on their default value, we should include them. With this PR the default config is always used as base and simply updated by the config of the user.
Sometimes the image or video filename is a random string. This PR adds a
create_random_string()
function for a convenient interface.The output checking of the
inject_fake_data()
method takes up most of the body of thecreate_dataset()
and thus drowning the actual important parts. In order to make the base class more maintainable, this PR moves the checking into a dedicated function.This PR splits the patching of the download / extract and check logic and only makes the patching of the check logic optional. Before we might run into scenarios where the
test_not_found_or_corrupted
test actually tried to download the dataset. This happens for example fordatasets.SBU
since it usesdownload=True
as default and in contrast to most other datasets.