Rajesh Vakkalagadda created SPARK-58721:
-------------------------------------------

             Summary: Add tests for ClientArguments.fromCommandLineArgs
                 Key: SPARK-58721
                 URL: https://issues.apache.org/jira/browse/SPARK-58721
             Project: Spark
          Issue Type: Test
          Components: Kubernetes
    Affects Versions: 4.3.0
            Reporter: Rajesh Vakkalagadda


*Summary*

ClientArguments.fromCommandLineArgs (in KubernetesClientApplication.scala) has 
zero test coverage.

*Description*
KubernetesClientApplication.scala defines ClientArguments.fromCommandLineArgs, 
which parses the command-line arguments used to launch a Spark driver on 
Kubernetes: --primary-java-resource,  --primary-py-file, --primary-r-file, 
--main-class, --arg (repeatable), and --proxy-user. It throws  a 
RuntimeException on any unrecognized argument pair and requires --main-class 
via `require(...)`.

This is a small, pure function (Array[String] => ClientArguments, no SparkConf 
or KubernetesClient dependency) with no direct test coverage. The sibling 
`Client` class in the same  file is thoroughly tested via ClientSuite.scala, 
but ClientArguments' own parsing logic, including its error paths, is untested.

*Proposed tests*
 * Each of the three main-resource flags (--primary-java-resource / 
--primary-py-file / --primary-r-file) sets the correct MainAppResource subtype
 * Default MainAppResource when none of the three flags is given
 * Repeated --arg values are collected in order
 * --proxy-user is parsed
 * Last --main-class wins when specified more than once
 * Missing --main-class throws IllegalArgumentException
 * An unrecognized flag throws RuntimeException
 * A trailing flag with no value throws RuntimeException



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to