Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWomens testthat tests failing in travis CI #53
Comments
|
@OscarLane Just tagging you here again - I suspect this is what is causing the vignette to fail in #52. I tried testing locally and when I run
I'm unsure what this means to enter debug mode! I tried running the example listed in the documentation and get the same issue. I changed the code a bit and managed to isolate the issue to two lines of code;
get_aflw_detailed_match_data("CD_M20172640101","CD_R201726401", "CD_S2017264", get_aflw_cookie() )
Called from: eval(expr, p)
Browse[1]> n
debug at /Users/jamesday/Documents/R_scripts/fitzRoy/R/womens_stats.R#236: match_data <- request_metadata %>% jsonlite::fromJSON(flatten = TRUE)
Browse[2]> n
debug at /Users/jamesday/Documents/R_scripts/fitzRoy/R/womens_stats.R#239: match_data <- match_data %>% .$lists
Browse[2]>
It seems that for some reason, both of these lines trigger a debug mode in R Studio (which is potentially related to the R CMD CHECK failing). I don't even know how that's possible but I'm thinking there may be some strange text in the actual parsed data causing this? Not sure if you can replicate on your machine or have any ideas @OscarLane? |
|
Further to this, running the code in the console rather than in the library(dplyr)
matchid = "CD_M20172640101"
competitionid = "CD_S2017264"
roundid = "CD_R201726401"
cookie = fitzRoy::get_aflw_cookie()
request_metadata <- httr::GET("http://www.afl.com.au/api/cfs/afl/statsCentre/teams",
query = list(matchId = matchid,
roundId = roundid,
competitionId = competitionid),
httr::add_headers(`X-media-mis-token` = cookie)) %>%
httr::content(as = "text", encoding = "UTF-8")
# Check that round info is available on web, if not return error
if (stringr::str_detect(request_metadata, "Page Not Found")) {
stop(paste0("Invalid match ID (", matchid, "). Have you checked that this ",
"game has been played yet?"))
}
match_data <- request_metadata %>%
jsonlite::fromJSON(flatten = T)
match_data <- match_data %>%
.$lists
glimpse(match_data[1:10])
#> Observations: 2
#> Variables: 10
#> $ stats.averages.goals <dbl> 5.6, 4.6
#> $ stats.averages.behinds <dbl> 2.7, 4.1
#> $ stats.averages.superGoals <lgl> NA, NA
#> $ stats.averages.kicks <dbl> 111.4, 119.7
#> $ stats.averages.handballs <dbl> 60.6, 47.9
#> $ stats.averages.disposals <dbl> 172.0, 167.6
#> $ stats.averages.marks <dbl> 32.7, 39.7
#> $ stats.averages.bounces <dbl> 2.1, 3.7
#> $ stats.averages.tackles <dbl> 49.4, 56.6
#> $ stats.averages.contestedPossessions <dbl> 96.1, 90.3Created on 2018-12-11 by the reprex package (v0.2.1) |
|
Hmm so that random debug error fixed itself with a restart of my laptap - must have been a strange breakpoint somewhere that I couldn't find. Nonetheless, the Travis CI build is still failing and I can't replicate locally. Seems to fail on
|
|
Hmm interesting, I'll try to have a look this weekend. I'm not getting any problems running the function, so it looks like it's a problem with the test. Possibly the underlying columns available have changed, meaning the test no longer passes, as it looks for exact matches. |
|
I had a look at this finally (pesky holidays getting in the way!), and am as stumped as you are. I've not used Travis before, but I guess it could be something to do with the Travis configuration? Do you think it could be something to do with building in an older version of R? (I see .travis.yaml lists 3.2, 3.3, 3.4 and release.) |
Likely related to #52 - the womens tests are failing. Again - can't replicate locally, only fails on Travis.