You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2022/07/07 10:14:57 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #3007] Bump scopt from 4.0.1 to 4.1.0

This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new c652bba4d [KYUUBI #3007] Bump scopt from 4.0.1 to 4.1.0
c652bba4d is described below

commit c652bba4da594adcff5f1a3dc358339aa1148a69
Author: senmiaoliu <se...@trip.com>
AuthorDate: Thu Jul 7 18:14:49 2022 +0800

    [KYUUBI #3007] Bump scopt from 4.0.1 to 4.1.0
    
    ### _Why are the changes needed?_
    
    close #3007
    
    ### _How was this patch tested?_
    - [ ] 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.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #3015 from lsm1/features/Bump_scopt.
    
    Closes #3007
    
    876659ba [senmiaoliu] fix style
    e1a42033 [LSM] Merge pull request #1 from cxzl25/PR_3015_UT
    9a34eedb [sychen] fix UT
    46e1dff9 [senmiaoliu] uodate dependencyList
    8481b14b [senmiaoliu] Bump scopt from 4.0.1 to 4.1.0
    
    Lead-authored-by: senmiaoliu <se...@trip.com>
    Co-authored-by: sychen <sy...@ctrip.com>
    Co-authored-by: LSM <se...@trip.com>
    Signed-off-by: Fei Wang <fw...@ebay.com>
---
 dev/dependencyList                                 |  2 +-
 .../apache/kyuubi/ctl/BatchCliArgumentsSuite.scala | 13 ++++--
 .../kyuubi/ctl/ControlCliArgumentsSuite.scala      | 54 +++++++++++++---------
 pom.xml                                            |  2 +-
 4 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/dev/dependencyList b/dev/dependencyList
index b5b981768..58e024d06 100644
--- a/dev/dependencyList
+++ b/dev/dependencyList
@@ -132,7 +132,7 @@ okio/1.15.0//okio-1.15.0.jar
 osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar
 paranamer/2.8//paranamer-2.8.jar
 scala-library/2.12.15//scala-library-2.12.15.jar
-scopt_2.12/4.0.1//scopt_2.12-4.0.1.jar
+scopt_2.12/4.1.0//scopt_2.12-4.1.0.jar
 simpleclient/0.14.1//simpleclient-0.14.1.jar
 simpleclient_common/0.14.1//simpleclient_common-0.14.1.jar
 simpleclient_dropwizard/0.14.1//simpleclient_dropwizard-0.14.1.jar
diff --git a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala
index a958a1b6e..47abee364 100644
--- a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala
+++ b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala
@@ -21,15 +21,18 @@ import org.apache.kyuubi.ctl.util.DateTimeUtils._
 
 class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
 
+  val batchYamlFile: String = Thread.currentThread.getContextClassLoader
+    .getResource("cli/batch.yaml").getFile
+
   test("create/submit batch") {
     Seq("create", "submit").foreach { op =>
       val args = Seq(
         op,
         "batch",
         "-f",
-        "src/test/resources/cli/batch.yaml")
+        batchYamlFile)
       val opArgs = new ControlCliArguments(args)
-      assert(opArgs.cliConfig.createOpts.filename == "src/test/resources/cli/batch.yaml")
+      assert(opArgs.cliConfig.createOpts.filename == batchYamlFile)
     }
   }
 
@@ -39,7 +42,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
         op,
         "batch",
         "-f",
-        "src/test/resources/cli/batch.yaml",
+        batchYamlFile,
         "--hostUrl",
         "https://localhost:8440",
         "--username",
@@ -78,7 +81,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
       "submit",
       "batch",
       "-f",
-      "src/test/resources/cli/batch.yaml")
+      batchYamlFile)
     val opArgs = new ControlCliArguments(args)
     assert(opArgs.cliConfig.batchOpts.waitCompletion == true)
   }
@@ -88,7 +91,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
       "submit",
       "batch",
       "-f",
-      "src/test/resources/cli/batch.yaml",
+      batchYamlFile,
       "--waitCompletion",
       "false")
     val opArgs = new ControlCliArguments(args)
diff --git a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala
index dc7f0fbed..1194e14b1 100644
--- a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala
+++ b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala
@@ -56,6 +56,12 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
   test("test basic kyuubi service arguments parser") {
     Seq("get", "list", "delete").foreach { op =>
       Seq("server", "engine").foreach { service =>
+        val engineUser =
+          if (service == "engine") {
+            Seq("-u", user)
+          } else {
+            Seq.empty[String]
+          }
         val args = Seq(
           op,
           service,
@@ -63,23 +69,23 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
           zkQuorum,
           "--namespace",
           namespace,
-          "--user",
-          user,
           "--host",
           host,
           "--port",
           port,
           "--version",
-          KYUUBI_VERSION)
+          KYUUBI_VERSION) ++ engineUser
         val opArgs = new ControlCliArguments(args)
         assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op))
         assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service))
         assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum)
         assert(opArgs.cliConfig.commonOpts.namespace == namespace)
-        assert(opArgs.cliConfig.engineOpts.user == user)
         assert(opArgs.cliConfig.commonOpts.host == host)
         assert(opArgs.cliConfig.commonOpts.port == port)
         assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION)
+        if (service == "engine") {
+          assert(opArgs.cliConfig.engineOpts.user == user)
+        }
       }
     }
 
