Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension breaks tests: Error in ext[[pkg]] : subscript out of bounds #101

Open
vincentarelbundock opened this issue May 18, 2022 · 0 comments

Comments

@vincentarelbundock
Copy link
Contributor

Thanks for your great work on tinytest!

I'm trying to write a tinytest extension package to do simple visual regression tests in my marginaleffects package. I ran into a problem, and I unfortunately can't figure out how to write a simple minimal working example (sorry!).

Extension package: https://github.com/vincentarelbundock/tinyviztest

Relevant test files where I call the new expectation:

The error I get:

Error in ext[[pkg]] : subscript out of bounds
Calls: <Anonymous> ... run_test_dir -> lapply -> FUN -> eval -> eval -> using
Execution halted

This error occurs on line 376 of the tinytest.R file.

When I insert a print(ext) and print(pkg) statements in that region and then run build_install_test(pattern = "plot") I get the messy printout below. ext is a list, but one of the names is NA. Perhaps this is causing the problem?

Are there any steps you can suggest that I take to diagnose the problem better?

Thanks!

test-plot_cap.R...............    0 tests    $tinyviztest
[1] "expect_vdiff"

[1] "tinyviztest"
test-plot_cap.R...............   17 tests OK 4.2s
test-plot_cme.R...............    0 tests    $tinyviztest
[1] "expect_vdiff"

$<NA>
 [1] "expect_tibble"           "expect_directory"
 [3] "expect_string"           "expect_character"
 [5] "expect_factor"           "expect_logical"
 [7] "expect_complex"          "expect_atomic"
 [9] "expect_named"            "expect_array"
[11] "expect_numeric"          "expect_class"
[13] "expect_formula"          "expect_path_for_output"
[15] "expect_number"           "expect_function"
[17] "expect_list"             "expect_names"
[19] "expect_posixct"          "expect_data_table"
[21] "expect_scalar_na"        "expect_subset"
[23] "expect_file"             "expect_count"
[25] "expect_int"              "expect_environment"
[27] "expect_data_frame"       "expect_os"
[29] "expect_file_exists"      "expect_disjunct"
[31] "expect_choice"           "expect_r6"
[33] "expect_integer"          "expect_matrix"
[35] "expect_date"             "expect_access"
[37] "expect_raw"              "expect_atomic_vector"
[39] "expect_directory_exists" "expect_integerish"
[41] "expect_scalar"           "expect_null"
[43] "expect_set_equal"        "expect_double"
[45] "expect_flag"             "expect_multi_class"

[1] "tinyviztest" NA
Error in ext[[pkg]] : subscript out of bounds
Calls: run_test_dir -> lapply -> FUN -> eval -> eval -> using
Execution halted
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
  cannot open compressed file '/tmp/RtmpHe8KrE/file79ae21976889/output.RDS', probable reason
'No such file or directory'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant