Skip to content

testthat + parallel + Valgrind best practices?Β #1995

@krivit

Description

@krivit

CRAN wants maintainers to run Valgrind on their packages, but when parallel testing is enabled, R CMD check --use-valgrind runs testthat.R and the examples under Valgrind, but not the actual tests.

What are the best practices for checking a package using testthat under Valgrind?

As far as I can tell, the least intrusive way to do so is to set the TESTTHAT_PARALLEL=FALSE environment variable, so all the tests are run in the same process and Valgrind output is produced, though I think the test that generated the output is not identified. (This variable is not documented anywhere, but perhaps it ought to be?)

However this foregoes the benefits of parallelisation, which would be particularly helpful given the speed hit of Valgrind. Is there a better way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions