brodieG / unitizer

Easy R Unit Tests
Other
39 stars 6 forks source link

`unitize` Doesn't Set Directory Correctly When Auto-Detecting #269

Closed brodieG closed 3 years ago

brodieG commented 3 years ago
> unitize('validate')

Possible matching files from "tests/unitizer":
  1: validate.args.R
  2: validate.R
unitizer> 1
Selected file: validate.args.R
Preloads...Error in gzfile(file, "rb") : cannot open the connection             
In addition: Warning message:
In gzfile(file, "rb") :
  cannot open compressed file 'unitizer/_pre/lorem.objs/lorem.RDS', probable reason 'No such file or directory'
Error in unitize_core(test.file.inf, list(store.id.inf), state = state,  : 
  Argument `pre` could not be interpreted:
Error sourcing file `/mydir/tests/unitizer/_pre/lorem.R`, see above for details
| Unexpectedly exited before storing unitizer; tests were not saved or changed.

> setwd('tests')
> unitize('validate')

Possible matching files from "tests/unitizer":
  1: validate.args.R
  2: validate.R
unitizer> 1
Selected file: validate.args.R
+------------------------------------------------------------------------------+
| unitizer for: unitizer/validate.args.R                                       |
+------------------------------------------------------------------------------+
brodieG commented 3 years ago

This happened on docker because on docker the session doesn't have recommended mode set when we run a single "unitize" call (but does when running all the tests).