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

make exit conditions from running test_dir() explicit #2099

Merged
merged 4 commits into from
Sep 12, 2019
Merged

make exit conditions from running test_dir() explicit #2099

merged 4 commits into from
Sep 12, 2019

Conversation

jameslamb
Copy link
Contributor

Thanks for this great package!

I'd like to recommend a small (non-user-facing) change following the discussion in r-lib/testthat#912. Currently, devtools::test() implicitly relies on the fact that the default for argument stop_on_failure in testthat::test_dir() is FALSE.

The default behavior of devtools::test() is to return successfully if any tests fail, e.g. Rscript -e "devtools::test()" will return exit code 0 if you have failing tests.

Since stop_on_failure in testthat::test_dir() so meaningfully determines the behavior of devtools::test(), I think it would be valuable to supply stop_on_failure = FALSE explicitly in calls made by devtools.

I hope you'll consider this PR. Thanks!

@jimhester
Copy link
Member

jimhester commented Sep 3, 2019

I think we can just call it with stop_on_failure = FALSE directly.

@jameslamb
Copy link
Contributor Author

Sorry, could you elaborate Jim? What do you think should be changed?

My PR does propose calling testthat::test_dir() with stop_on_failure = FALSE directly.

R/test.R Outdated

testthat_args <- list(test_path, filter = filter, env = env, ... = ...)
testthat_args <- list(test_path, filter = filter, env = env, stop_on_failure = stop_on_failure, ... = ...)
Copy link
Member

@jimhester jimhester Sep 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can just be

testthat_args <- list(test_path, filter = filter, env = env, stop_on_failure = FALSE, ... = ...)

and I think you can remove the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha oh ok, got it! Was trying to be consistent with how you handle env. I can update it to just add this argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok changed this in a215003. I also rebased this PR to the most recent state of master

@jameslamb
Copy link
Contributor Author

I don't think the CI failures (specifically Travis) are a result of my PR here. I see this in the logs during setup

The command "sudo add-apt-repository -y "ppa:marutter/rrutter3.5"" failed and exited with 1 during .

@jimhester
Copy link
Member

Great work, this package is now better thanks to you!

Thanks!! You are da bomb!

@jimhester jimhester merged commit fbebcab into r-lib:master Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants