Skip to content

Commit

Permalink
[188559300]: fixes for vignette building during checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gergness committed Nov 21, 2024
1 parent 72c7ef7 commit 4acff60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 6 additions & 2 deletions vignettes/crunch.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ library(crunch)
```{r, results='hide', include = FALSE}
set_crunch_opts("crunch.api" = "https://team.crunch.io/api/")
library(httptest)
run_cleanup <- !dir.exists("crunch")
httpcache::clearCache()
start_vignette("crunch")
```

Expand Down Expand Up @@ -273,8 +275,10 @@ This vignette has gone through some of the basics of working with crunch in R in

```{r, include=FALSE}
end_vignette()
with_consent(delete(ds))
with_consent(delete(my_project))
if (run_cleanup) {
with_consent(delete(ds))
with_consent(delete(my_project))
}
```

* [Variables](variables.html): cleaning and defining variable metadata
Expand Down
1 change: 1 addition & 0 deletions vignettes/fork-and-merge.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set_crunch_opts("crunch.api" = "https://team.crunch.io/api/")
library(httptest)
run_cleanup <- !dir.exists("fork-and-merge")
ds_to_delete <- c()
httpcache::clearCache()
start_vignette("fork-and-merge")
Expand Down
8 changes: 5 additions & 3 deletions vignettes/subtotals.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ set_crunch_opts("crunch.api" = "https://team.crunch.io/api/")
options(width=120)
library(httptest)
if (!dir.exists("subtotals")) {
remake_fixtures <- !dir.exists("subtotals")
if (remake_fixtures) {
if ("rcrunch subtotal vignette" %in% names(datasets(cd(projects(), "examples/rcrunch vignette data")))) {
ds <- loadDataset("example vignette ds - subtotal", project = "examples/rcrunch vignette data")
with_consent(delete(ds))
Expand All @@ -34,8 +35,9 @@ if (!dir.exists("subtotals")) {
httpcache::clearCache()
}
run_cleanup <- !dir.exists("subtotals")
httpcache::clearCache()
start_vignette("subtotals")
ds <- loadDataset("example vignette ds - subtotal", project = "examples/rcrunch vignette data")
```

Expand Down Expand Up @@ -192,7 +194,7 @@ cube

```{r, include=FALSE}
end_vignette()
if (run_cleanup) {
if (remake_fixtures) {
with_consent({
delete(ds)
delete(my_project)
Expand Down

0 comments on commit 4acff60

Please sign in to comment.