Finding a test that cannot run.
DJJ88 opened this issue · 1 comments
Hello many thanks for the tinytest package.
I would have a feature request if it is not too costly.
While I do like the feature that the code break in the function, there are times where the test itself fails to run
and the tests are interrupted. For instance
Running test_dataTemplate.R........... 6 tests OK Error in c(3, 2, 2, 1, ) : argument 5 is empty
While this error is easy to spot with a simple search, it can happen that the same function is tested in multiple times and when making it more difficult to spot the test that could not run.
If we have an error before the test
1/shdfs
res1 <- dataTemplate:::elapsed_months("2002-06-30", c("2002-03-31", "2002-04-30","2002-04-01", "2002-05-31"))
expect_equal(res1,c(3,2,2,1))
## run_test_dir("/home/djj/Documents/ID/packages/dataTemplate/inst/tinytest/")
## Running test_dataTemplate.R........... 1000 tests OK Error in eval(expr, envir = e) : object 'shdfs' not found
In this situation we would have to use special tricks from the editor to find the test quickly enough.
So file that contains many tests might be more difficult to manage in this way.
A possible solution around this might be allow the user to add indices in each test. In case of error the last index that run can be thrown along with the error allowing the user to spot the culprit quickly.
Tests in the data.table
package operate in a similar fashion.
Hi there,
You're posting this in the validate
github repo, not the tinytest repo :-).
But anyway, I do have plans to add better reporting on errors with tinytest
, so I agree with the point and this is a good reminder.