Skip to content

Do not use testthat dependent features in the app#237

Merged
vedhav merged 5 commits intomainfrom
checkmate-error@main
Aug 6, 2025
Merged

Do not use testthat dependent features in the app#237
vedhav merged 5 commits intomainfrom
checkmate-error@main

Conversation

@vedhav
Copy link
Contributor

@vedhav vedhav commented Aug 4, 2025

teal.gallery e2e tests caught an error that originates here. If testthat package is not installed when running the app it throw an error in the app.

Warning: Error in makeExpectation: Package 'testthat' is required for checkmate's 'expect_*' extensions with backend 'testthat'
  195: stop
  194: makeExpectation [/tmp/RtmpCWBQUh/renv-package-new-52d51bba257/checkmate/R/makeExpectation.R#80]
  193: expect_proportion [/__w/teal.gallery/teal.gallery/RNA-seq/renv/staging/1/hermes#1]
  192: hermes::control_quality [/tmp/RtmpCWBQUh/renv-package-new-52d7cce5949/hermes/R/quality.R#39]
  191: <reactive> [/tmp/RtmpCWBQUh/renv-package-new-52d60c71064/teal.modules.hermes/R/tm_g_quality.R#300]
  171: control [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/reactives.R#870]
  170: <reactive> [/tmp/RtmpCWBQUh/renv-package-new-52d60c71064/teal.modules.hermes/R/tm_g_quality.R#309]
  150: object_flagged [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/reactives.R#870]
  149: <reactive> [/tmp/RtmpCWBQUh/renv-package-new-52d60c71064/teal.modules.hermes/R/tm_g_quality.R#325]
  129: object_final [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/reactives.R#870]
  128: <reactive> [/tmp/RtmpCWBQUh/renv-package-new-52d60c71064/teal.modules.hermes/R/tm_g_quality.R#346]
  108: plot_r [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/reactives.R#870]
  101: renderUI [/tmp/RtmpCWBQUh/renv-package-new-52d60693a47/teal.widgets/R/plot_with_settings.R#407]
  100: func [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/utils.R#1482]
   87: renderFunc [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/shinywrappers.R#263]
   86: output$teal-teal_modules-nav-quality_control-module-plot-plot_out_main [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/shinywrappers.R#133]
    1: shiny::runApp [/tmp/RtmpCWBQUh/renv-package-new-52d2e47a3fd/shiny/R/runapp.R#388]
    1) Navigates to all tabs without error

@vedhav vedhav added the core label Aug 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2025

Unit Tests Summary

  1 files   23 suites   1m 4s ⏱️
273 tests 267 ✅ 6 💤 0 ❌
786 runs  780 ✅ 6 💤 0 ❌

Results for commit afb6f89.

♻️ This comment has been updated with latest results.

@averissimo averissimo self-assigned this Aug 4, 2025
Copy link

@averissimo averissimo left a comment

Choose a reason for hiding this comment

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

It seems that expect_ was used interchangebly with assert_, good catch on this PR

@vedhav vedhav enabled auto-merge (squash) August 6, 2025 05:10
@vedhav vedhav force-pushed the checkmate-error@main branch from 0b126d9 to 1f89af4 Compare August 6, 2025 05:13
@vedhav vedhav force-pushed the checkmate-error@main branch from 1f89af4 to a7ad7f8 Compare August 6, 2025 05:28
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

badge

Code Coverage Summary

Filename                   Stmts    Miss  Cover    Missing
-----------------------  -------  ------  -------  ------------------------
R/assertthat.R                19       1  94.74%   149
R/calc_cor.R                  25       0  100.00%
R/checkmate.R                  4       0  100.00%
R/connections.R              143     125  12.59%   27-161, 215-287, 356-381
R/differential.R             101       3  97.03%   190, 193, 196
R/dplyr_compatibility.R        3       1  66.67%   23
R/draw_barplot.R              34       0  100.00%
R/draw_boxplot.R              71       5  92.96%   81, 88-89, 106, 109
R/draw_heatmap.R              35       1  97.14%   71
R/draw_scatterplot.R          32       4  87.50%   73-74, 87, 93
R/GeneSpec-class.R            68       0  100.00%
R/graphs.R                   107       3  97.20%   107-109
R/HermesData-class.R          35       4  88.57%   134-137
R/HermesData-methods.R       194       0  100.00%
R/HermesData-validate.R       44       0  100.00%
R/join_cdisc.R                37       0  100.00%
R/normalization.R            100       2  98.00%   194, 223
R/pca_cor_samplevar.R         59       0  100.00%
R/pca.R                       28       0  100.00%
R/quality.R                   75       3  96.00%   109-112
R/top_genes.R                 51       0  100.00%
R/utils.R                     98       0  100.00%
TOTAL                       1363     152  88.85%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: afb6f89

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@vedhav vedhav requested a review from averissimo August 6, 2025 07:58
Copy link

@averissimo averissimo left a comment

Choose a reason for hiding this comment

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

We should replace all expect_* to assert_* in the code. Otherwise, the same error might pop again in the future

Copy link

@averissimo averissimo left a comment

Choose a reason for hiding this comment

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

👍

@vedhav vedhav merged commit 71874af into main Aug 6, 2025
27 checks passed
@vedhav vedhav deleted the checkmate-error@main branch August 6, 2025 14:07
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants