Skip to content

exit_file / exit_if_not not working #126

Description

@LiNk-NY

Hi Mark, @markvanderloo

I hope you are well.

I am using tinytest for a Bioconductor package: AnVILAz and I am having difficulty using exit_file() and exit_if_not.
They don't seem to be working properly.
I have three methods of exiting the test file using both exit_file() and exit_if_not():

## method 1
AnVILAz:::.exit_if_not_anvilaz()
> dput(AnVILAz:::.exit_if_not_anvilaz)
function () 
{
    if (!.is_anvil_az()) 
        tinytest::exit_file("Not running on AnVIL Azure workspace")
}

## method 2
if (!AnVILAz:::.is_anvil_az())
    tinytest::exit_file("Not running on AnVIL Azure workspace")

## method 3
tinytest::exit_if_not(
    "Not running on AnVIL Azure workspace" = AnVILAz:::.is_anvil_az()
)

Despite these trips, the tests continue to run when running R CMD check and tinytest::test_package("AnVILAz") :

> tinytest::test_package("AnVILAz")
test_az_copy.R................    0 tests    sh: 1: az: not found
sh: 1: az: not found
Error in system2("az", c("account", "get-access-token"), stdout = TRUE) : 
  error in running command
In addition: Warning message:
In system2("az", c("login", "--identity", "--allow-no-subscriptions")) :
  error in running command

For context, the package is meant to run on an environment with the az command line utility installed.

> packageVersion("tinytest")
[1] '1.4.1'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions