Skip to content

Commit 88a72ee

Browse files
committed
Minor misc cleanups in tests and README
1 parent c8b569f commit 88a72ee

File tree

8 files changed

+7
-12
lines changed

8 files changed

+7
-12
lines changed

R/codecov.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ codecov <- function(...,
178178
codecov_query <- list(service = "github-actions",
179179
branch = branch,
180180
build = github_run_id,
181-
build_url = utils::URLencode(sprintf("http://github.com/%s/actions/runs/%s", slug, github_run_id)),
181+
build_url = utils::URLencode(sprintf("https://github.com/%s/actions/runs/%s", slug, github_run_id)),
182182
pr = pr,
183183
slug = slug,
184184
commit = commit %||% Sys.getenv("GITHUB_SHA"))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- badges: start -->
44
[![R-CMD-check](https://github.com/r-lib/covr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/covr/actions/workflows/R-CMD-check.yaml)
55
[![Codecov test coverage](https://codecov.io/gh/r-lib/covr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/r-lib/covr?branch=master)
6-
[![CRAN version](http://www.r-pkg.org/badges/version/covr)](https://cran.r-project.org/package=covr)
6+
[![CRAN version](https://www.r-pkg.org/badges/version/covr)](https://cran.r-project.org/package=covr)
77
<!-- badges: end -->
88

99
Track test coverage for your R package and view reports locally or (optionally)

tests/testthat/test-S7.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_that("S7 coverage is reported", {
2-
local_edition(3)
2+
skip_if_not_installed("S7")
33
cov <- as.data.frame(package_coverage(test_path("TestS7")))
44

55
expect_equal(cov$value, c(1, 1, 1, 2, 5, 0, 5, 0, 5, 1, 1, 2, 1, 1, 0))

tests/testthat/test-parallel.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test_that("mcparallel with the fix", {
1313
skip_on_os("windows")
1414

1515
# using auto detection
16-
cov <- package_coverage("TestParallel", type = "test")
16+
cov <- package_coverage(test_path("TestParallel"), type = "test")
1717
# only the non parallel code is covered
1818
expect_equal(percent_coverage(cov), 100)
1919
})

tests/testthat/test-print.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test_that("format_percentage works as expected", {
1313
})
1414

1515
test_that("print.coverage prints by = \"line\" by default", {
16-
cov <- package_coverage("TestPrint")
16+
cov <- package_coverage(test_path("TestPrint"))
1717

1818
expect_message(print(cov, by = "expression"),
1919
rex::rex("R/TestPrint.R: ", anything, "66.67%"))
@@ -30,9 +30,6 @@ test_that("print.coverage prints by = \"line\" by default", {
3030

3131
expect_message(print(cov),
3232
rex::rex("R/TestPrint.R: ", anything, "0.00%"))
33-
})
34-
test_that("print.coverage prints by = \"line\" by default", {
35-
cov <- package_coverage("TestPrint")
3633

3734
expect_message(print(cov, group = "functions"),
3835
rex::rex("test_me", anything, "0.00%"))

tests/testthat/test-report.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ skip_on_ci <- function() {
1212

1313
#tmp <- tempfile()
1414
#set.seed(42)
15-
#cov <- package_coverage("TestS4")
15+
#cov <- package_coverage(test_path("TestS4"))
1616
## Shiny uses its own seed which is not affected by set.seed, so we need to
1717
## set that as well to have reproducibility
1818
#g <- shiny:::.globals

tests/testthat/test-summary.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_that("Summary gives 50% coverage and two lines with zero coverage", {
2-
cv <- package_coverage("TestSummary")
2+
cv <- package_coverage(test_path("TestSummary"))
33
expect_equal(percent_coverage(cv), 50)
44
expect_equal(nrow(zero_coverage(cv)), 2)
55
})

tests/testthat/test-utils.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ test_that("per_line removes blank lines and lines with only punctuation (#387)",
4848
expect_equal(line_cov[[1]]$coverage, c(NA, 0, 0, 2, NA, 1, NA, 1, NA, NA, NA, NA, NA, NA, NA, NA, NA))
4949
})
5050

51-
context("split_on_line_directives")
52-
5351
test_that("split_on_line_directives returns NULL for input without directive (#588)", {
5452
expect_identical(
5553
split_on_line_directives(NULL),

0 commit comments

Comments
 (0)