Skip to content

Commit f56ecfd

Browse files
authored
Make auto_test() less obviously recommended (#2161)
Fixes #1385
1 parent 258fb05 commit f56ecfd

File tree

4 files changed

+16
-52
lines changed

4 files changed

+16
-52
lines changed

β€ŽR/auto-test.Rβ€Ž

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
#' Watches code and tests for changes, rerunning tests as appropriate.
22
#'
3+
#' @description
4+
#' `r lifecycle::badge("superseded")`
5+
#'
36
#' The idea behind `auto_test()` is that you just leave it running while
47
#' you develop your code. Every time you save a file it will be automatically
58
#' tested and you can easily see if your changes have caused any test
6-
#' failures.
9+
#' failures.
710
#'
811
#' The current strategy for rerunning tests is as follows:
912
#'
1013
#' - if any code has changed, then those files are reloaded and all tests
1114
#' rerun
1215
#' - otherwise, each new or modified test is run
13-
#'
14-
#' In the future, `auto_test()` might implement one of the following more
15-
#' intelligent alternatives:
16-
#'
17-
#' - Use codetools to build up dependency tree and then rerun tests only
18-
#' when a dependency changes.
19-
#' - Mimic ruby's autotest and rerun only failing tests until they pass,
20-
#' and then rerun all tests.
21-
#
2216
#' @seealso [auto_test_package()]
2317
#' @export
2418
#' @param code_path path to directory containing code
@@ -27,7 +21,7 @@
2721
#' @param env environment in which to execute test suite.
2822
#' @param hash Passed on to [watch()]. When FALSE, uses less accurate
2923
#' modification time stamps, but those are faster for large files.
30-
#' @keywords debugging
24+
#' @keywords internal
3125
auto_test <- function(
3226
code_path,
3327
test_path,
@@ -67,15 +61,12 @@ auto_test <- function(
6761
watch(c(code_path, test_path), watcher, hash = hash)
6862
}
6963

70-
#' Watches a package for changes, rerunning tests as appropriate.
71-
#'
7264
#' @param pkg path to package
7365
#' @export
7466
#' @param reporter test reporter to use
7567
#' @param hash Passed on to [watch()]. When FALSE, uses less accurate
7668
#' modification time stamps, but those are faster for large files.
77-
#' @keywords debugging
78-
#' @seealso [auto_test()] for details on how method works
69+
#' @rdname auto_test
7970
auto_test_package <- function(
8071
pkg = ".",
8172
reporter = default_reporter(),

β€Ž_pkgdown.ymlβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ reference:
6464

6565
- title: Run tests
6666
contents:
67-
- starts_with("auto_test")
6867
- describe
6968
- starts_with("test_")
7069
- use_catch

β€Žman/auto_test.Rdβ€Ž

Lines changed: 10 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žman/auto_test_package.Rdβ€Ž

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
Β (0)