@@ -296,6 +302,12 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
   test("test use short options") {
     Seq("get", "list", "delete").foreach { op =>
       Seq("server", "engine").foreach { service =>
+        val engineUser =
+          if (service == "engine") {
+            Seq("-u", user)
+          } else {
+            Seq.empty[String]
+          }
         val args = Seq(
           op,
           service,
@@ -303,23 +315,23 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
           zkQuorum,
           "-n",
           namespace,
-          "-u",
-          user,
           "-s",
           host,
           "-p",
           port,
           "-v",
-          KYUUBI_VERSION)
+          KYUUBI_VERSION) ++ engineUser
         val opArgs = new ControlCliArguments(args)
         assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op))
         assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service))
         assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum)
         assert(opArgs.cliConfig.commonOpts.namespace == namespace)
-        assert(opArgs.cliConfig.engineOpts.user == user)
         assert(opArgs.cliConfig.commonOpts.host == host)
         assert(opArgs.cliConfig.commonOpts.port == port)
         assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION)
+        if (service == "engine") {
+          assert(opArgs.cliConfig.engineOpts.user == user)
+        }
       }
     }
 
@@ -343,7 +355,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
       "when the batch is no longer in PENDING state."
     val helpString =
       s"""kyuubi $KYUUBI_VERSION
-         |Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options] <args>...
+         |Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options]
          |
          |  -zk, --zk-quorum <value>
          |                           $zkHelpString
@@ -367,14 +379,14 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
          |Command: create server
          |${"\t"}Expose Kyuubi server instance to another domain.
          |
-         |Command: get [batch|server|engine] [options] [<batchId>]
+         |Command: get [batch|server|engine] <args>...
          |${"\t"}Display information about the specified resources.
-         |Command: get batch
+         |Command: get batch [<batchId>]
          |${"\t"}Get batch by id.
          |  <batchId>                Batch id.
          |Command: get server
          |${"\t"}Get Kyuubi server info of domain
-         |Command: get engine
+         |Command: get engine [options]
          |${"\t"}Get Kyuubi engine info belong to a user.
          |  -u, --user <value>       The user name this engine belong to.
          |  -et, --engine-type <value>
@@ -384,15 +396,15 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
          |  -esl, --engine-share-level <value>
          |                           The engine share level this engine belong to.
          |
-         |Command: delete [batch|server|engine] [options] [<batchId>]
+         |Command: delete [batch|server|engine] <args>...
          |${"\t"}Delete resources.
-         |Command: delete batch
+         |Command: delete batch [options] [<batchId>]
          |${"\t"}Close batch session.
          |  <batchId>                Batch id.
          |  --hs2ProxyUser <value>   The value of hive.server2.proxy.user config.
          |Command: delete server
          |${"\t"}Delete the specified service node for a domain
-         |Command: delete engine
+         |Command: delete engine [options]
          |${"\t"}Delete the specified engine node for user.
          |  -u, --user <value>       The user name this engine belong to.
          |  -et, --engine-type <value>
@@ -402,9 +414,9 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
          |  -esl, --engine-share-level <value>
          |                           The engine share level this engine belong to.
          |
-         |Command: list [batch|server|engine] [options]
+         |Command: list [batch|server|engine]
          |${"\t"}List information about resources.
-         |Command: list batch
+         |Command: list batch [options]
          |${"\t"}List batch session info.
          |  --batchType <value>      Batch type.
          |  --batchUser <value>      Batch user.
@@ -415,7 +427,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
          |  --size <value>           The max number of records returned in the query.
          |Command: list server
          |${"\t"}List all the service nodes for a particular domain
-         |Command: list engine
+         |Command: list engine [options]
          |${"\t"}List all the engine nodes for a user
          |  -u, --user <value>       The user name this engine belong to.
          |  -et, --engine-type <value>
@@ -425,10 +437,10 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
          |  -esl, --engine-share-level <value>
          |                           The engine share level this engine belong to.
          |
-         |Command: log [batch] [options] [<batchId>]
+         |Command: log [batch] [options] <args>...
          |${"\t"}Print the logs for specified resource.
          |  --forward                If forward is specified, the ctl will block forever.
-         |Command: log batch
+         |Command: log batch [options] [<batchId>]
          |${"\t"}Get batch session local log.
          |  <batchId>                Batch id.
          |  --from <value>           Specify which record to start from retrieving info.
@@ -437,7 +449,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
          |Command: submit [batch] [options]
          |${"\t"}Combination of create, get and log commands.
          |  -f, --filename <value>   Filename to use to create the resource
-         |Command: submit batch
+         |Command: submit batch [options]
          |${"\t"}open batch session and wait for completion.
          |  --waitCompletion <value>
          |                           ${waitBatchCompletionHelpString}
diff --git a/pom.xml b/pom.xml
index a3d0cfba2..1bd1503ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,7 +158,7 @@
         <scalacheck.version>3.2.9.0</scalacheck.version>
         <scalatest.version>3.2.9</scalatest.version>
         <scalatestplus.version>3.2.9.0</scalatestplus.version>
-        <scopt.version>4.0.1</scopt.version>
+        <scopt.version>4.1.0</scopt.version>
         <slf4j.version>1.7.35</slf4j.version>
         <snakeyaml.version>1.30</snakeyaml.version>
         <!--