Closed IJBG closed 2 months ago
Tests run fine using devtools::test(), it's when the tests are run while using devtools::check() that they fail. Having problems with the save and loading of .rda files.
Error: `══ Warnings ════════════════════════════════════════════════════════════════════ ── Warning ('test_process_observers.R:8:3'): update_survey_events runs without error ── cannot open compressed file '', probable reason 'Invalid argument' Backtrace: ▆
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test_process_observers.R:8:3'): update_survey_events runs without error ──
Expected update_survey_events()
to run without any errors.
i Actually got a readChar(con, 5L, useBytes = TRUE)
: cannot open the connection
Backtrace:
▆
readChar(con, 5L, useBytes = TRUE)
: cannot open the connection
Backtrace:
▆[ FAIL 3 | WARN 3 | SKIP 0 | PASS 29 ] Error: Test failures Execution halted`
Having problems with the save and loading of .rda files.
Are these files created by some function and then tested against?
Having problems with the save and loading of .rda files.
Are these files created by some function and then tested against?
These files are created by update_survey_events, and I'm trying to check that it runs by testing the whole function with expect_no_error(). But maybe I should just remove this test, as I then check in the next test on that the file was created properly and doesn't have any NA observers.
Yess! Testing successes 🎉 I removed the test that was having the lingering loading/saving problem and instead evaluate mbbs_survey_events.rda after it's finished processing. I'm happy with this solution - I don't think any NA observers are going to slip through this pipeline. Ready for a review and then post-any-fixes merge
These files are created by update_survey_events, and I'm trying to check that it runs by testing the whole function with expect_no_error().
Yes that would be difficult to test as it would require reloading the package after the function is called.
Draft right now because I'm having errors with the testing I'm not quite sure how to solve..
In the meantime, primary_observer has been updated to it's third version see #87
The update_conversion_table function, update_mini_table, and update_survey_events have been reworked and simplified. Now, there's less manual input needed when new observers join the project or current observers survey a new route for the first time. Additionally, survey_list and survey_events update whenever new routes are added, or routes are updated (eg. a previously unuploaded stop gets uploaded to ebird).