Closed seth127 closed 2 years ago
accidentally passing an empty directory to the
auto_test_dir
argument
Odd. Haven't tried myself yet, but I would have expected an empty directory to hit into this error:
the user informatively warned (or maybe an actual error?) [...] Or probably even if they pass a directory that has none of the kinds of files we're looking for
Aborting in these cases sounds like the way to go to me (and is line with already existing errors like the one above and elsewhere).
Perhaps this was with an older version?
v1.0.1 included 0353932 (fix: read_csv_test_results: give informative "no CSVs found" error, 2021-08-17) and the error reported here matches the one I described in the commit message:
fix: read_csv_test_results: give informative "no CSVs found" error
If read_csv_test_results() is passed a directory that doesn't have any
CSV files, it fails with an unhelpful
`.x` is empty, and no `.init` supplied
Provide a better error message.
ahhhhh, that's probably right. @mgboyd1024 can you confirm what version of mrgvalidate
you were using? Run packageVersion("mrgvalidate")
from within that R session. Thanks.
Hey guys, The mrgvalidate package version is 1.0.0
Thanks @mgboyd1024. So indeed it looks like you were running on a version without the above fix. man_test_dir
has a similar check (added in the same pr, gh-64), so I think we should be covered.
@seth127, I'll close this, but please reopen if you think there's anything else to look into or do.
This was reported by @mgboyd1024 when trying to run
create_validation_docs()
and accidentally passing an empty directory to theauto_test_dir
argument:We should probably do better than
Error: .x is empty...
in that situation.In reality, all the
_dir
arguments should probably get checked and the user informatively warned (or maybe an actual error?) if they pass an empty directory to one of those arguments. Or probably even if they pass a directory that has none of the kinds of files we're looking for (which is different depending on which_dir
argument we're talking about).