Skip to content

Commit

Permalink
Move all integration tests to CRAN paws
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkretch committed Feb 28, 2021
1 parent f97f93b commit 98fe074
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ unit: test-common test-codegen

integration:
@echo "run integration tests"
@for package in ${CRAN_DIR}/*/; do \
if [ "$$package" = "${CRAN_DIR}/paws/" ]; then continue; fi; \
echo "- $$(basename $$package)"; \
Rscript -e "options('testthat.summary.max_reports' = 1e6); devtools::test('$$package', reporter = 'summary')"; \
done;
@cd cran && Rscript -e "options(testthat.progress.max_fails = 1e6); devtools::test('paws',)"

common:
@echo "build and install common functions"
Expand Down
12 changes: 12 additions & 0 deletions make.paws/R/cran_collection.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ make_collection <- function(sdk_dir, out_dir, categories, only_cran = TRUE) {
categories <- categories[sapply(categories, get_category_package_name) %in% cran]
}
write_source_collection(sdk_dir, package_dir, categories)
write_tests_collection(sdk_dir, package_dir, categories)
write_documentation(package_dir)
write_imports_collection(package_dir, version, get_category_packages(categories))
}
Expand All @@ -52,6 +53,17 @@ write_source_collection <- function(sdk_dir, out_dir, categories) {
write_list(clients, file.path(out_dir, "R", "paws.R"))
}

write_tests_collection <- function(sdk_dir, out_dir, categories) {
test_dir <- "tests/testthat"
files <- list.files(file.path(sdk_dir, test_dir))
for (category in categories) {
for (service in category$service) {
file <- grep(sprintf("^test_%s.R$", service), files, value = TRUE)
file.copy(file.path(sdk_dir, test_dir, file), file.path(out_dir, test_dir, file))
}
}
}

# Add the category packages to the DESCRIPTION file's Imports.
# This is done separately since `write_documentation` will fail if
# the imports are not already installed, which should not be a requirement to
Expand Down

0 comments on commit 98fe074

Please sign in to comment.