"run tests" button missing in RStudio IDE

I have just started a new package and created my first test file, but it doesn't have the "Run tests" icon at the top right as i am used to. I created the file using usethis::use_test(), so the location and names are fine, and the tests run ok when i run them from the Build panel, but the convenience of the file specific test button is missing, and the bar just looks the same as a regular R file. This is in 2023.06.0 Build 421
image

sessionInfo
> session_info()
- Session info ---------------------------------------------------------------
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       Windows 10 x64 (build 19044)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  Slovenian_Slovenia.1250
 ctype    Slovenian_Slovenia.1250
 tz       Europe/Prague
 date     2023-06-27
 rstudio  2023.06.0+421 Mountain Hydrangea (desktop)
 pandoc   NA

- Packages -------------------------------------------------------------------
 package     * version date (UTC) lib source
 brio          1.1.3   2021-11-30 [1] CRAN (R 4.1.3)
 cachem        1.0.8   2023-05-01 [1] CRAN (R 4.1.2)
 callr         3.7.3   2022-11-02 [1] CRAN (R 4.1.3)
 cli           3.6.1   2023-03-23 [1] CRAN (R 4.1.3)
 crayon        1.5.2   2022-09-29 [1] CRAN (R 4.1.3)
 devtools    * 2.4.5   2022-10-11 [1] CRAN (R 4.1.3)
 digest        0.6.31  2022-12-11 [1] CRAN (R 4.1.3)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.1.3)
 fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.1.3)
 fs            1.6.2   2023-04-25 [1] CRAN (R 4.1.2)
 glue          1.6.2   2022-02-24 [1] CRAN (R 4.1.3)
 htmltools     0.5.5   2023-03-23 [1] CRAN (R 4.1.3)
 htmlwidgets   1.6.2   2023-03-17 [1] CRAN (R 4.1.3)
 httpuv        1.6.11  2023-05-11 [1] CRAN (R 4.1.2)
 later         1.3.1   2023-05-02 [1] CRAN (R 4.1.2)
 lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.1.3)
 magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.1.3)
 memoise       2.0.1   2021-11-26 [1] CRAN (R 4.1.3)
 mime          0.12    2021-09-28 [1] CRAN (R 4.1.1)
 miniUI        0.1.1.1 2018-05-18 [1] CRAN (R 4.1.3)
 openxlsx      4.2.5.2 2023-02-06 [1] CRAN (R 4.1.3)
 pkgbuild      1.4.0   2022-11-27 [1] CRAN (R 4.1.3)
 pkgload       1.3.2   2022-11-16 [1] CRAN (R 4.1.3)
 prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.1.3)
 processx      3.8.1   2023-04-18 [1] CRAN (R 4.1.3)
 profvis       0.3.8   2023-05-02 [1] CRAN (R 4.1.2)
 promises      1.2.0.1 2021-02-11 [1] CRAN (R 4.1.3)
 ps            1.7.5   2023-04-18 [1] CRAN (R 4.1.3)
 purrr         1.0.1   2023-01-10 [1] CRAN (R 4.1.3)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.1.3)
 Rcpp          1.0.10  2023-01-22 [1] CRAN (R 4.1.3)
 remotes       2.4.2   2021-11-30 [1] CRAN (R 4.1.3)
 renv          0.17.3  2023-04-06 [1] CRAN (R 4.1.3)
 rlang         1.1.1   2023-04-28 [1] CRAN (R 4.1.2)
 rstudioapi    0.14    2022-08-22 [1] CRAN (R 4.1.3)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.1.3)
 shiny         1.7.4   2022-12-15 [1] CRAN (R 4.1.3)
 stringi       1.7.12  2023-01-11 [1] CRAN (R 4.1.3)
 stringr       1.5.0   2022-12-02 [1] CRAN (R 4.1.3)
 testthat      3.1.8   2023-05-04 [1] CRAN (R 4.1.2)
 urlchecker    1.0.1   2021-11-30 [1] CRAN (R 4.1.3)
 usethis     * 2.1.6   2022-05-25 [1] CRAN (R 4.1.3)
 vctrs         0.6.2   2023-04-19 [1] CRAN (R 4.1.2)
 xtable        1.8-4   2019-04-21 [1] CRAN (R 4.1.3)
 zip           2.3.0   2023-04-17 [1] CRAN (R 4.1.3)

oh, found it, the issue was that i was using testthat::test_that() instead of just plain test_that(), now the button is back. feels this might be worth fixing to take both options into account though?

image

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.