Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit test #5

Open
kurtawirth opened this issue May 11, 2018 · 5 comments
Open

Edit test #5

kurtawirth opened this issue May 11, 2018 · 5 comments
Assignees
Labels
bug Something isn't working next The next issue to work on todo

Comments

@kurtawirth
Copy link
Owner

kurtawirth commented May 11, 2018

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

@kurtawirth kurtawirth self-assigned this May 11, 2018
@ryantmoore
Copy link
Collaborator

ryantmoore commented May 11, 2018 via email

@kurtawirth kurtawirth changed the title Add additional tests to ensure stability Edit test May 11, 2018
@ryantmoore ryantmoore self-assigned this Jun 5, 2019
@ryantmoore ryantmoore added bug Something isn't working next The next issue to work on labels Jun 5, 2019
@ryantmoore
Copy link
Collaborator

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

@ryantmoore
Copy link
Collaborator

ryantmoore commented Jun 5, 2019

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?

@ryantmoore ryantmoore removed their assignment Jun 5, 2019
@kurtawirth
Copy link
Owner Author

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

@ryantmoore
Copy link
Collaborator

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

  • passes when I run devtools::test(), but
  • fails when I run devtools::check().

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next The next issue to work on todo
Projects
None yet
Development

No branches or pull requests

2 participants