Skip to content

Commit c652bba

Browse files
lsm1cxzl25
authored andcommitted
[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 876659b [senmiaoliu] fix style e1a4203 [LSM] Merge pull request #1 from cxzl25/PR_3015_UT 9a34eed [sychen] fix UT 46e1dff [senmiaoliu] uodate dependencyList 8481b14 [senmiaoliu] Bump scopt from 4.0.1 to 4.1.0 Lead-authored-by: senmiaoliu <senmiaoliu@trip.com> Co-authored-by: sychen <sychen@ctrip.com> Co-authored-by: LSM <senmiaoliu@trip.com> Signed-off-by: Fei Wang <fwang12@ebay.com>
1 parent a6499c6 commit c652bba

File tree

4 files changed

+43
-28
lines changed

4 files changed

+43
-28
lines changed

dev/dependencyList

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ okio/1.15.0//okio-1.15.0.jar
132132
osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar
133133
paranamer/2.8//paranamer-2.8.jar
134134
scala-library/2.12.15//scala-library-2.12.15.jar
135-
scopt_2.12/4.0.1//scopt_2.12-4.0.1.jar
135+
scopt_2.12/4.1.0//scopt_2.12-4.1.0.jar
136136
simpleclient/0.14.1//simpleclient-0.14.1.jar
137137
simpleclient_common/0.14.1//simpleclient_common-0.14.1.jar
138138
simpleclient_dropwizard/0.14.1//simpleclient_dropwizard-0.14.1.jar

kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/BatchCliArgumentsSuite.scala

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ import org.apache.kyuubi.ctl.util.DateTimeUtils._
2121

2222
class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
2323

24+
val batchYamlFile: String = Thread.currentThread.getContextClassLoader
25+
.getResource("cli/batch.yaml").getFile
26+
2427
test("create/submit batch") {
2528
Seq("create", "submit").foreach { op =>
2629
val args = Seq(
2730
op,
2831
"batch",
2932
"-f",
30-
"src/test/resources/cli/batch.yaml")
33+
batchYamlFile)
3134
val opArgs = new ControlCliArguments(args)
32-
assert(opArgs.cliConfig.createOpts.filename == "src/test/resources/cli/batch.yaml")
35+
assert(opArgs.cliConfig.createOpts.filename == batchYamlFile)
3336
}
3437
}
3538

@@ -39,7 +42,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
3942
op,
4043
"batch",
4144
"-f",
42-
"src/test/resources/cli/batch.yaml",
45+
batchYamlFile,
4346
"--hostUrl",
4447
"https://localhost:8440",
4548
"--username",
@@ -78,7 +81,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
7881
"submit",
7982
"batch",
8083
"-f",
81-
"src/test/resources/cli/batch.yaml")
84+
batchYamlFile)
8285
val opArgs = new ControlCliArguments(args)
8386
assert(opArgs.cliConfig.batchOpts.waitCompletion == true)
8487
}
@@ -88,7 +91,7 @@ class BatchCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
8891
"submit",
8992
"batch",
9093
"-f",
91-
"src/test/resources/cli/batch.yaml",
94+
batchYamlFile,
9295
"--waitCompletion",
9396
"false")
9497
val opArgs = new ControlCliArguments(args)

kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ControlCliArgumentsSuite.scala

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,36 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
5656
test("test basic kyuubi service arguments parser") {
5757
Seq("get", "list", "delete").foreach { op =>
5858
Seq("server", "engine").foreach { service =>
59+
val engineUser =
60+
if (service == "engine") {
61+
Seq("-u", user)
62+
} else {
63+
Seq.empty[String]
64+
}
5965
val args = Seq(
6066
op,
6167
service,
6268
"--zk-quorum",
6369
zkQuorum,
6470
"--namespace",
6571
namespace,
66-
"--user",
67-
user,
6872
"--host",
6973
host,
7074
"--port",
7175
port,
7276
"--version",
73-
KYUUBI_VERSION)
77+
KYUUBI_VERSION) ++ engineUser
7478
val opArgs = new ControlCliArguments(args)
7579
assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op))
7680
assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service))
7781
assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum)
7882
assert(opArgs.cliConfig.commonOpts.namespace == namespace)
79-
assert(opArgs.cliConfig.engineOpts.user == user)
8083
assert(opArgs.cliConfig.commonOpts.host == host)
8184
assert(opArgs.cliConfig.commonOpts.port == port)
8285
assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION)
86+
if (service == "engine") {
87+
assert(opArgs.cliConfig.engineOpts.user == user)
88+
}
8389
}
8490
}
8591

