Closed maelle closed 5 years ago
I am about to add a test with mocking, for now I had removed my GITHUB_PAT
and obtained
> folder <- tempdir()
> starters::createPackageProject("coolcool",
+ folder = folder,
+ external_setup = list(
+ git_service = "GitHub",
+ login = "maelle",
+ private = FALSE,
+ protocol = "ssh",
+ ci_activation = "travis"
+ ))
β Setting active project to '/home/maelle/Documents/locke_data/starters'
β Setting active project to '/tmp/Rtmpaso4Pa/coolcool'
β Creating 'R/'
β Creating 'man/'
β Writing 'DESCRIPTION'
Package: coolcool
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R (parsed):
* MaΓ«lle Salmon [cre, aut] (0000-0002-2815-0399)
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
β Writing 'NAMESPACE'
β Writing 'coolcool.Rproj'
β Adding '.Rproj.user' to '.gitignore'
β Adding '^coolcool\\.Rproj$', '^\\.Rproj\\.user$' to '.Rbuildignore'
β Setting active project to '<no active project>'
β Setting active project to '/tmp/Rtmpaso4Pa/coolcool'
β Writing 'CODE_OF_CONDUCT.md'
β Adding '^CODE_OF_CONDUCT\\.md$' to '.Rbuildignore'
β Don't forget to describe the code of conduct in your README:
Please note that the 'coolcool' project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.
[Copied to clipboard]
β Writing 'LICENSE.md'
β Adding '^LICENSE\\.md$' to '.Rbuildignore'
β Writing 'LICENSE'
β Writing 'R/coolcool-package.R'
β Writing 'README.Rmd'
β Adding Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. badge to 'README.Rmd'
β Re-knit 'README.Rmd'
β Adding 'testthat' to Suggests field in DESCRIPTION
β Creating 'tests/testthat/'
β Writing 'tests/testthat.R'
β Adding 'knitr' to Suggests field in DESCRIPTION
β Setting VignetteBuilder field in DESCRIPTION to 'knitr'
β Adding 'inst/doc' to '.gitignore'
β Creating 'vignettes/'
β Adding '*.html', '*.R' to 'vignettes/.gitignore'
β Adding 'rmarkdown' to Suggests field in DESCRIPTION
β Writing 'vignettes/coolcool.Rmd'
β Modify 'vignettes/coolcool.Rmd'
β Initialising Git repo
β Adding '.Rhistory', '.RData' to '.gitignore'
There are 12 files uncommited files:
* '.gitignore'
* '.Rbuildignore'
* 'CODE_OF_CONDUCT.md'
* 'coolcool.Rproj'
* 'DESCRIPTION'
* 'LICENSE'
* 'LICENSE.md'
* 'NAMESPACE'
* 'R/'
* 'README.Rmd'
* 'tests/'
* 'vignettes/'
Is it ok to commit them?
1: Absolutely not
2: Definitely
3: Nope
Selection: 2
β Adding files
β Commit with message 'First commit of this sublime project, gee!'
β Writing 'NEWS.md'
Trying to create GitHub repo, try 1
Trying to create GitHub repo, try 2
Trying to create GitHub repo, try 3
Trying to create GitHub repo, try 4
Trying to create GitHub repo, try 5
Error: GitHub repo creation failed.
Oops! An error was found and the `coolcool` directory was deleted
β Setting active project to '/home/maelle/Documents/locke_data/starters'
which looks fine.
Merging #115 into master will decrease coverage by
1.18%
. The diff coverage is0%
.
@@ Coverage Diff @@
## master #115 +/- ##
==========================================
- Coverage 61.6% 60.42% -1.19%
==========================================
Files 12 12
Lines 560 571 +11
==========================================
Hits 345 345
- Misses 215 226 +11
Impacted Files | Coverage Ξ | |
---|---|---|
R/github.R | 29.09% <0%> (-7.28%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Ξ = absolute <relative> (impact)
,ΓΈ = not affected
,? = missing data
Powered by Codecov. Last update f328160...a8f91f5. Read the comment docs.
Merging #115 into master will decrease coverage by
1.5%
. The diff coverage is0%
.
@@ Coverage Diff @@
## master #115 +/- ##
=========================================
- Coverage 61.6% 60.1% -1.51%
=========================================
Files 12 12
Lines 560 574 +14
=========================================
Hits 345 345
- Misses 215 229 +14
Impacted Files | Coverage Ξ | |
---|---|---|
R/github.R | 34.04% <0%> (-2.33%) |
:arrow_down: |
R/utils.R | 47.05% <0%> (-9.09%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Ξ = absolute <relative> (impact)
,ΓΈ = not affected
,? = missing data
Powered by Codecov. Last update f022353...926afd3. Read the comment docs.
What do you mean? That two tests test it?
The same code from the function appears in the test file and there's no obvious expect_
with it
Ah not sure how to create a function for this. What would its argument be?
In the test, it's indeed not a test, it's code for deleting the GitHub repo that was created during testing.
I'll try to work on such a function, passing hmmm gh
arguments to it.
@stephlocke is it better with the new function? :-)
It's a definite improvement but I expect to see an expect_*()
- if the gh stuff fails then you have a stop, the test process errors, it doesn't report an error as it should do.
Essentially:
ok <- gh_retry(quoted_expression)
if (!ok){
stop("GitHub repo deletion failed.")
}
Should be like:
expect_true(gh_retry(quoted_expression))
@stephlocke ok to merge now?
cf #108 #109