Skip to content

Commit

Permalink
Merge pull request #122 from shufinskiy/skipkp
Browse files Browse the repository at this point in the history
add opportunity skip kenpom tests
  • Loading branch information
shufinskiy authored Aug 24, 2023
2 parents 61ae1df + 4482d5d commit c43c6b7
Show file tree
Hide file tree
Showing 36 changed files with 42 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tests/testthat/helper-skip.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
skip_kenpom_test <- function(){
if(Sys.getenv("KP_USER") == ''){
skip("User can't run KenPom tests")
} else {
invisible()
}
}
2 changes: 1 addition & 1 deletion tests/testthat/test-espn_nba_game_rosters.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ test_that("ESPN - Get NBA game roster", {
"birth_place_city",
"birth_place_state",
"birth_place_country",
"citizenship",
"slug",
"headshot_href",
"headshot_alt",
Expand Down Expand Up @@ -87,7 +88,6 @@ test_that("ESPN - Get NBA game roster", {
"order",
"home_away",
"winner",
"citizenship",
"contract_base_year_compensation_active",
"contract_base_year_compensation_expiration",
"hand_type",
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_arenas.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get arenas", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_arenas(year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_box.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get box score", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_box(game_id = 1238, year = 2020)
x1 <- x[[1]]
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_coach_history.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get coach history", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_coach_history(
coach = "Leonard Hamilton"
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_conf.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get conference (leaderboard)", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_conf(year="2020",conf="ACC")

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_confhistory.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get conference history", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_confhistory(conf="ACC")

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_confstats.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get conference statistics", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_confstats(year = "2020")

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_efficiency.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get efficiency", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_efficiency(min_year = 2020, max_year = 2020)
cols <- c(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_fanmatch.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get FanMatch", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_fanmatch(date = "2020-03-10")

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_foul_trouble.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get foul trouble", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_foul_trouble(min_year = 2020, max_year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_fourfactors.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get four factors", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_fourfactors(min_year = 2020, max_year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_game_attrs.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get game attributes", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_game_attrs(year = 2020, attr = "Excitement")

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_gameplan.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get gameplan", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_gameplan(team = "Florida St.", year = 2020)
x1 <- x[[1]]
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_hca.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get home court advantage", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_hca()

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_height.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get heights", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_height(min_year = 2020, max_year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_kpoy.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get kpoy", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_kpoy(year = 2020)
x1 <- x[[1]]
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_minutes_matrix.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get minutes matrix", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_minutes_matrix(team = "Florida St.", year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_officials.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get officials", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_officials(year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_opptracker.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get opponent tracker", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_opptracker(team = "Florida St.", year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_player_career.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get player career", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_player_career(player_id = "41180")
x1 <- x[[1]]
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_playerstats.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get player stats", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_playerstats(metric = "eFG", conf_only = FALSE, year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_pointdist.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get point distribution", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_pointdist(min_year = 2020, max_year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_pomeroy_archive_ratings.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get pomeroy archive ratings", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_pomeroy_archive_ratings(date = "2018-11-22")

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_pomeroy_ratings.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get Pomeroy ratings", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_pomeroy_ratings(min_year = 2020, max_year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_program_ratings.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get program ratings", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_program_ratings()

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_referee.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get referee game log", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_referee(referee = 714363, year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_team_depth_chart.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get team depth chart", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_team_depth_chart(team = "Florida St.", year = 2020)
cols <- c(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_team_history.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get team history", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_team_history(
team = "Florida St."
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_team_lineups.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get team lineups", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_team_lineups(team = "Florida St.", year= 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_team_player_stats.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get team player stats", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_team_player_stats(team = "Florida St.", year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_team_players.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get team players (roster)", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_team_players(team = "Florida St.", year= 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_team_schedule.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
test_that("KP - Get team schedule", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_team_schedule(team = "Florida St.", year= 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_teamstats.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get team stats", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_teamstats(min_year = 2020, max_year = 2020)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_trends.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get trends", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_trends()

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-kp_winprob.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_that("KP - Get win probability", {
skip_on_cran()
skip_on_ci()
skip_kenpom_test()

x <- kp_winprob(game_id = 1238, year = 2020)
x1 <- x[[1]]
Expand Down

0 comments on commit c43c6b7

Please sign in to comment.