-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fix all lints #327
Fix all lints #327
Conversation
Codecov Report
@@ Coverage Diff @@
## main #327 +/- ##
=======================================
Coverage ? 58.85%
=======================================
Files ? 46
Lines ? 3145
Branches ? 0
=======================================
Hits ? 1851
Misses ? 1294
Partials ? 0
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a lot of work. Thank you so much, @rempsyc!
I am just awaiting a few clarifications in my comments.
If we're not sure whether `x` is of length 1, we should also wrap it into `!all(x %in% names(data))` Co-authored-by: Indrajeet Patil <patilindrajeet.science@gmail.com>
Sorry, my last one should have been a comment, not commit. |
What's the point of Codecov Report if it doesn't work correctly? Or am I doing something wrong? |
Any idea why |
It's working as expected. We run our code coverage on Ubuntu machines, but now we run tests only on Windows machine. So, on Ubuntu, code coverage is 0. I change the workflow to use Windows instead.
Must be related to |
Co-authored-by: Indrajeet Patil <patilindrajeet.science@gmail.com>
Code coverage is about 60% |
Thanks Indra, that was it precisely. One of the example (grouped df) was causing the issue when |
There is a dependency error on older R versions:
Technically we could skip |
All of these issues are already fixed in workflows. If you push a new commit, you shouldn't see them anymore. |
@rempsyc I think some snapshots have changed again due to changes in effectsize. Can you please update them? Thanks. I don't have access to a Windows machine right now. |
The snapshot tests are still failing, but I am going to merge this anyway. Looks like snapshots are mismatched because of warnings. |
There's something weird going on. The following produces no warning in the console, in a reprex, using packageVersion("report")
#> [1] '0.5.5.4'
packageVersion("effectsize")
#> [1] '0.8.2.6'
sleep2 <- reshape(sleep, direction = "wide", idvar = "ID", timevar = "group")
x <- report::report(t.test(sleep2$extra.1, sleep2$extra.2, paired = TRUE)) Created on 2023-01-24 with reprex v2.0.2 But when doing the tests using Rstudio's "Run Tests" (on active file), Rstudio's |
Also, you can see from my last commit that my snapshots actually removed the warnings. Yet, in the snapshot errors, it looks like
What am I missing here? |
I am fairly certain this has to do with how I think a way to reconcile these differences is by using |
Sure, I can supress these warnings. But first, I would like to understand why in non-interactive contexts |
Or according to the GHA error perhaps it is actually behaving correctly, and emitting no error. But then it should not detect the old snapshots as having those warnings as they do not actually appear here in the current snapshots: https://github.com/easystats/report/blob/main/tests/testthat/_snaps/windows/report.htest-t-test.md |
I would try superassigning the data (with |
@mattansb thanks, that seems to have done the trick, thanks! :D |
There is no perfect solution here. Super-assignment creates objects in the parent environment, which breaks encapsulation for tests. This can lead to order effects, which are hard to debug if tests start failing. If you are not sure what I mean. Try the following. Create two test files. File: test_that("test-1", {
x <<- 4
expect_equal(x, 4)
}) File:
And then run This is just to give some context as to why we shouldn't be using |
Absolutely, but in this case, it solves the scoping issue that |
Definitely. I think you and I are on the same page here. Just wanted to give some context for Remi. Super-assignments can be seductive, so I like disillusioning people a bit :) I have already merged his PR that uses super-assignments to fix tests.
Is this something we can request be implemented in R itself? I've never made feature requests in R mailing list, though. So not sure how this works. |
I think we've discussed this in the past - @bwiernik ? |
Fixes all lints (easystats/easystats#334)