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

code coverage is at 0%? #31

Closed
njtierney opened this issue Mar 15, 2024 · 4 comments
Closed

code coverage is at 0%? #31

njtierney opened this issue Mar 15, 2024 · 4 comments

Comments

@njtierney
Copy link
Owner

image

Given it was at 95% and I removed one file, I'm not sure what's going on here!

@brownag
Copy link
Contributor

brownag commented Mar 15, 2024

Very weird. The codecov action "passes". but is throwing errors (Error: Error in rep_len(1, nchar(x)) : invalid 'length.out' value) starting here

R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
> 
> library(testthat)
> library(geotargets)
Error: Error in rep_len(1, nchar(x)) : invalid 'length.out' value
> 
> test_check("geotargets")
Error: Error in rep_len(1, nchar(x)) : invalid 'length.out' value
Loading required namespace: terra
▶ dispatched target test_terra_rast
● completed target test_terra_rast [0.011 seconds]
▶ ended pipeline [0.098 seconds]
Error: Error in rep_len(1, nchar(x)) : invalid 'length.out' value
▶ dispatched target test_terra_vect
● completed target test_terra_vect [2.442 seconds]
▶ ended pipeline [2.5 seconds]
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 5 ]
> 

Reverting a709181 seems to get it working for me again locally, and more specifically putting any function back in R/utils.R seems to fix it--which is magical and mysterious indeed.

When I run covr::package_coverage() locally after a709181 I do not see these errors, but I see the 0% coverage for whole package and AAAA.R

This was referenced Mar 15, 2024
@Aariq
Copy link
Collaborator

Aariq commented Mar 15, 2024

Would it be helpful to maybe look at how targets, tarchetypes, etc. deals with this? There might be some hints in their github actions or in commit history. I'm assuming the coverage issues have something to do with callr R sessions in tests, but I don't actually know. Not sure if this is helpful, but I've noticed that the tests use the installed version of geotargets because of the namepacing with geotargets:: rather than using the current state of the code.

@njtierney
Copy link
Owner Author

I guess all we needed was a utils.R file after all? How strange, though! Thanks for digginng into this @brownag

Good ideas for searching for this, @Aariq !

@njtierney
Copy link
Owner Author

njtierney commented Mar 19, 2024

image

Woo! Thanks to @brownag for #43

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

3 participants