Message-ID: <23442.29603.255182.477477@rob.eddelbuettel.com>
Date: 2018-09-07T12:48:35Z
From: Dirk Eddelbuettel
Subject: [R-pkg-devel] Submission to CRAN when package needs personal data (API key)
In-Reply-To: <CABtg=KkYMzouNH9-pmvjd4pSpjWMS7RhE8BwEZ4TwDGdhdmdyA@mail.gmail.com>
On 7 September 2018 at 13:08, G?bor Cs?rdi wrote:
| On Fri, Sep 7, 2018 at 12:29 PM Dirk Eddelbuettel <edd at debian.org> wrote:
| >
| >
| > On 7 September 2018 at 09:27, G?bor Cs?rdi wrote:
| > | When are users running tests for packages at all? The tests are by default
| > | no even installed with the package. The only time I usually do this is when
| >
| > Which some people consider to be the wrong decision by testthat.
|
| How is testthat related to this? When you `R CMD INSTALL` a package,
| AFAICT it does not install the test by default. Independently of what
| testsuite you use.
I presume you know the other per the bottom part of the email. Following the
(very early best practive started by P Grosjean, M Maechler and others)
tests/doRUnit.R always calls out to files in inst/tests or inst/unitTests.
Which. Get. Installed.
For every user. Automatically. A much better default.
| > Base R has a set of functions
| >
| > tools::testInstalledBasic
| > tools::testInstalledPackage
| > tools::testInstalledPackages
| >
| > so that an _installed_ package can be tested. Unless, of course, it uses
| > testthat. Matt Dowle just run into this (per a question on StackOverflow).
| > RUnit, on the other hand, supports this.
|
| I am probably missing sg, but is this expected to run the Rcpp test suite?
|
| tools::testInstalledPackage("Rcpp", types = "tests")
|
| Because it takes 1ms to run and has no output.
You probably need a) the required env var set and b) the RUnit test runner to
loop over RUnit tests and c) make sure the dependent C++ files are compiled
first which is why we have a wrapper in that package. But note that I never
claimed it currently worked -- that test setup (being able to run from tests/
and once installed) is more tricky for Rcpp due to the compilation.
I did claim that by not giving the testthat user that option you are not helping.
And I stand by that.
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org