From df3a36dfccc8c2b8190e11512d94a8254197cbc9 Mon Sep 17 00:00:00 2001 From: Jia Yu Date: Mon, 13 May 2024 22:47:03 -0700 Subject: [PATCH] [CI] Ensure each yml change triggers the action (#1413) * Make sure each action gets triggered when the yml file gets modified * Add R too * Fix failed R tests --- .github/workflows/example.yml | 2 ++ .github/workflows/java.yml | 2 ++ .github/workflows/python-wheel.yml | 1 + .github/workflows/python.yml | 2 ++ .github/workflows/r.yml | 2 ++ R/tests/testthat/test-data-interface-raster.R | 12 ++++-------- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index f969da831b..3c0da74697 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -5,11 +5,13 @@ on: - master paths: - 'examples/**' + - '.github/workflows/example.yml' pull_request: branches: - '*' paths: - 'examples/**' + - '.github/workflows/example.yml' permissions: contents: read diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 3d780c7ae1..546d887cf0 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -12,6 +12,7 @@ on: - 'flink-shaded/**' - 'snowflake/**' - 'pom.xml' + - '.github/workflows/java.yml' pull_request: branches: - '*' @@ -23,6 +24,7 @@ on: - 'flink-shaded/**' - 'snowflake/**' - 'pom.xml' + - '.github/workflows/java.yml' env: MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 diff --git a/.github/workflows/python-wheel.yml b/.github/workflows/python-wheel.yml index f659f40bd8..d8268b9e26 100644 --- a/.github/workflows/python-wheel.yml +++ b/.github/workflows/python-wheel.yml @@ -10,6 +10,7 @@ on: - 'spark-shaded/**' - 'pom.xml' - 'python/**' + - '.github/workflows/python-wheel.yml' pull_request: branches: - '*' diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 9e5546677e..b37541d5a7 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -10,6 +10,7 @@ on: - 'spark-shaded/**' - 'pom.xml' - 'python/**' + - '.github/workflows/python.yml' pull_request: branches: - '*' @@ -19,6 +20,7 @@ on: - 'spark-shaded/**' - 'pom.xml' - 'python/**' + - '.github/workflows/python.yml' env: MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 199e030774..6de07770ef 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -10,6 +10,7 @@ on: - 'spark-shaded/**' - 'pom.xml' - 'R/**' + - '.github/workflows/r.yml' pull_request: branches: - '*' @@ -19,6 +20,7 @@ on: - 'spark-shaded/**' - 'pom.xml' - 'R/**' + - '.github/workflows/r.yml' env: MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 diff --git a/R/tests/testthat/test-data-interface-raster.R b/R/tests/testthat/test-data-interface-raster.R index 6bfd53b2ad..7290c5850f 100644 --- a/R/tests/testthat/test-data-interface-raster.R +++ b/R/tests/testthat/test-data-interface-raster.R @@ -132,7 +132,7 @@ test_that("Passed RS_Envelope with raster", { test_that("Passed RS_NumBands with raster", { ## Load sdf_name <- random_string("spatial_sdf") - binary_sdf <- spark_read_binary(sc, dir = test_data("raster"), name = sdf_name) + binary_sdf <- spark_read_binary(sc, dir = test_data("raster/test3.tif"), name = sdf_name) a <- binary_sdf %>% @@ -142,14 +142,11 @@ test_that("Passed RS_NumBands with raster", { ) %>% select(nbands) %>% collect() - expect_equal( a %>% as.list(), - list(nbands = c(1, 1, 4)) - + list(nbands = c(4)) ) - ## Cleanup sc %>% DBI::dbExecute(paste0("DROP TABLE ", sdf_name)) rm(a) @@ -185,7 +182,7 @@ test_that("Passed RS_Value with raster", { test_that("Passed RS_Values with raster", { ## Load sdf_name <- random_string("spatial_sdf") - binary_sdf <- spark_read_binary(sc, dir = test_data("raster"), name = sdf_name) + binary_sdf <- spark_read_binary(sc, dir = test_data("raster/test1.tiff"), name = sdf_name) a <- binary_sdf %>% @@ -195,10 +192,9 @@ test_that("Passed RS_Values with raster", { ) %>% select(val) %>% collect() - expect_equal( a %>% as.list(), - list(val = list(c(255, NA_real_), c(255, NA_real_), c(NA_real_, NA_real_))) + list(val = list(c(255, NA_real_))) )