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

Testthat reporting success when it should report failure. #1358

Closed
mattfidler opened this issue Mar 20, 2021 · 6 comments
Closed

Testthat reporting success when it should report failure. #1358

mattfidler opened this issue Mar 20, 2021 · 6 comments
Labels
reprex needs a minimal reproducible example

Comments

@mattfidler
Copy link

I see the following in the test that log:

Start test: linear oral model gives extraCmt=2
  test-lincmt-solve.R:512:7 [success]
End test: linear oral model gives extraCmt=2

Model:

V=THETA[1];
CLx=THETA[2];
Ka=THETA[3];
K=CLx/V;
C2=linCmtA(rx__PTR__,t,0,1,2,K,V,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,Ka,0.0,1.0,0.0,0.0);

Error: lincmt-solve.R:1:1 [error]
Start test: loading and unloading works

But testthat reports this as a success:

https://github.com/nlmixrdevelopment/RxODE/actions/runs/669412373

While I don't want the tests to stop on an error I want the whole test suite to fail if there is one error hence I use stop_on_failure = FALSE.

In testthat 2 this did error, but now it does not. Is this new? It isn't entirely clear in the documentation what should happen with this option when the entire test suite is run.

Still failures seem inconsistent. Sometimes errors still cause testthat to fail for the project, sometimes they pass with errors. Is this error ignored since it is outside a testthat block?

Thank you for the package and your time.

@hadley
Copy link
Member

hadley commented Jul 7, 2021

Could you please create a reprex as a minimal package that demonstrates the problem?

@hadley hadley added the reprex needs a minimal reproducible example label Jul 7, 2021
@mattfidler
Copy link
Author

I'm afraid I don't know enough about the root of the problem to create a minimal package that demonstrates the problem.

If you think it is too much of an edge case to support please let me know

@hadley
Copy link
Member

hadley commented Jul 8, 2021

You don't need to know anything about the problem in order to create a minimal reprex — you just have to either start with a simple package and add the stuff you think contributes to it, or take the existing package and delete until it goes away.

@mattfidler
Copy link
Author

I will see if I can get some time to do this. Right now I'm a bit resource constrained.

@hadley
Copy link
Member

hadley commented Jul 8, 2021

No rush, I'm unlikely to look at it for weeks to months anyway 😄

@hadley
Copy link
Member

hadley commented Aug 4, 2023

Closing since it's now 2 years later 😄

@hadley hadley closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants