-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests and documentation for 0.1.0 release
- Loading branch information
Showing
8 changed files
with
298 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
linters: linters_with_defaults( | ||
indentation_linter(hanging_indent_style="tidy")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: mixed-line-ending | ||
- id: detect-private-key | ||
- id: check-case-conflict | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
- repo: https://github.com/DavidAnson/markdownlint-cli2 | ||
rev: v0.11.0 | ||
hooks: | ||
- id: markdownlint-cli2 | ||
files: \.(md|qmd)$ | ||
types: [file] | ||
exclude: LICENSE.md | ||
- id: markdownlint-cli2-fix | ||
files: \.(md|qmd)$ | ||
types: [file] | ||
exclude: LICENSE.md | ||
- repo: https://github.com/lorenzwalthert/precommit | ||
rev: v0.3.2.9027 | ||
hooks: | ||
- id: style-files | ||
name: style-files | ||
description: style files with {styler} | ||
entry: Rscript inst/hooks/exported/style-files.R | ||
language: r | ||
files: '(\.[rR]profile|\.[rR]|\.[rR]md|\.[rR]nw|\.[qQ]md)$' | ||
exclude: | | ||
(?x)^( | ||
renv/activate\.R| | ||
)$ | ||
minimum_pre_commit_version: "2.13.0" | ||
- id: parsable-R | ||
name: parsable-R | ||
description: check if a .R file is parsable | ||
entry: Rscript inst/hooks/exported/parsable-R.R | ||
language: r | ||
files: '\.[rR](md)?$' | ||
minimum_pre_commit_version: "2.13.0" | ||
- id: lintr | ||
args: [--warn_only] | ||
name: lintr | ||
description: check if a `.R` file is lint free (using {lintr}) | ||
entry: Rscript inst/hooks/exported/lintr.R | ||
language: r | ||
files: '(\.[rR]profile|\.R|\.Rmd|\.Rnw|\.r|\.rmd|\.rnw)$' | ||
exclude: 'renv/activate\.R' | ||
minimum_pre_commit_version: "2.13.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,36 @@ | ||
skip("Skip until resolve issue of testing package binary") | ||
pkg_path <- getwd() | ||
tmp <- tempdir(check = TRUE) | ||
withr::local_dir(tmp) | ||
withr::local_temp_libpaths() | ||
withr::local_path(file.path(.libPaths()[1], "genecovr", "bin")) | ||
devtools::install(pkg=pkg_path, quick = TRUE, upgrade = "never") | ||
devtools::install(pkg = pkg_path, quick = TRUE, upgrade = "never") | ||
|
||
create_file <- function(fn) system.file("extdata", fn, package = "genecovr") | ||
|
||
data <- as.data.frame(rbind( | ||
c("nonpol", create_file("transcripts2nonpolished.psl"), | ||
create_file("nonpolished.fai"), create_file("transcripts.fai")), | ||
c("pol", create_file("transcripts2polished.psl"), | ||
create_file("polished.fai"), create_file("transcripts.fai")) | ||
c( | ||
"nonpol", create_file("transcripts2nonpolished.psl"), | ||
create_file("nonpolished.fai"), create_file("transcripts.fai") | ||
), | ||
c( | ||
"pol", create_file("transcripts2polished.psl"), | ||
create_file("polished.fai"), create_file("transcripts.fai") | ||
) | ||
)) | ||
colnames(data) <- NULL | ||
withr::local_file(write.csv(data, file = "assemblies.csv", row.names = FALSE)) | ||
|
||
test_that("genecovr runs as expected", { | ||
system(paste(paste0("R_LIBS_USER=", .libPaths()[1]), | ||
"genecovr", "assemblies.csv")) | ||
expect_equal(length(list.files(pattern = "*.png")), 13) | ||
expect_equal(length(grep("Rplots", list.files(pattern = "*.pdf"), | ||
invert = TRUE)), 13) | ||
expect_equal(length(list.files(pattern = "*.csv.gz")), 4) | ||
system(paste( | ||
paste0("R_LIBS_USER=", .libPaths()[1]), | ||
"genecovr", "assemblies.csv" | ||
)) | ||
expect_equal(length(list.files(pattern = "*.png")), 15) | ||
expect_equal(length(grep("Rplots", list.files(pattern = "*.pdf"), | ||
invert = TRUE | ||
)), 15) | ||
expect_equal(length(list.files(pattern = "*.csv.gz")), 4) | ||
expect_equal(length(list.files(pattern = "*.tsv.gz")), 1) | ||
}) | ||
|
||
withr::defer(unlink(dir, recursive = TRUE)) | ||
withr::defer(unlink(tmp, recursive = TRUE)) |
Oops, something went wrong.