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

Ensures required packages are in Imports section #774

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

averissimo
Copy link
Contributor

@averissimo averissimo commented Aug 14, 2024

Pull Request

Fixes #518

Note on removals:

  • Remove broom as the broom:glances method can be replaced with generics::glances
    • According to my tests (methods are being deprecated as well)

Changes description

  • Removed conditional use of packages
  • Removes {broom} dependency
  • Uses rlang conditionally
  • Uses Suggested packages conditional on tests

@averissimo averissimo marked this pull request as ready for review August 14, 2024 15:39
Copy link
Contributor

github-actions bot commented Aug 14, 2024

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  -------------------------------------------------
R/tm_a_pca.R                    884     884  0.00%    138-1155
R/tm_a_regression.R             772     772  0.00%    162-1036
R/tm_data_table.R               215     215  0.00%    110-380
R/tm_file_viewer.R              173     173  0.00%    47-255
R/tm_front_page.R               133     122  8.27%    73-231
R/tm_g_association.R            340     340  0.00%    143-556
R/tm_g_bivariate.R              685     421  38.54%   315-794, 835, 946, 963, 981, 992-1014
R/tm_g_distribution.R          1103    1103  0.00%    155-1401
R/tm_g_response.R               364     364  0.00%    161-601
R/tm_g_scatterplot.R            729     729  0.00%    244-1075
R/tm_g_scatterplotmatrix.R      294     275  6.46%    182-511, 572, 586
R/tm_missing_data.R            1115    1115  0.00%    122-1410
R/tm_outliers.R                1031    1031  0.00%    162-1342
R/tm_t_crosstable.R             259     259  0.00%    148-454
R/tm_variable_browser.R         824     819  0.61%    89-1070, 1108-1291
R/utils.R                       156     125  19.87%   81-266, 296-327, 348, 351, 356, 371-392, 403, 408
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          9079    8749  3.63%

Diff against main

Filename                      Stmts    Miss  Cover
--------------------------  -------  ------  --------
R/tm_g_distribution.R            -7      -7  +100.00%
R/tm_g_scatterplot.R             -7      -7  +100.00%
R/tm_g_scatterplotmatrix.R       -2      -2  +0.04%
R/tm_missing_data.R              +4      +4  +100.00%
R/tm_t_crosstable.R              -2      -2  +100.00%
R/tm_variable_browser.R          -6      -6  +0.00%
TOTAL                           -20     -20  +0.01%

Results for commit: ad8ba68

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Aug 14, 2024

Unit Tests Summary

  1 files   22 suites   12m 50s ⏱️
145 tests 107 ✅ 38 💤 0 ❌
476 runs  438 ✅ 38 💤 0 ❌

Results for commit 27a75ad.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Aug 14, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
shinytest2-tm_g_distribution 💚 $60.65$ $-2.18$ $0$ $0$ $0$ $0$
shinytest2-tm_variable_browser 💚 $59.10$ $-1.05$ $0$ $0$ $0$ $0$

Results for commit bab0579

♻️ This comment has been updated with latest results.

@@ -44,6 +44,7 @@ test_that("e2e - tm_data_table: Verify checkbox displayed over data table", {
})

test_that("e2e - tm_data_table: Verify module displays data table", {
testthat::skip_if_not_installed("rvest")
Copy link
Contributor

@pawelru pawelru Aug 15, 2024

Choose a reason for hiding this comment

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

I have recently pushed changes into the teal due to noSuggest check and the class definition looks like this:
https://github.com/insightsengineering/teal/blob/7eac4d58a5373aa511f363a2f259d850749501f7/R/TealAppDriver.R#L10-L20

Just thinking loud now, would it help if we would have the following instead?

    if (!requireNamespace("shinytest2", quietly = TRUE)) {
      if (requireNamespace("testthat", quietly = TRUE) && getNamespace("testthat")$is_testing()) {  
       getNamespace("testthat")$skip("shinytest2 is not installed")
      } else {
        stop("Please install 'shinytest2' package to use this class.")
      }
    }

My motivation is to avoid a lot of skip statements in the upstream packages like here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's awesome, I'll create the PR in {teal} to do just this. I think the $is_testing() is not required as skip() throws an error and it's on testthat to capture it and handle

@m7pr
Copy link
Contributor

m7pr commented Nov 19, 2024

@averissimo is this still relevant?
Should we add to this sprint and get someone to review?

@averissimo
Copy link
Contributor Author

@m7pr it is, although it needs a new pass to make sure that nothing new has created a conflict here

I'm moving it to draft

@averissimo averissimo marked this pull request as draft December 3, 2024 13:51
* main: (42 commits)
  [skip actions] Bump version to 0.3.0.9061
  Stop R process if AppDriver fails in `test-examples` (#820)
  [skip actions] Bump version to 0.3.0.9060
  87 remove datasets - decrease package size (#818)
  [skip actions] Bump version to 0.3.0.9059
  Fix documentation note about links on r-devel (#817)
  [skip actions] Bump version to 0.3.0.9058
  get back staged deps config (#816)
  [skip actions] Bump version to 0.3.0.9057
  add setup-r-dependencies (#815)
  [skip actions] Bump version to 0.3.0.9056
  Teal version bump (#814)
  [skip actions] Bump version to 0.3.0.9055
  🗃️ `decorators` feature branch (#795)
  [skip actions] Bump version to 0.3.0.9054
  `teal.data::datanames()` is deprecated in favor of dot-prefix and `names()` (#794)
  [skip actions] Bump version to 0.3.0.9053
  Adds `roxy.shinylive` to pre-commit configuration (#793)
  [skip actions] Bump version to 0.3.0.9052
  add rmarkdown to VignetteBuilder (#792)
  ...
@@ -31,16 +31,30 @@ Depends:
teal.transform (>= 0.5.0.9015)
Copy link
Contributor Author

@averissimo averissimo Dec 18, 2024

Choose a reason for hiding this comment

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

Teal requirement needs to be bumped with insightsengineering/teal#1432

Possibly to teal (>= 0.15.2.9091),

Keeping conversation open until the PR is closed

Copy link
Contributor

Choose a reason for hiding this comment

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

I approved that PR, so working on this PR can continue.

@averissimo averissimo marked this pull request as ready for review December 18, 2024 18:41
Copy link
Contributor

Choose a reason for hiding this comment

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

I see changes in dependencies and I immediately think about verdepcheck. Can you please confirm that it is passing on this? If not - let's work on the deps versions.

This might need to wait for https://github.com/insightsengineering/teal.modules.general/pull/774/files#r1890465398

Copy link
Contributor

@llrs-roche llrs-roche left a comment

Choose a reason for hiding this comment

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

I left a couple of comments, as I haven't checked the code locally yet

@@ -31,16 +31,30 @@ Depends:
teal.transform (>= 0.5.0.9015)
Copy link
Contributor

Choose a reason for hiding this comment

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

I approved that PR, so working on this PR can continue.

DESCRIPTION Show resolved Hide resolved
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 003390c8-e31f-4b87-957d-7943778020cc
Copy link
Contributor

Choose a reason for hiding this comment

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

New Rstudio version :) I wonder what this is used for, as it was not disclosed on the release notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect soft dependencies
4 participants