From 5230d09e1cb7d511998af3d67ddf2bf63c654cf6 Mon Sep 17 00:00:00 2001 From: ulysses-you Date: Mon, 11 Oct 2021 20:03:15 +0800 Subject: [PATCH] [KYUUBI #1211] Reopen test udf in JDBCTests ### _Why are the changes needed?_ Improve test coverage. ### _How was this patch tested?_ - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1211 from ulysses-you/minikube. Closes #1211 f02edeca [ulysses-you] test Authored-by: ulysses-you Signed-off-by: Cheng Pan --- .../org/apache/kyuubi/operation/JDBCTests.scala | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTests.scala index 1b1a41c39..004670fe1 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTests.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/JDBCTests.scala @@ -353,9 +353,7 @@ trait JDBCTests extends BasicJDBCTests { } } - // TODO: https://github.com/apache/incubator-kyuubi/issues/937 - // Kyuubi docker image has not updated to lastest version - ignore("kyuubi defined function - kyuubi_version") { + test("kyuubi defined function - kyuubi_version") { withJdbcStatement() { statement => val rs = statement.executeQuery("SELECT kyuubi_version()") assert(rs.next()) @@ -363,7 +361,7 @@ trait JDBCTests extends BasicJDBCTests { } } - ignore("kyuubi defined function - engine_name") { + test("kyuubi defined function - engine_name") { withJdbcStatement() { statement => val rs = statement.executeQuery("SELECT engine_name()") assert(rs.next()) @@ -371,12 +369,16 @@ trait JDBCTests extends BasicJDBCTests { } } - // dockerfile use kyuubi as user which is not same with non-k8s env. - ignore("kyuubi defined function - system_user") { + test("kyuubi defined function - system_user") { withJdbcStatement() { statement => val rs = statement.executeQuery("SELECT system_user()") assert(rs.next()) - assert(rs.getString(1) == System.getProperty("user.name")) + val user = rs.getString(1) + // skip minikube test since dockerfile use kyuubi as user which is not same with non-k8s env. + if (user == "kyuubi") { + } else { + assert(user == System.getProperty("user.name")) + } } }