-
Notifications
You must be signed in to change notification settings - Fork 12
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
New failure with dev testthat #150
Comments
I suspect it is again thinking it's running under Rstudio based on the message (i.e. Html output which would be used for the viewer, instead of ANSI CSI SGR for a standard terminal). I'll have some time next week to look at it, but in the meantime, are you sure the issue that came up in #149 was actually addressed in Looking at 'local.R' I think I still see the Thanks for reaching out. |
Yes, but now that's not only called automatically in the 3rd edition: https://github.com/r-lib/testthat/blob/master/R/local.R#L62-L64 |
I'm still seeing the variable set. I haven't looked into this in full, but I would have imagined this would not happen:
If you're sure this is fixed don't worry about it, I'll look under the full test set-up to confirm that is the actual issue. |
Aside, I find it useful to increment my .9000 numbers to know for sure I'm on the correct dev version. I realize this is a bit harder to do when you have multiple people working on the tree, but just a thought. |
Actually, obviously something is wrong in how I'm updating my git repo as I'm realizing the version is quite old, so hold on a sec. |
As a matter of policy, we only bump development versions when we need to use a specific feature in another package. If you want to check exactly which version you have installed, look at the sha. |
FWIW, my upstream was 'hadley/testthat' and it look like that stopped synchronizing. I updated to the most recent version and I see:
Obviously this is run outside of Rstudio. |
When I create a reprex I see: testthat::test_that("", {
print(Sys.getenv("RSTUDIO"))
testthat::succeed()
})
#> [1] "1" I think that's expected since it's run inside of RStudio and And when I run in a terminal I see:
Did you restart R after reinstalling? |
Hmm, I hadn't, but now I did and still get:
|
Oh, you're running from inside the testthat folder? testthat has the third edition turned on, so you'll get different results there. |
Ah, good to know. Yes, I was because I was building my local copy originally instead of |
Sorry to sound like a broken record, but I
It looks like 3rd ed is turned on for the remotes install:
I know nothing about this edition business (so don't know if it is actually turned on). Is it the intent that 3rd ed will be on by default? If so, is it surprising that we're seeing the above? It seems not. I might be missing something entirely here. |
You can read about it here: https://testthat.r-lib.org/articles/third-edition.html — it's activated on a package-by-package basis, and it's activated for testthat. To figure out what's going wrong with your package, you need to run it in a package that doesn't have the 3rd edition enabled. |
I'm not sure what you mean by "activated for testthat". I'm just using a I'll have time later this week to dig into what
To the file in question (style.R) and running the tests while in the
|
Hmm, I tried again and now I don't get this... I guess now that I've seen both behaviors I can try to figure out what's going on. |
It might be something to do with the way you run tests interacting with how testthat determines if you've opted-in to the third edition or not. As far as I can tell, this is the only package out of ~5000 revdeps with this problem. |
This is my fault. What really confused me is that running the tests changed the state of the RSTUDIO variable permanently, so any subsequent inspection would have the variable set. I have a lazy mock in there that's tripping up
While I don't love having to resubmit for this, I can hardly expect that Thanks for your patience with this. |
No problems, glad you got to the bottom of it 😄 |
V0.3.2 released fixes this. |
Would you mind taking a look please?
The text was updated successfully, but these errors were encountered: