pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/R-testthat



Module Name:    pkgsrc
Committed By:   mef
Date:           Sat Apr 23 12:43:35 UTC 2022

Modified Files:
        pkgsrc/devel/R-testthat: Makefile distinfo

Log Message:
(devel/R-testthat) Updated 3.0.4 to 3.1.3

# testthat 3.1.3

* Package that explicitly depend on rlang in their description file
  are now opting into a new snapshot display for errors, warnings, and
  messages. Previously this only concerned packages that explicitly
  depended on rlang >= 1.0.0. This display will eventually become the
  default for all packages.

  Changes include:

  - Condition classes are no longer included in the snapshot by
    default. This is to avoid snapshot noise when upstream code adds
    or changes a class. For instance, r-devel has added classes to
    base errors.

  - Warnings and errors are now printed with rlang, including the
    `call` field. This makes it easy to monitor the full appearance of
    warning and error messages as they are displayed to users.

    This change is part of a push towards mentioning the useful
    context of an error as part of messages, see the release notes of
    rlang 1.0.0 for more about this.

* Test results show hyperlinks to failed expectation when supported (#1544).

# testthat 3.1.2

* testthat now uses brio for all reading and writing (#1120). This
  ensures that snapshots always use "\n" to separate lines (#1516).

* `expect_snapshot()` no longer inadvertently trims trailing new lines off
  of errors and messages (#1509).

* If `expect_snapshot()` generates a snapshot with different value but
  still compares as equal (e.g. because you've set a numeric tolerance), the
  saved values no longer update if another snapshot in the same file changes.

* `expect_snapshot()` now only adds a `.new` file for the variants that
  actually changed, not all variants, while `expect_snapshot_file()` with
  variant with no longer immediately deletes `.new` files (#1468).

* `expect_snapshot_file()` gains a `transform` argument to match
  `expect_snapshot()` (#1474). `compare` now defaults to `NULL`, automatically
  guessing the comparison type based on the extension.

* `expect_snapshot_file()` now errors if the file being snapshot does not exist;
  `SnapshotReporter` also now treats the file directory as an absolute path
  (#1476, @malcolmbarrett)

* New `expect_snapshot_warning()` to match `expect_snapshot_error()` (#1532).

* `JUnitReporter` now includes skip messages/reasons (@rfineman, #1507)

* `local_reproducible_output()` gains a `lang` argument so that you can
  optionally override the language used to translate error messages (#1483).
  It also sets the global option `cli.num_colors` in addition to
  `crayon.enabled`.

* `test_that()` no longer inappropriately skips when calling `expect_equal()`
  when you've temporarily set the locale to non-UTF-8 (#1285).

* `skip_if_offline()` now automatically calls `skip_on_cran()` (#1479).

* `snapshot_accept()` and `snapshot_review()` now work with exactly the same
  file specification which can be a snapshot name, a file name, or a directory
  (#1546). They both work better with variants (#1508). Snapshot cleanup also
  removes all empty directories (#1457).

* When a snapshot changes the hint also mentions that you can use
  `snapshot_review()` (#1500, @DanChaltiel) and the message tells you what
  variant is active (#1540).
* JUnit reporter now includes skip messages/reasons (@rfineman, #1507).

# testthat 3.1.1

* Condition expectations like `expect_error()` now match across the
  ancestry of chained errors (#1493). You can disable this by setting
  the new `inherit` argument to `FALSE`.

* Added preliminary support for rlang 1.0 errors. It is disabled by
  default for the time being. To activate it, specify `rlang (>=
  1.0.0)` in your `DESCRIPTION` file (or `>= 0.99.0.9001` if you're
  using the dev version).

  Once activated, snapshots will now use rlang to print error and
  warning messages, including the `Error:` and `Warning:`
  prefixes. This means the `call` field of conditions is now displayed
  in snapshots if present. Parent error messages are also displayed.
  Following this change, all snapshots including error and warning
  messages need to be revalidated.

  We will enable the new rlang 1.0 output unconditionally in a future
  release.

* `expect_snapshot()` gains a new argument `cnd_class` to control
  whether to show the class of errors, warnings, and messages.

  The default is currently unchanged so that condition classes keep
  being included in snapshots. However, we plan to change the default
  to `FALSE` in an upcoming release to prevent distracting snapshot
  diffing as upstream packages add error classes. For instance, the
  development version of R is currently adding classes to basic
  errors, which causes spurious snapshot changes when testing against
  R-devel on CI.

  If you depend on rlang 1.0 (see above), the default is already set
  to `FALSE`.

* `expect_snapshot()` no longer processes rlang injection operators
  like `!!`.

* Fixed bug in expectations with long inputs that use `::` (#1472).

# testthat 3.1.0

## Snapshot tests

* `expect_snapshot()` is no longer experimental.

* `expect_snapshot()` and friends gets an experimental new `variant` argument
  which causes the snapshot to be saved in `_snaps/{variant}/{test}.md` instead
  of `_snaps/{test}.md`. This allows you to generate (and compare) unique
  snapshots for different scenarios like operating system or R version (#1143).

* `expect_snapshot()` gains a `transform` argument, which should be a function that
  takes a character vector of lines and returns a modified character vector
  of lines. This makes it easy to remove sensitive (e.g. API keys) or
  stochastic (e.g. random temporary directory names) from snapshot output
  (#1345).

* `expect_snapshot_file()` now replaces previous `.new` snapshot if code
  fails again with a different value.

* `expect_snapshot_value()` now has an explicit `tolerance` argument which
  uses the testthat default, thus making it more like `expect_equal()` rather
  than `expect_identical()`. Set it to `NULL` if you want precise comparisons
  (#1309). `expect_snapshot_value(style = "deparse")` now works with negative
  values (#1342).

* If a test containing multiple snapshots fails (or skips) in between snapshots,
  the later snapshots are now silently restored. (Previously this warned and
  reset all snapshots, not just later snapshots).

* If you have multiple tests with the same name that use snapshots (not a good
  idea), you will no longer get a warning. Instead the snapshots will be
  aggregated across the tests.

## Breaking changes

* Condition expectations now consistently return the expected
  condition instead of the return value (#1371). Previously, they
  would only return the condition if the return value was `NULL`,
  leading to inconsistent behaviour.

  This is a breaking change to the 3rd edition. Where you
  could previously do:

  ```
  expect_equal(expect_warning(f(), "warning"), "value")
  ```

  You must now use condition expectations on the outside:

  ```
  expect_warning(expect_equal(f(), "value"), "warning")

  # Equivalently, save the value before inspection
  expect_warning(value <- f(), "warning")
  expect_equal(value, "value")
  ```

  This breaking change makes testthat more consistent. It also makes
  it possible to inspect both the value and the warning, which would
  otherwise require additional tools.

## Minor improvements and bug fixes

* Errors in test blocks now display the call if stored in the condition object
  (#1418). Uncaught errors now show their class (#1426).

* Multi-line skips only show the first line in the skip summary.

* `expr_label()`, which is used to concisely describe expressions used in
  expectations, now does a better job of summarising infix function (#1442).

* `local_reproducible_output()` now sets the `max.print` option to 99999
  (the default), so your tests are unaffected by any changes you might've
  made in your `.Rprofile` (1367).

* `ProgressReporter` (the default only) now stops at the end of a file; this
  ensures that you see the results of all related tests, and ensures that
  snapshots are handled consistently (#1402).

* `ProgressReporter` now uses an env var to adjust the maximum number of
  failures. This makes it easier to adjust when the tests are run in a
  subprocess, as is common when using RStudio (#1450).

* `skip_on_os()` gains an `arch` argument so you can also choose to skip
  selected architectures (#1421).

* `test_that()` now correctly errors when an expectation fails when run
  interactively (#1430).

* `test_that()` now automatically and correctly generate an "empty test"
  skip if it only generates warnings or messages (and doesn't contain any
  expectations).

* `testthat_tolerance()` no longer has an unused argument.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 pkgsrc/devel/R-testthat/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/devel/R-testthat/distinfo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/R-testthat/Makefile
diff -u pkgsrc/devel/R-testthat/Makefile:1.11 pkgsrc/devel/R-testthat/Makefile:1.12
--- pkgsrc/devel/R-testthat/Makefile:1.11       Tue Aug 17 15:25:42 2021
+++ pkgsrc/devel/R-testthat/Makefile    Sat Apr 23 12:43:35 2022
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.11 2021/08/17 15:25:42 mef Exp $
+# $NetBSD: Makefile,v 1.12 2022/04/23 12:43:35 mef Exp $
 
 R_PKGNAME=     testthat
-R_PKGVER=      3.0.4
+R_PKGVER=      3.1.3
 CATEGORIES=    devel
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
@@ -13,8 +13,8 @@ DEPENDS+=     R-cli>=2.4.0:../../devel/R-cli
 DEPENDS+=      R-crayon>=1.3.4:../../devel/R-crayon
 DEPENDS+=      R-evaluate>=0.14:../../devel/R-evaluate
 DEPENDS+=      R-magrittr>=1.5:../../devel/R-magrittr
-DEPENDS+=      R-rlang>=0.4.9:../../devel/R-rlang
-DEPENDS+=      R-withr>=2.3.0:../../devel/R-withr
+DEPENDS+=      R-rlang>=1.0.1:../../devel/R-rlang
+DEPENDS+=      R-withr>=2.4.3:../../devel/R-withr
 DEPENDS+=      R-praise>=1.0.0:../../misc/R-praise
 DEPENDS+=      R-digest>=0.6.20:../../security/R-digest
 DEPENDS+=      R-ellipsis>=0.2.0:../../math/R-ellipsis
@@ -31,6 +31,11 @@ TEST_DEPENDS+=       R-mockery-[0-9]*:../../de
 TEST_DEPENDS+= R-diffviewer-[0-9]*:../../www/R-diffviewer
 TEST_DEPENDS+= R-callr>=3.5.1:../../devel/R-callr
 TEST_DEPENDS+= tex-inconsolata-[0-9]*:../../fonts/tex-inconsolata
+TEST_DEPENDS+= R-brio-[0-9]*:../../devel/R-brio
+TEST_DEPENDS+= R-desc-[0-9]*:../../devel/R-desc
+TEST_DEPENDS+= R-pkgload-[0-9]*:../../devel/R-pkgload
+TEST_DEPENDS+= R-praise-[0-9]*:../../misc/R-praise
+TEST_DEPENDS+= R-waldo-[0-9]*:../../devel/R-waldo
 
 USE_LANGUAGES= c c++
 

Index: pkgsrc/devel/R-testthat/distinfo
diff -u pkgsrc/devel/R-testthat/distinfo:1.9 pkgsrc/devel/R-testthat/distinfo:1.10
--- pkgsrc/devel/R-testthat/distinfo:1.9        Tue Oct 26 10:14:09 2021
+++ pkgsrc/devel/R-testthat/distinfo    Sat Apr 23 12:43:35 2022
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.9 2021/10/26 10:14:09 nia Exp $
+$NetBSD: distinfo,v 1.10 2022/04/23 12:43:35 mef Exp $
 
-BLAKE2s (R/testthat_3.0.4.tar.gz) = d917dc90546d09fc1ce851fa94074f3bf98c0d763e79a05b18308250ebcc01da
-SHA512 (R/testthat_3.0.4.tar.gz) = c5771e49201a2047fabdd5efd3b3821b1a4fa08f5be28190ca11f69a70f63041e972b9ddc61f4daea32e2aabb237b4641046cc019b089ce7f8c30a00b2d09262
-Size (R/testthat_3.0.4.tar.gz) = 688142 bytes
+BLAKE2s (R/testthat_3.1.3.tar.gz) = ea3cd699bfa3fa41b0f3ebd9ecceabdc1475011dacfd3669d2b44077c497b5c7
+SHA512 (R/testthat_3.1.3.tar.gz) = 44852b64f4834b0f61ce00fc20e65bcb7af07aa3810f341e5942bdcc55424e582425e086207380431ce11dbc0606411a25eb546154ff45f4848698ec9ffc5542
+Size (R/testthat_3.1.3.tar.gz) = 703301 bytes



Home | Main Index | Thread Index | Old Index