@@ -296,30 +302,36 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
296302
test("test use short options") {
297303
Seq("get", "list", "delete").foreach { op =>
298304
Seq("server", "engine").foreach { service =>
305+
val engineUser =
306+
if (service == "engine") {
307+
Seq("-u", user)
308+
} else {
309+
Seq.empty[String]
310+
}
299311
val args = Seq(
300312
op,
301313
service,
302314
"-zk",
303315
zkQuorum,
304316
"-n",
305317
namespace,
306-
"-u",
307-
user,
308318
"-s",
309319
host,
310320
"-p",
311321
port,
312322
"-v",
313-
KYUUBI_VERSION)
323+
KYUUBI_VERSION) ++ engineUser
314324
val opArgs = new ControlCliArguments(args)
315325
assert(opArgs.cliConfig.action.toString.equalsIgnoreCase(op))
316326
assert(opArgs.cliConfig.resource.toString.equalsIgnoreCase(service))
317327
assert(opArgs.cliConfig.commonOpts.zkQuorum == zkQuorum)
318328
assert(opArgs.cliConfig.commonOpts.namespace == namespace)
319-
assert(opArgs.cliConfig.engineOpts.user == user)
320329
assert(opArgs.cliConfig.commonOpts.host == host)
321330
assert(opArgs.cliConfig.commonOpts.port == port)
322331
assert(opArgs.cliConfig.commonOpts.version == KYUUBI_VERSION)
332+
if (service == "engine") {
333+
assert(opArgs.cliConfig.engineOpts.user == user)
334+
}
323335
}
324336
}
325337

@@ -343,7 +355,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
343355
"when the batch is no longer in PENDING state."
344356
val helpString =
345357
s"""kyuubi $KYUUBI_VERSION
346-
|Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options] <args>...
358+
|Usage: kyuubi-ctl [create|get|delete|list|log|submit] [options]
347359
|
348360
| -zk, --zk-quorum <value>
349361
| $zkHelpString
@@ -367,14 +379,14 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
367379
|Command: create server
368380
|${"\t"}Expose Kyuubi server instance to another domain.
369381
|
370-
|Command: get [batch|server|engine] [options] [<batchId>]
382+
|Command: get [batch|server|engine] <args>...
371383
|${"\t"}Display information about the specified resources.
372-
|Command: get batch
384+
|Command: get batch [<batchId>]
373385
|${"\t"}Get batch by id.
374386
| <batchId> Batch id.
375387
|Command: get server
376388
|${"\t"}Get Kyuubi server info of domain
377-
|Command: get engine
389+
|Command: get engine [options]
378390
|${"\t"}Get Kyuubi engine info belong to a user.
379391
| -u, --user <value> The user name this engine belong to.
380392
| -et, --engine-type <value>
@@ -384,15 +396,15 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
384396
| -esl, --engine-share-level <value>
385397
| The engine share level this engine belong to.
386398
|
387-
|Command: delete [batch|server|engine] [options] [<batchId>]
399+
|Command: delete [batch|server|engine] <args>...
388400
|${"\t"}Delete resources.
389-
|Command: delete batch
401+
|Command: delete batch [options] [<batchId>]
390402
|${"\t"}Close batch session.
391403
| <batchId> Batch id.
392404
| --hs2ProxyUser <value> The value of hive.server2.proxy.user config.
393405
|Command: delete server
394406
|${"\t"}Delete the specified service node for a domain
395-
|Command: delete engine
407+
|Command: delete engine [options]
396408
|${"\t"}Delete the specified engine node for user.
397409
| -u, --user <value> The user name this engine belong to.
398410
| -et, --engine-type <value>
@@ -402,9 +414,9 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
402414
| -esl, --engine-share-level <value>
403415
| The engine share level this engine belong to.
404416
|
405-
|Command: list [batch|server|engine] [options]
417+
|Command: list [batch|server|engine]
406418
|${"\t"}List information about resources.
407-
|Command: list batch
419+
|Command: list batch [options]
408420
|${"\t"}List batch session info.
409421
| --batchType <value> Batch type.
410422
| --batchUser <value> Batch user.
@@ -415,7 +427,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
415427
| --size <value> The max number of records returned in the query.
416428
|Command: list server
417429
|${"\t"}List all the service nodes for a particular domain
418-
|Command: list engine
430+
|Command: list engine [options]
419431
|${"\t"}List all the engine nodes for a user
420432
| -u, --user <value> The user name this engine belong to.
421433
| -et, --engine-type <value>
@@ -425,10 +437,10 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
425437
| -esl, --engine-share-level <value>
426438
| The engine share level this engine belong to.
427439
|
428-
|Command: log [batch] [options] [<batchId>]
440+
|Command: log [batch] [options] <args>...
429441
|${"\t"}Print the logs for specified resource.
430442
| --forward If forward is specified, the ctl will block forever.
431-
|Command: log batch
443+
|Command: log batch [options] [<batchId>]
432444
|${"\t"}Get batch session local log.
433445
| <batchId> Batch id.
434446
| --from <value> Specify which record to start from retrieving info.
@@ -437,7 +449,7 @@ class ControlCliArgumentsSuite extends KyuubiFunSuite with TestPrematureExit {
437449
|Command: submit [batch] [options]
438450
|${"\t"}Combination of create, get and log commands.
439451
| -f, --filename <value> Filename to use to create the resource
440-
|Command: submit batch
452+
|Command: submit batch [options]
441453
|${"\t"}open batch session and wait for completion.
442454
| --waitCompletion <value>
443455
| ${waitBatchCompletionHelpString}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
<scalacheck.version>3.2.9.0</scalacheck.version>
159159
<scalatest.version>3.2.9</scalatest.version>
160160
<scalatestplus.version>3.2.9.0</scalatestplus.version>
161-
<scopt.version>4.0.1</scopt.version>
161+
<scopt.version>4.1.0</scopt.version>
162162
<slf4j.version>1.7.35</slf4j.version>
163163
<snakeyaml.version>1.30</snakeyaml.version>
164164
<!--

0 commit comments

Comments
 (0)