From 3841077ff146782f285d20e6ac7ef1bf58fc7ae3 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Thu, 29 Oct 2020 18:37:27 +0000 Subject: [PATCH 01/19] Start on github actions --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 96 ++++++++++++++++++++++++++++ .github/workflows/pkgdown.yaml | 48 ++++++++++++++ .github/workflows/test-coverage.yaml | 48 ++++++++++++++ .travis.yml | 37 ----------- README.md | 4 +- 7 files changed, 197 insertions(+), 38 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .github/workflows/pkgdown.yaml create mode 100644 .github/workflows/test-coverage.yaml delete mode 100644 .travis.yml diff --git a/.Rbuildignore b/.Rbuildignore index 635261e..93d8fbd 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -19,3 +19,4 @@ ^\.valgrind_ignore$ ^autobrew$ ^src/redux\.so\.dSYM$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..b57723f --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,96 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: windows-latest, r: 'release'} + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + RSPM: ${{ matrix.config.rspm }} + REDUX_TEST_USE_REDIS: true + REDUX_TEST_USE_REDIS_ISOLATED: true + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Start Redis + if: runner.os != 'Windows' + uses: shogo82148/actions-setup-redis@v1 + with: + redis-version: "4.x" + + - name: Start Redis (windows) + if: runner.os == 'Windows' + run: | + choco install memurai-developer + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + if: runner.os != 'Windows' + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install system dependencies + if: runner.os == 'Linux' + run: | + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") + shell: Rscript {0} + + - name: Check + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + shell: Rscript {0} + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@main + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..3c908d3 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,48 @@ +on: + push: + branches: + - main + - master + +name: pkgdown + +jobs: + pkgdown: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + install.packages("pkgdown", type = "binary") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..5910c1a --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,48 @@ +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +name: test-coverage + +jobs: + test-coverage: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("covr") + shell: Rscript {0} + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4b61d93..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: R -sudo: false -cache: packages - -matrix: - include: - - os: linux - env: R_CODECOV=true REDUX_TEST_USE_REDIS=true REDUX_TEST_USE_REDIS_ISOLATED=true - - os: osx - osx_image: xcode8.3 - brew_packages: hiredis - latex: false - - os: osx - osx_image: xcode7.3 - disable_homebrew: true - latex: false - -addons: - apt: - packages: - - libapparmor-dev - - libhiredis-dev - - redis-server - -services: - - redis-server - -notifications: - email: - on_success: change - on_failure: change - -r_packages: - - covr - -after_success: - - Rscript -e 'covr::codecov()' diff --git a/README.md b/README.md index 7f31365..4d3fee0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # redux + [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) -[![Build Status](https://travis-ci.org/richfitz/redux.svg?branch=master)](https://travis-ci.org/richfitz/redux) +[![R build status](https://github.com/richfitz/redux/workflows/R-CMD-check/badge.svg)](https://github.com/richfitz/redux/actions) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/richfitz/redux?branch=master&svg=true)](https://ci.appveyor.com/project/richfitz/redux) [![codecov.io](https://codecov.io/github/richfitz/redux/coverage.svg?branch=master)](https://codecov.io/github/richfitz/redux?branch=master) + `redux` provides an interface to Redis. Two interfaces are provided; a low level interface (allowing execution of arbitrary Redis commands with almost no interface) and a high-level interface with an API that matches all of the several hundred Redis commands. From fc2949559280943fdda6ce0f5ae773883e33ab65 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Thu, 29 Oct 2020 18:44:12 +0000 Subject: [PATCH 02/19] Install hiredis via brew --- .github/workflows/R-CMD-check.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index b57723f..e73b1ed 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -76,6 +76,11 @@ jobs: eval sudo $cmd done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + - name: "[macOS] system dependencies" + if: runner.os == 'macOS' + run: | + brew install hiredis + - name: Install dependencies run: | remotes::install_deps(dependencies = TRUE) From a12ebe31cd91e2ca2b7b1f0f2c1387c497c90d3d Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Thu, 22 Oct 2020 13:34:28 +0200 Subject: [PATCH 03/19] Try to fix AppVeyor --- appveyor.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 554b93e..7f837dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,9 +12,7 @@ install: # Adapt as necessary starting from here before_build: - - choco install redis-64 - - redis-server --service-install - - redis-server --service-start + - choco install memurai-developer build_script: - travis-tool.sh install_deps From 24a83e8f145fb21e57d88d7b80c7f185fc413fd7 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Thu, 29 Oct 2020 19:03:19 +0000 Subject: [PATCH 04/19] Add more dependencies for macs --- .github/workflows/pkgdown.yaml | 10 ++++++++++ .github/workflows/test-coverage.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 3c908d3..c2a7a73 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -18,6 +18,16 @@ jobs: - uses: r-lib/actions/setup-pandoc@v1 + - name: Start Redis + uses: shogo82148/actions-setup-redis@v1 + with: + redis-version: "4.x" + + - name: "[macOS] system dependencies" + if: runner.os == 'macOS' + run: | + brew install hiredis + - name: Query dependencies run: | install.packages('remotes') diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 5910c1a..de1bb23 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -22,6 +22,16 @@ jobs: - uses: r-lib/actions/setup-pandoc@v1 + - name: Start Redis + uses: shogo82148/actions-setup-redis@v1 + with: + redis-version: "4.x" + + - name: "[macOS] system dependencies" + if: runner.os == 'macOS' + run: | + brew install hiredis + - name: Query dependencies run: | install.packages('remotes') From bd1face5902fb7d897c8848bbbca41d32e950c65 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Thu, 29 Oct 2020 19:10:22 +0000 Subject: [PATCH 05/19] Add helper scripts --- .Rbuildignore | 1 + scripts/redis | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100755 scripts/redis diff --git a/.Rbuildignore b/.Rbuildignore index 93d8fbd..1ba804c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -20,3 +20,4 @@ ^autobrew$ ^src/redux\.so\.dSYM$ ^\.github$ +^scripts$ diff --git a/scripts/redis b/scripts/redis new file mode 100755 index 0000000..6c5b25e --- /dev/null +++ b/scripts/redis @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -e +CONTAINER_NAME=rrq_redis +if [ "$1" = "start" ]; then + docker run --rm -d --name=$CONTAINER_NAME -p 127.0.0.1:6379:6379 redis +elif [ "$1" = "stop" ]; then + docker stop $CONTAINER_NAME +elif [ "$1" = "restart" ]; then + docker stop $CONTAINER_NAME || true + docker run --rm -d --name=$CONTAINER_NAME -p 127.0.0.1:6379:6379 redis +else + echo "Usage: redis " + exit 1 +fi From 08131086936d98435b86893c45cb2eebd92e9c8a Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Thu, 29 Oct 2020 19:10:33 +0000 Subject: [PATCH 06/19] Force tests on --- .github/workflows/pkgdown.yaml | 2 ++ .github/workflows/test-coverage.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index c2a7a73..f0d60dd 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -11,6 +11,8 @@ jobs: runs-on: macOS-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + REDUX_TEST_USE_REDIS: true + REDUX_TEST_USE_REDIS_ISOLATED: true steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index de1bb23..2022a2a 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -15,6 +15,8 @@ jobs: runs-on: macOS-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + REDUX_TEST_USE_REDIS: true + REDUX_TEST_USE_REDIS_ISOLATED: true steps: - uses: actions/checkout@v2 From a4a55bbd0e9bce9d32a7f9c7e759c8b99a0c3f80 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Thu, 29 Oct 2020 19:10:46 +0000 Subject: [PATCH 07/19] Patch tests to work with updated redis --- tests/testthat/test-connection-redux.R | 3 +-- tests/testthat/test-conversions.R | 2 +- tests/testthat/test-zzz-commands-generic.R | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-connection-redux.R b/tests/testthat/test-connection-redux.R index 36a793a..6dc90c9 100644 --- a/tests/testthat/test-connection-redux.R +++ b/tests/testthat/test-connection-redux.R @@ -10,8 +10,7 @@ test_that("impossible connection", { test_that("auth", { skip_if_no_redis() - expect_error(redis_connection(redis_config(password = "foo")), - "no password is set") + expect_error(redis_connection(redis_config(password = "foo"))) }) test_that("select db", { diff --git a/tests/testthat/test-conversions.R b/tests/testthat/test-conversions.R index a367bd4..3354dc1 100644 --- a/tests/testthat/test-conversions.R +++ b/tests/testthat/test-conversions.R @@ -76,7 +76,7 @@ test_that("long integers", { on.exit(con$DEL(key)) con$SET(key, "Hello") - expect_equal(con$PEXPIREAT(key, 1555555555005), 1) + expect_equal(con$PEXPIREAT(key, 1655555555005), 1) t0 <- con$TTL(key) t1 <- con$PTTL(key) diff --git a/tests/testthat/test-zzz-commands-generic.R b/tests/testthat/test-zzz-commands-generic.R index 4321378..810b302 100644 --- a/tests/testthat/test-zzz-commands-generic.R +++ b/tests/testthat/test-zzz-commands-generic.R @@ -138,7 +138,7 @@ test_that("PEXPIREAT", { on.exit(con$DEL(key)) con$SET(key, "Hello") - expect_equal(con$PEXPIREAT(key, 1555555555005), 1) + expect_equal(con$PEXPIREAT(key, 1655555555005), 1) expect_gt(con$TTL(key), 0) expect_gt(con$PTTL(key), 0) }) From ace033d03fa0a62e016ed34d10739cb8e25e3afb Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Thu, 29 Oct 2020 19:16:01 +0000 Subject: [PATCH 08/19] Disable test --- tests/testthat/test-redis-socket.R | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/test-redis-socket.R b/tests/testthat/test-redis-socket.R index adcbe12..b8a13c4 100644 --- a/tests/testthat/test-redis-socket.R +++ b/tests/testthat/test-redis-socket.R @@ -3,6 +3,7 @@ context("socket connection") test_that("socket connection", { skip_if_no_redis() skip_on_cran() + skip("Rethink this test") redis_server <- Sys.which("redis-server") if (redis_server == "") { skip("didn't find redis server") From 92ccce4a9d406af0e0cd26b4228aa474de817ab4 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 09:58:30 +0000 Subject: [PATCH 09/19] Skip pub/sub on windows --- tests/testthat/helper-publisher.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/helper-publisher.R b/tests/testthat/helper-publisher.R index 5587df9..72eb627 100644 --- a/tests/testthat/helper-publisher.R +++ b/tests/testthat/helper-publisher.R @@ -8,7 +8,7 @@ time_checker <- function(timeout) { } start_publisher <- function(channel, dt = 0.02) { - testthat::skip_on_appveyor() + testthat::skip_on_os("windows") testthat::skip_on_cran() testthat::skip_if_not_installed("sys") skip_if_no_redis() From a3f5e0d0f845b1231e8c680d0df365abbabe8570 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 10:07:57 +0000 Subject: [PATCH 10/19] Don't rely on floating point representation --- tests/testthat/test-zzz-commands-hash.R | 4 ++-- tests/testthat/test-zzz-commands-string.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-zzz-commands-hash.R b/tests/testthat/test-zzz-commands-hash.R index 987ed55..76abcbf 100644 --- a/tests/testthat/test-zzz-commands-hash.R +++ b/tests/testthat/test-zzz-commands-hash.R @@ -68,8 +68,8 @@ test_that("HINCRBYFLOAT", { on.exit(con$DEL(key)) con$HSET(key, "field", 10.50) - expect_equal(con$HINCRBYFLOAT(key, "field", 0.1), "10.6") - expect_equal(con$HINCRBYFLOAT(key, "field", -5), "5.6") + expect_equal(as.numeric(con$HINCRBYFLOAT(key, "field", 0.1)), 10.6) + expect_equal(as.numeric(con$HINCRBYFLOAT(key, "field", -5)), 5.6) con$HSET(key, "field", "5.0e3") expect_equal(con$HINCRBYFLOAT(key, "field", "2.0e2"), "5200") }) diff --git a/tests/testthat/test-zzz-commands-string.R b/tests/testthat/test-zzz-commands-string.R index a5f0c02..56de89a 100644 --- a/tests/testthat/test-zzz-commands-string.R +++ b/tests/testthat/test-zzz-commands-string.R @@ -187,8 +187,8 @@ test_that("INCRBYFLOAT", { on.exit(con$DEL(key)) con$SET(key, 10.50) - expect_equal(con$INCRBYFLOAT(key, 0.1), "10.6") - expect_equal(con$INCRBYFLOAT(key, -5), "5.6") + expect_equal(as.numeric(con$INCRBYFLOAT(key, 0.1)), 10.6) + expect_equal(as.numeric(con$INCRBYFLOAT(key, -5)), 5.6) con$SET(key, "5.0e3") expect_equal(con$INCRBYFLOAT(key, "2.0e2"), "5200") }) From 39ffe1979bdf311dfa7868f441ee057f3446c056 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 10:16:08 +0000 Subject: [PATCH 11/19] Re-enable test --- tests/testthat/test-redis-socket.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-redis-socket.R b/tests/testthat/test-redis-socket.R index b8a13c4..b0ef21b 100644 --- a/tests/testthat/test-redis-socket.R +++ b/tests/testthat/test-redis-socket.R @@ -3,7 +3,7 @@ context("socket connection") test_that("socket connection", { skip_if_no_redis() skip_on_cran() - skip("Rethink this test") + redis_server <- Sys.which("redis-server") if (redis_server == "") { skip("didn't find redis server") From 2a677a8fe93d8d62fe0abc4526567bdc5dd34c5e Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 10:54:42 +0000 Subject: [PATCH 12/19] Alternative socket server --- tests/testthat/test-redis-socket.R | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-redis-socket.R b/tests/testthat/test-redis-socket.R index b0ef21b..4a3722e 100644 --- a/tests/testthat/test-redis-socket.R +++ b/tests/testthat/test-redis-socket.R @@ -8,14 +8,19 @@ test_that("socket connection", { if (redis_server == "") { skip("didn't find redis server") } - logfile <- tempfile("redis_") - socket <- tempfile("socket_") + tmp <- tempfile() + dir.create(tmp, FALSE, TRUE) + tmp <- normalizePath(tmp) + + logfile <- file.path(tmp, "log") + socket <- file.path(tmp, "socket") + system2(redis_server, c("--port", 0, "--unixsocket", socket), wait = FALSE, stdout = logfile, stderr = logfile) Sys.sleep(.5) if (!file.exists(socket)) { - ## This does leave a redis server running on a socket! + ## This might leave a redis server running on a socket! skip("Didn't start socket server") } config <- redis_config() From 3c9ac16d47a2a73f8735883fdb355ca34b564984 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 11:01:53 +0000 Subject: [PATCH 13/19] Test pkgdown on this branch --- .github/workflows/pkgdown.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index f0d60dd..ab84890 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,6 +3,7 @@ on: branches: - main - master + - i37-gha name: pkgdown From 622fd7692cca1383a2d2f04377a03ca9d0b1f31e Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 11:06:32 +0000 Subject: [PATCH 14/19] Disable after confirmation --- .github/workflows/pkgdown.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index ab84890..f0d60dd 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,7 +3,6 @@ on: branches: - main - master - - i37-gha name: pkgdown From 68e96bae7d3e1bc5012577d19e075e97f0f382b5 Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Thu, 22 Oct 2020 13:17:21 +0200 Subject: [PATCH 15/19] Windows: update to hiredis 1.0.0 --- src/Makevars.win | 4 ++-- src/registration.c | 3 +++ tools/winlibs.R | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Makevars.win b/src/Makevars.win index 7de62f4..216b29c 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,6 +1,6 @@ # -*- makefile -*- -PKG_CPPFLAGS=-I../windows/hiredis-0.9.2/include/hiredis -DSTRICT_R_HEADERS -PKG_LIBS=-L../windows/hiredis-0.9.2/lib${R_ARCH} -lhiredis -lws2_32 +PKG_CPPFLAGS=-I../windows/hiredis-1.0.0/include/hiredis -DSTRICT_R_HEADERS +PKG_LIBS=-L../windows/hiredis-1.0.0/lib${R_ARCH} -lhiredis -lws2_32 all: clean winlibs diff --git a/src/registration.c b/src/registration.c index 651b1d3..01da3e0 100644 --- a/src/registration.c +++ b/src/registration.c @@ -1,3 +1,6 @@ +#ifdef _WIN32 +#include +#endif #include "connection.h" #include "conversions.h" #include "subscribe.h" diff --git a/tools/winlibs.R b/tools/winlibs.R index 5f9997c..3f1b5b9 100644 --- a/tools/winlibs.R +++ b/tools/winlibs.R @@ -1,6 +1,6 @@ -if (!file.exists("../windows/hiredis-0.9.2/include/hiredis/hiredis.h")) { +if (!file.exists("../windows/hiredis-1.0.0/include/hiredis/hiredis.h")) { if (getRversion() < "3.3.0") setInternet2() - download.file("https://github.com/rwinlib/hiredis/archive/v0.9.2.zip", "lib.zip", quiet = TRUE) + download.file("https://github.com/rwinlib/hiredis/archive/v1.0.0.zip", "lib.zip", quiet = TRUE) dir.create("../windows", showWarnings = FALSE) unzip("lib.zip", exdir = "../windows") unlink("lib.zip") From 16020342a25d0dfd632ca6a13ce68ddca2fdd0a8 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 11:13:16 +0000 Subject: [PATCH 16/19] Remove appveyor --- README.md | 1 - appveyor.yml | 44 -------------------------------------------- 2 files changed, 45 deletions(-) delete mode 100644 appveyor.yml diff --git a/README.md b/README.md index 4d3fee0..052a4b4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![R build status](https://github.com/richfitz/redux/workflows/R-CMD-check/badge.svg)](https://github.com/richfitz/redux/actions) -[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/richfitz/redux?branch=master&svg=true)](https://ci.appveyor.com/project/richfitz/redux) [![codecov.io](https://codecov.io/github/richfitz/redux/coverage.svg?branch=master)](https://codecov.io/github/richfitz/redux?branch=master) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7f837dd..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,44 +0,0 @@ -# DO NOT CHANGE the "init" and "install" sections below - -# Download script file from GitHub -init: - ps: | - $ErrorActionPreference = "Stop" - Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" - Import-Module '..\appveyor-tool.ps1' - -install: - ps: Bootstrap - -# Adapt as necessary starting from here -before_build: - - choco install memurai-developer - -build_script: - - travis-tool.sh install_deps - -test_script: - - travis-tool.sh run_tests - -on_failure: - - 7z a failure.zip *.Rcheck\* - - appveyor PushArtifact failure.zip - -artifacts: - - path: '*.Rcheck\**\*.log' - name: Logs - - - path: '*.Rcheck\**\*.out' - name: Logs - - - path: '*.Rcheck\**\*.fail' - name: Logs - - - path: '*.Rcheck\**\*.Rout' - name: Logs - - - path: '\*_*.tar.gz' - name: Bits - - - path: '\*_*.zip' - name: Bits From c27c5d0ff7c0f7031e86e3018f97abff70614261 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 11:26:30 +0000 Subject: [PATCH 17/19] Skip failing test on windows --- tests/testthat/test-connection-redux.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testthat/test-connection-redux.R b/tests/testthat/test-connection-redux.R index 6dc90c9..2dd58f7 100644 --- a/tests/testthat/test-connection-redux.R +++ b/tests/testthat/test-connection-redux.R @@ -4,6 +4,9 @@ test_that("impossible connection", { skip_if_no_redis() expect_error(redis_connection(redis_config(port = 99999)), "Failed to create context") + ## this does not trigger on windows with hiredis v1, for unknown + ## reasons + skip_on_os("windows") expect_error(redis_connect_unix(tempfile()), "Failed to create context") }) From 894be37976b9aff3cc9ef2102de497c2c670505a Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 11:58:21 +0000 Subject: [PATCH 18/19] Fix outdated travis/isolation issues --- .Rbuildignore | 3 --- .github/workflows/R-CMD-check.yaml | 2 +- .github/workflows/pkgdown.yaml | 2 +- .github/workflows/test-coverage.yaml | 2 +- README.md | 2 +- tests/testthat/helper-common.R | 6 +++--- tests/testthat/test-zzz-commands-server.R | 6 ------ 7 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 1ba804c..ff7e842 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,8 +2,6 @@ ^\.Rproj\.user$ ^Makefile$ ^README.Rmd$ -^.travis.yml$ -^appveyor.yml$ ^src/hiredis/.*\.[oa]$ ^ignore$ ^update_web\.sh$ @@ -11,7 +9,6 @@ ^redux_.*\.tar\.gz$ ^TODO\.md$ ^extra$ -^appveyor\.yml$ ^windows$ ^redux_.*\.tar\.gz$ ^vignettes/src$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index e73b1ed..4b99b4f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -31,7 +31,7 @@ jobs: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} REDUX_TEST_USE_REDIS: true - REDUX_TEST_USE_REDIS_ISOLATED: true + REDUX_TEST_ISOLATED: true steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index f0d60dd..17e0f67 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -12,7 +12,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} REDUX_TEST_USE_REDIS: true - REDUX_TEST_USE_REDIS_ISOLATED: true + REDUX_TEST_ISOLATED: true steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 2022a2a..0a9a983 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -16,7 +16,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} REDUX_TEST_USE_REDIS: true - REDUX_TEST_USE_REDIS_ISOLATED: true + REDUX_TEST_ISOLATED: true steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 052a4b4..d6b7066 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ To use the test suite, please set the environment variables - `NOT_CRAN=true` - `REDUX_TEST_USE_REDIS=true` -- `REDUX_TEST_USE_REDIS_ISOLATED=true` +- `REDUX_TEST_ISOLATED=true` The first two opt in to using redis _at all_, and the third activates commands that may be destructive or undesirable to use on a production server. diff --git a/tests/testthat/helper-common.R b/tests/testthat/helper-common.R index 3b232bf..06156ce 100644 --- a/tests/testthat/helper-common.R +++ b/tests/testthat/helper-common.R @@ -15,11 +15,11 @@ skip_if_no_redis <- function(...) { } skip_if_not_isolated_redis <- function() { - if (identical(Sys.getenv("ISOLATED_REDIS"), "true") || - identical(Sys.getenv("TRAVIS"), "true")) { + if (identical(Sys.getenv("REDUX_TEST_ISOLATED"), "true")) { return() } - testthat::skip("Redis is not isolated (set envvar ISOLATED_REDIS to 'true')") + testthat::skip( + "Redis is not isolated (set envvar REDUX_TEST_ISOLATED to 'true')") } skip_if_no_scan <- function(r) { diff --git a/tests/testthat/test-zzz-commands-server.R b/tests/testthat/test-zzz-commands-server.R index 39be420..9dd1dc9 100644 --- a/tests/testthat/test-zzz-commands-server.R +++ b/tests/testthat/test-zzz-commands-server.R @@ -1,11 +1,5 @@ context("commands - server") -## TODO: These are not working terribly well on travis at the moment. -## I need to add a few bits to disable a handful of commands and see -## if I can get the tests to pass. Then replace skipped tests with -## calls to the command generation code to make sure that the -## appropriate text is generated. - ## Tested on the server test_that("CLIENT KILL", { expect_equal(redis_cmds$CLIENT_KILL(ID = "12", SKIPME = "yes"), From 89371ae4a215c7d1ef1931776d80e45de976ef5d Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Fri, 30 Oct 2020 11:59:02 +0000 Subject: [PATCH 19/19] Remove outdated script --- extra/revdep.R | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100755 extra/revdep.R diff --git a/extra/revdep.R b/extra/revdep.R deleted file mode 100755 index 92c224c..0000000 --- a/extra/revdep.R +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env Rscript -path <- "revdep" -if (file.exists(path)) { - unlink(path, recursive=TRUE) -} -dir.create(path) - -devtools::install(".") - -packages <- c("ropensci/rrlite", - "richfitz/redux", - "richfitz/storr", - "richfitz/RedisHeartbeat", - "traitecoevo/rrqueue") - -## This is dropped for now because there's an issue that I only see on -## travis (can't replicate on OS/X or docker or see in typical usage). -packages <- setdiff(packages, "traitecoevo/rrqueue") - -if (Sys.getenv("USER") == "rich") { - prefix <- "~/Documents/src" - packages <- basename(packages) -} else { - prefix <- "https://github.com" - - deps <- c("traitecoevo/callr") - for (d in deps) { - devtools::install_github(d) - } -} - -for (p in packages) { - system2("git", c("clone", "--recursive", - file.path(prefix, p), file.path(path, p))) - devtools::install(file.path(path, p)) -} - -res <- list() -for (p in packages) { - res[[p]] <- devtools::test(file.path(path, p)) -} - -nb <- sum(vapply(res, function(x) sum(as.data.frame(x)$nb), integer(1))) -failed <- sum(vapply(res, function(x) sum(as.data.frame(x)$failed), integer(1))) -if (failed > 0) { - stop(sprintf("%d / %d tests failed", failed, nb)) -} else { - message(sprintf("All %d tests passed", nb)) -}