Skip to content

Commit

Permalink
Merge pull request #144 from animint/combine-renderer-tests
Browse files Browse the repository at this point in the history
rm selenium, combine renderer1,2,3
  • Loading branch information
tdhock authored Aug 28, 2024
2 parents 419cfac + d1e7623 commit 84eff9b
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 52 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-suite: [ renderer1,renderer2,renderer3,compiler,CRAN]
test-suite: [ renderer, compiler, CRAN ]

name: Test Suite ${{ matrix.test-suite }}
env:
Expand All @@ -21,8 +21,6 @@ jobs:
GH_ACTION: "ENABLED"
steps:
- uses: actions/checkout@v3
- name: Start Selenium Docker
run: docker run -d --network="host" selenium/standalone-firefox-debug:2.53.0
- name: install and update texlive
run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq
- run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install texlive texlive-fonts-extra -y
Expand Down
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: animint2
Title: Animated Interactive Grammar of Graphics
Version: 2024.6.6
Version: 2024.8.27
URL: https://animint.github.io/animint2/
BugReports: https://github.com/animint/animint2/issues
Authors@R: c(
Expand Down Expand Up @@ -87,7 +87,7 @@ Suggests:
htmltools,
rmarkdown,
testthat,
RSelenium, XML,
XML,
devtools,
httr,
maps,
Expand All @@ -102,7 +102,6 @@ Suggests:
svglite,
ggplot2,
chromote
Remotes: ropensci/[email protected]
License: GPL-3
Encoding: UTF-8
LazyData: true
Expand Down Expand Up @@ -281,6 +280,6 @@ Collate:
'z_scales.R'
'z_theme_animint.R'
'z_transformShape.R'
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Config/Needs/website: tidyverse/tidytemplate
VignetteBuilder: knitr
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,13 @@ import(plyr)
import(scales)
importFrom(grDevices,col2rgb)
importFrom(grDevices,rgb)
importFrom(grid,arrow)
importFrom(grid,unit)
importFrom(knitr,knit_print)
importFrom(methods,is)
importFrom(plyr,as.quoted)
importFrom(plyr,defaults)
importFrom(scales,alpha)
importFrom(stats,na.omit)
importFrom(stats,setNames)
importFrom(utils,browseURL)
Expand Down
10 changes: 7 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Changes in version 2024.8.27 (PR#144)

- Remove selenium, combine renderer tests into single CI job.

# Changes in version 2024.6.6 (PR#126)

- Add chromote as headless browser for testing and remove phantomjs/firefox support
- Add chromote as headless browser for testing and remove phantomjs/firefox support

# Changes in version 2024.3.12 (PR#119)

- Add validation checks for duplicate args passed geom and aes
- Add validation checks for duplicate args passed geom and aes

# Changes in version 2024.2.4 (PR#116)

- Add validation checks for duplicate and missing args passed to animint.
- Add validation checks for duplicate and missing args passed to animint.

# Changes in version 2024.1.24 (PR#112)

Expand Down
2 changes: 0 additions & 2 deletions R/z_facets.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Determine titles to put on facet panels.
# The implementation here is a modified version of facet_strips.
getStrips <- function(facet, panel, ...)
Expand Down Expand Up @@ -36,7 +35,6 @@ build_strip <- function(panel, label_df, labeller, side = "right", ...) {
labels <- matrix(list(), nrow = nrow(label_df), ncol = ncol(label_df))
labels <- lapply(labeller(label_df), cbind)
labels <- do.call("cbind", labels)

# unlike ggplot2, we collapse "layers" of strips into 1 layer
apply(labels, 1, paste, collapse = "; ")
}
Expand Down
2 changes: 1 addition & 1 deletion man/position_dodge.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/position_identity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/position_nudge.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/position_stack.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 4 additions & 32 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,45 +1,17 @@
library("testthat")
library("animint2")
library("RSelenium");library("XML")
library("XML")
setwd("testthat")
source("helper-functions.R")
source("helper-HTML.R")
source("helper-plot-data.r")

## RSelenium does not work with all versions of firefox, TDH usually
## tests using one of the following.

## thocking@silene:~/R/animint-mine(fix-common-chunk)$ firefox --version
## Mozilla Firefox 11.0
## thocking@silene:~/R/animint(animation-fix)$ java -jar ~/lib/R/library/RSelenium/bin/selenium-server-standalone.jar --version
## 10:10:58.942 INFO - Launching a standalone server
## 10:10:58.973 INFO - Java: Sun Microsystems Inc. 23.25-b01
## 10:10:58.973 INFO - OS: Linux 3.8.0-44-generic amd64
## 10:10:58.987 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
## > packageVersion("RSelenium")
## [1] ‘1.3.6’

## > packageVersion("RSelenium")
## [1] ‘1.3.5’
## tdhock@recycled:~/R/animint(roc-bugfix)$ firefox --version
## Mozilla Firefox 41.0
## tdhock@recycled:~/R/animint(roc-bugfix*)$ java -jar ~/lib/R/library/RSelenium/bin/selenium-server-standalone.jar --version
## 08:13:17.803 INFO - Launching a standalone Selenium Server
## 08:13:17.877 INFO - Java: Oracle Corporation 24.79-b02
## 08:13:17.877 INFO - OS: Linux 3.13.0-65-generic i386
## 08:13:17.907 INFO - v2.47.0, with Core v2.47.0. Built from revision 0e4837e

filter <- Sys.getenv("TEST_SUITE")
# If we're running in github actions then use Firefox, since we can
# use the Selenium docker image instead of relying on PhantomJS.
gh.action <- Sys.getenv("GH_ACTION")
dont.need.browser <- grepl("compiler", filter)
use.browser <- !dont.need.browser
use.browser <- grepl("renderer", filter)
if(filter == ""){
filter <- NULL
}
message(gh.action)
tests_init()

if(use.browser)tests_init()
tests_run(filter=filter)
tests_exit()
if(use.browser)tests_exit()
3 changes: 0 additions & 3 deletions tests/testthat/helper-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,7 @@ unequal <- function(object, expected, ...){
#' tests_exit()
#' }
#'

tests_run <- function(dir = ".", filter = NULL) {
if (!"package:RSelenium" %in% search())
stop("Please load RSelenium: library(RSelenium)")
if (!"package:testthat" %in% search())
stop("Please load testthat: library(testthat)")
testDir <- find_test_path(dir)
Expand Down

0 comments on commit 84eff9b

Please sign in to comment.