Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15119#discussion_r95490694
  
    --- Diff: 
core/src/test/scala/org/apache/spark/deploy/SparkSubmitUtilsSuite.scala ---
    @@ -192,10 +211,51 @@ class SparkSubmitUtilsSuite extends SparkFunSuite 
with BeforeAndAfterAll {
         val main = new MavenCoordinate("my.great.lib", "mylib", "0.1")
         val dep = "my.great.dep:mydep:0.5"
         IvyTestUtils.withRepository(main, Some(dep), None) { repo =>
    -      val files = SparkSubmitUtils.resolveMavenCoordinates(main.toString,
    -        Some(repo), None, Seq("my.great.dep:mydep"), isTest = true)
    +      val files = SparkSubmitUtils.resolveMavenCoordinates(
    +        main.toString,
    +        SparkSubmitUtils.buildIvySettings(Some(repo), None),
    +        Seq("my.great.dep:mydep"),
    +        isTest = true)
           assert(files.indexOf(main.artifactId) >= 0, "Did not return 
artifact")
           assert(files.indexOf("my.great.dep") < 0, "Returned excluded 
artifact")
         }
       }
    +
    +  test("load ivy settings file") {
    +    val main = new MavenCoordinate("my.great.lib", "mylib", "0.1")
    +    val dep = "my.great.dep:mydep:0.5"
    +    val dummyIvyLocal = new File(tempIvyPath, "local" + File.separator)
    +    val settingsText =
    +      s"""
    +         |<ivysettings>
    +         |  <caches defaultCacheDir="$tempIvyPath/cache"/>
    +         |  <settings defaultResolver="local-ivy-settings-file-test"/>
    +         |  <resolvers>
    +         |    <filesystem name="local-ivy-settings-file-test">
    +         |      <ivy pattern=
    +         |        
"$dummyIvyLocal/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"/>
    +         |      <artifact pattern=
    +         |        
"$dummyIvyLocal/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"/>
    +         |    </filesystem>
    +         |  </resolvers>
    +         |</ivysettings>
    +         |""".stripMargin
    +
    +    val settingsFile = new File(tempIvyPath, "ivysettings.xml")
    +    val settingsWriter = new FileWriter(settingsFile)
    --- End diff --
    
    Since I added another comment... minor, but guava's `Files.write` would be 
cleaner here (and it also forces you to specify the encoding, which you should 
be doing here anyway).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to