ipeaGIT / geobr

Easy access to official spatial data sets of Brazil in R and Python
https://ipeagit.github.io/geobr/
800 stars 119 forks source link

Update status of package test coverage #59

Closed rafapereirabr closed 5 years ago

rafapereirabr commented 5 years ago

Hi @pedro-andrade-inpe , I've followed your suggestion and started adding some tests files to check the consistency of geobr. As of right now, the geobr is hitting 73.07%. However, the codecov shield included in the README.md file still shows 49%. Do you know how we can update the info the shield?

library(covr)
library(geobr)
library(testthat)

# check package coverage
e <- package_coverage()#clean=T, function_exclusions="read_statistical_grid")

> geobr Coverage: 73.07%
> R/read_census_tract.R: 0.00%
> R/read_country.R: 0.00%
> R/read_region.R: 0.00%
> R/read_statistical_grid.R: 52.27%
> R/download_fun.R: 85.71%
> R/read_state.R: 89.58%
> R/read_weighting_area.R: 95.35%
> R/read_meso_region.R: 97.44%
> R/read_micro_region.R: 97.44%
> R/read_municipality.R: 97.83%
> R/download_metadata.R: 100.00%
> R/read_amazon.R: 100.00%
> R/read_biomes.R: 100.00%
> R/read_disaster_risk_area.R: 100.00%
> R/read_health_facilities.R: 100.00%
> R/read_indigenous_land.R: 100.00%
pedro-andrade-inpe commented 5 years ago

It seems that the results of the tests are not being uploaded. Try to call covr::codecov() with the argument token, to indicate where the results will be stored in the Codecov webpage. If you do not have the token, just login into Codecov and click in Settings, in the right top. I know that is also possible to have a codecov.yml in the root directory of the package to avoid passing the token, but I have never tried to do so.

rafapereirabr commented 5 years ago

Thanks, Pedro! It worked like a charm :)

# check package coverage
  geobr_cov <- package_coverage()#clean=T, function_exclusions="read_statistical_grid")

# update package coverage
  covr::codecov( coverage= geobr_cov, token ='xxx-xxxx-xxxx-xxxx-xxxx' )