diff --git a/DESCRIPTION b/DESCRIPTION index 736c30a..7a16d19 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: looker3 Type: Package Title: looker3 (http://github.com/abelcastilloavant/avant-looker3) Description: Pull data from Looker using the fancy new 3.0 API. -Version: 0.1.5 +Version: 0.1.6 Author: Abel Castillo Maintainer: Abel Castillo Authors@R: c(person("Abel", "Castillo", diff --git a/JenkinsCi.groovy b/JenkinsCi.groovy deleted file mode 100644 index 76aa8b8..0000000 --- a/JenkinsCi.groovy +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Job configuration specific to the https://github.com/avantcredit/looker3 - * CI Tool: Jenkins, Job DSL plugin - * Contacts: Oleksandr K. - */ -class JenkinsCi { - /* - * Actual build step that's gonna run in the job config. - * In case of R we just use a shell script. - */ - static String build_step = '''\ -#====================================== -# Running container and main build step -#====================================== - -CONTAINER_NAME=$BUILD_TAG -DOCKER_IMAGE="de-docker.art.local/aa-r-avantformula:latest" - -R='/usr/bin/R -e ' -R=$R'"download <- function(path, url, ...){' -R=$R'request <- httr::GET(url, ...);' -R=$R'httr::stop_for_status(request);' -R=$R'writeBin(httr::content(request, \\"raw\\"), path);' -R=$R'path};' -R=$R'lockbox_tar <- tempfile(fileext = \\".tar.gz\\");' -R=$R'lockbox_url <- \\"https://github.com/robertzk/lockbox/archive/0.2.4.tar.gz\\";' -R=$R'download(lockbox_tar, lockbox_url);' -R=$R'install.packages(lockbox_tar, repos = NULL, type = \\"source\\");' -R=$R'message(crayon::yellow(\\"Loading safe stable changes...\\"));' -R=$R'lockbox::lockbox(\\"lockfile.stable.yml\\");' -R=$R'library(bettertrace);' -R=$R'r <- as.data.frame(devtools::test(\\".\\")); quit(save = \\"no\\", status = if (sum(r\\$failed) > 0) { 1 } else { 0 }, runLast = FALSE);' -R=$R'library(covr);codecov()"' - -docker pull $DOCKER_IMAGE - -!(!(docker run -i --rm --name $CONTAINER_NAME -v $WORKSPACE:$DOCKER_WORKSPACE -w $DOCKER_WORKSPACE $DOCKER_IMAGE bash -c "$R")) - -echo DOCKER_RUN_EXIT_STATUS=$? > env.properties - -echo "Exit status:" $DOCKER_RUN_EXIT_STATUS -''' - /* - * Whether to report build status to the GitHub. - */ - static Boolean report_status = true - - /* - * We checkout code form GitHub using ssh. For this a deployment key - * should be installed on the repo settings and a user with credentials - * has to be created in Jenkins. This is Jenkin's internal id for that user. - */ - static String gh_key_id = '40629a7d-fc60-4d47-9618-5236dc56f477' -} diff --git a/NEWS.md b/NEWS.md index 2f00d01..423bacf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# Version 0.1.6 +- removed `logout_api_call`, using `cacher` to cache tokens instead. + # Version 0.1.5 - `validate_response` now only warns on unsuccessful logout validations. diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..d75d75a --- /dev/null +++ b/circle.yml @@ -0,0 +1,9 @@ +machine: + services: + - docker + + +test: + override: + - docker run -v /home/ubuntu/looker3:/looker3 -w /looker3 -e GITHUB_PAT=$CIRCLE_GITHUB_PAT -e CODECOV_TOKEN=$CIRCLE_CODECOV_TOKEN kirillseva/avant-r-new bash -c "R -e 'packages <- c(\"roxygen2\"); install.packages(packages);'; Rscript circle_installations.R; R CMD build --no-build-vignettes .; R CMD INSTALL $(ls -1t *.tar.gz | head -n 1); Rscript circle_tests.R" + diff --git a/circle_installations.R b/circle_installations.R new file mode 100644 index 0000000..8d542c7 --- /dev/null +++ b/circle_installations.R @@ -0,0 +1,6 @@ +devtools::install_github("hadley/devtools"); +devtools::install_github("hadley/testthat@v0.10.0"); +devtools::install_github("klutometis/roxygen@v5.0.0"); +devtools::install_github("peterhurford/checkr@0.1.2"); +devtools::install_github("jimhester/covr") + diff --git a/circle_tests.R b/circle_tests.R new file mode 100644 index 0000000..7b0ec6c --- /dev/null +++ b/circle_tests.R @@ -0,0 +1,24 @@ +library(bettertrace) +library(checkr) + + +# Mounted under root dir in the docker container. +devtools::install("/looker3") + +tryCatch({ + a <- as.data.frame(devtools::test()) + st <- any(a$error | a$failed) +}, error = function(e) { + dput(e) + q(save="no", status = 1) +}) + +tryCatch({ + library(covr) + codecov() +}, error = function (e) { + dput(e) + q(save = "no") +}) + +q(save="no", status = st)