test(renv): read lockfiles with renv::lockfile_read() for renv >= 1.2.4 - #142
Open
VincentGuyader wants to merge 1 commit into
Open
test(renv): read lockfiles with renv::lockfile_read() for renv >= 1.2.4#142VincentGuyader wants to merge 1 commit into
VincentGuyader wants to merge 1 commit into
Conversation
The renv tests read back generated lockfiles through the internal renv:::lockfile() path, which in renv 1.2.4 only accepts a manifest and errors on a lockfile with "don't know how to create a lockfile from an object of class 'list'". Switch to the exported renv::lockfile_read(), available and stable since well before 1.2.2, which returns a renv_lockfile object exposing $Packages directly. Package code is unaffected; this only touches the NOT_CRAN-gated renv tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI R CMD check fails on ubuntu/macos (release + oldrel) with:
mainitself is affected: its last green CI run predates the currentrenvrelease. This is arenvversion incompatibility, not a code regression, and it is unrelated to any package source change.Root cause
The
NOT_CRAN-gated renv tests read a generated lockfile back through the internalrenv:::lockfile(path)API. Inrenv1.2.4 that entry point only accepts a manifest and errors on a normal lockfile, raising the message above attest-renv_create.R:128. Package source (R/create_renv.R) is unaffected: it only writes lockfiles via the exportedrenv::snapshot(), which works fine on 1.2.4.Because these tests are
skip_on_cran(), the CRAN incoming check and win-builder are unaffected (both are 0/0/0); only the full CI check surfaces it.Fix
Test-only. Read lockfiles through the exported, stable
renv::lockfile_read(), available since well beforerenv1.2.2, which returns arenv_lockfileobject exposing$Packagesdirectly. Three mechanical replacements across the two renv test files:getFromNamespace("lockfile", "renv")(x)->renv::lockfile_read(x)expect_s3_class(y, "renv_lockfile_api")->expect_s3_class(y, "renv_lockfile")z$data()$Packages->z$PackagesVerification
renv1.2.2 and 1.2.4 (86 tests, 0 failed, 0 error, 1 skipped).tests/orR/; no source change.No NEWS entry: test-infrastructure only, not user-facing, and these tests are
skip_on_cran().