kurtawirth / botscan

R tool for scanning Twitter for bot activity on a conversation level.
GNU General Public License v3.0
10 stars 6 forks source link

Edit test #5

Open kurtawirth opened 6 years ago

kurtawirth commented 6 years ago

To include "equal to or greater than" 1 and 0.

ryantmoore commented 6 years ago

@kurtawirth Please enumerate each test you’d like to see implemented at this stage as a separate issue, or within an issue.

On Fri, May 11, 2018 at 14:44 Kurt Wirth notifications@github.com wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kurtawirth/botscan/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/ACFxUT0sZPN_rg4_q8fSECZc8g_-pZLFks5txdwngaJpZM4T75X6 .

--

Ryan T. Moore www.ryantmoore.org

ryantmoore commented 5 years ago

This needs to be edited, as compiling version 2.0.1 produces an error in the test.

ryantmoore commented 5 years ago

Test/bom Error

I edited tests/testthat/test.expectednumbers.R (now called test_validoutput.R) to be a valid set of small tests in commit 79f5fd5. However, it relies on a call to botscan(), which relies on creating the bom object in the workspace with setup_botscan(). Because of the environment the tests are run in, even if I have a valid bom in my working directory, the test does not use it.

When I devtools::check() the package, this test-related error appears:

Starting user account checking
<simpleError in doTryCatch(return(expr), name, parentenv, handler): object 'bom' not found>

A quick solution

We could include a sample dataset in the package on which the test (and other function demos) could be run. @kurtawirth, your thought?

kurtawirth commented 5 years ago

Good idea. Will work with you to make this happen.

ryantmoore commented 5 years ago

Using the sampleData.RData that you sent along, @kurtawirth, I've implemented this, after changing the name to test_object.RData. I followed http://r-pkgs.had.co.nz/data.html, under "Other data", where Wickham notes

Data for tests: it’s ok to put small files directly in your test directory. But remember unit tests are for testing correctness, not performance, so keep the size small.

Placing test_object.RData in tests/testthat/, and adding load("test_object.RData") to test_validoutput.R

To do/answer?

  1. This needs to be investigated further until the check is passed.
  2. Is this object "small", and consistent with good testing practices?
  3. devtools::check() (e.g.) now returns a note about depending on R 3.5.0, as a result of this object.