You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "mike-mcgann (via GitHub)" <gi...@apache.org> on 2023/02/15 13:46:19 UTC

[GitHub] [daffodil] mike-mcgann opened a new pull request, #965: Format test and sbt files

mike-mcgann opened a new pull request, #965:
URL: https://github.com/apache/daffodil/pull/965

   This change applies scalafmt to test and sbt files, adds additional checks to the CI workflow, and updates DEVELOP.md.
   
   [DAFFODIL-2133](https://issues.apache.org/jira/browse/DAFFODIL-2133)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] mike-mcgann commented on a diff in pull request #965: Format test and sbt files

Posted by "mike-mcgann (via GitHub)" <gi...@apache.org>.
mike-mcgann commented on code in PR #965:
URL: https://github.com/apache/daffodil/pull/965#discussion_r1107258885


##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestBlob.scala:
##########
@@ -110,19 +111,23 @@ class TestBlob {
    *
    ***/
   @Test def test_2GB_blob(): Unit = {
-    val schema = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd")
+    val schema = path(
+      "daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd",
+    )

Review Comment:
   Or maybe define prefixes in a constant and reference that later:
   
   ```scala
   val cliTestResources = "daffodil-cli/src/test/resources/org/apache/daffodil/cli"
   
   val schema = path(s"{cliTestResources}/large_blob.dfdl.xsd"`)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] tuxji merged pull request #965: Format test and sbt files

Posted by "tuxji (via GitHub)" <gi...@apache.org>.
tuxji merged PR #965:
URL: https://github.com/apache/daffodil/pull/965


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] stevedlawrence commented on a diff in pull request #965: Format test and sbt files

Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence commented on code in PR #965:
URL: https://github.com/apache/daffodil/pull/965#discussion_r1107169053


##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestBlob.scala:
##########
@@ -110,19 +111,23 @@ class TestBlob {
    *
    ***/
   @Test def test_2GB_blob(): Unit = {
-    val schema = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd")
+    val schema = path(
+      "daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd",
+    )
     val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/2049MB.bin")
 
     assumeTrue("large test input file must be manually generated", exists(input))
 
     withTempFile { infoset =>
       withTempFile { unparse =>
         withBlobDir {
-          runCLI(args"parse -s $schema -o $infoset $input", timeout = 120) { cli =>
-          } (ExitCode.Success)
+          runCLI(args"parse -s $schema -o $infoset $input", timeout = 120) { cli => }(
+            ExitCode.Success,
+          )
 
-          runCLI(args"unparse -s $schema -o $unparse $infoset", timeout = 120) { cli =>
-          } (ExitCode.Success)
+          runCLI(args"unparse -s $schema -o $unparse $infoset", timeout = 120) { cli => }(
+            ExitCode.Success,
+          )

Review Comment:
   This particular changes makes this much less readable. For consistency, we really want all these tests to have the same pattern of
   
   ```scala
   runCLI(args"...") { cli =>
     // zero or more lines of actual checks
   }(ExitCode.Foo)
   ```
   
   It seems the ones with bad formatting are those without actual CLI expect checks, likely because all the test cares about is the exit code. I don't think there are too many of those--maybe we just add a comment that makes it clear no expect logic is intentional, and it might also prevent scalafmt from changing these lines? For example:
   
   ```scala
   runCLI(args"...") { cli =>
     // this block intentionally left blank
   }(ExitCode.Success)
   ```



##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestBlob.scala:
##########
@@ -110,19 +111,23 @@ class TestBlob {
    *
    ***/
   @Test def test_2GB_blob(): Unit = {
-    val schema = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd")
+    val schema = path(
+      "daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd",
+    )

Review Comment:
   I don't really like how this is changing all these one liner `path` calls to 3 lines. I guess they're longer than our max line length, but it isn't really saving much except making it a bit harder to read, IMO. Not sure if there's much we can do about it though.



##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/schematron/TestSvrlOutput.scala:
##########
@@ -17,55 +17,64 @@
 
 package org.apache.daffodil.cliTest.schematron
 
+import java.nio.charset.StandardCharsets.UTF_8
 import java.nio.file.Files
 import java.nio.file.Path
 import java.nio.file.StandardOpenOption.APPEND
-import java.nio.charset.StandardCharsets.UTF_8
+import scala.xml.XML
+
+import org.apache.daffodil.cli.Main.ExitCode
+import org.apache.daffodil.cli.cliTest.Util._
 
 import org.junit.Assert.assertFalse
 import org.junit.Assert.assertTrue
 import org.junit.Assert.fail
 import org.junit.Test
 
-import scala.xml.XML
-
-import org.apache.daffodil.cli.cliTest.Util._
-import org.apache.daffodil.cli.Main.ExitCode
-
 class TestSvrlOutput {
 
   private def makeConf(conf: Path, schematron: Path, svrl: Path): Unit = {
-    Files.write(conf, s"""schematron.path="${jsonEscape(schematron.toString)}"\n""".getBytes(UTF_8), APPEND)
-    Files.write(conf, s"""schematron.svrl.file="${jsonEscape(svrl.toString)}"\n""".getBytes(UTF_8), APPEND)
+    Files.write(
+      conf,
+      s"""schematron.path="${jsonEscape(schematron.toString)}"\n""".getBytes(UTF_8),
+      APPEND,
+    )
+    Files.write(
+      conf,
+      s"""schematron.svrl.file="${jsonEscape(svrl.toString)}"\n""".getBytes(UTF_8),
+      APPEND,
+    )
   }
 
   @Test def validationSuccess(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/string.dfdl.xsd")
     val schematron = path("daffodil-schematron/src/test/resources/sch/never-fails.sch")
     val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/uuid.txt")
 
-    withTempFile(".conf", { conf =>
-      withTempFile { svrl =>
-
-        makeConf(conf, schematron, svrl)
-
-        runCLI(args"parse --validate schematron=$conf -s $schema $input") { cli =>
-          cli.expect("<never-fails>2f6481e6-542c-11eb-ae93-0242ac130002</never-fails>")
-        } (ExitCode.Success)
-
-        XML.loadFile(svrl.toFile) match {
-          case <svrl:schematron-output>{rules @ _*}</svrl:schematron-output> =>
-            val res = rules.find {
-              case <svrl:failed-assert>{  _* }</svrl:failed-assert> => true
-              case _ => false
-            }
-            // we should not have found failures
-            assertFalse(res.isDefined)
-          case _ =>
-            fail("schematron pattern didnt match")
+    withTempFile(
+      ".conf",
+      { conf =>

Review Comment:
   I don't even understand why it made this change.



##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/schematron/TestEmbedded.scala:
##########
@@ -40,99 +41,111 @@ class TestEmbedded {
     runCLI(args"""parse -r list -s $schema""") { cli =>
       cli.send("widget,monday,1,$5.00,$5.00", inputDone = true)
       cli.expect("</ex:list>")
-    } (ExitCode.Success)
+    }(ExitCode.Success)
   }
 
   @Test def unitPriceWithValidation(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/unit_price.dfdl.xsd")
 
-    runCLI(args"""parse -r list --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
+    runCLI(
+      args"""parse -r list --validate schematron="${jsonEscape(schema.toString)}" -s $schema""",
+    ) { cli =>
       cli.send("widget,monday,1,$5.00,$6.00", inputDone = true)
       cli.expect("</ex:list>")
       cli.expectErr("Validation Error: wrong unit price for widget, monday")
-    } (ExitCode.ParseError)
+    }(ExitCode.ParseError)
   }
 
   @Test def unitPriceWithValidationCheckMessage(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/unit_price.dfdl.xsd")
 
-    runCLI(args"""parse -r list --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
+    runCLI(
+      args"""parse -r list --validate schematron="${jsonEscape(schema.toString)}" -s $schema""",
+    ) { cli =>
       cli.send("widget,monday,5,$5.00,$25.00||gadget,tuesday,1,$10.00,$11.00", inputDone = true)
       cli.expect("</ex:list>")
       cli.expectErr("Validation Error: wrong unit price for gadget, tuesday")
-    } (ExitCode.ParseError)
+    }(ExitCode.ParseError)
   }
 
   @Test def extends1(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/extends-1.dfdl.xsd")
 
-    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
-      cli.send("bob;l;smith", inputDone = true)
-      cli.expect("</name>")
-    } (ExitCode.Success) 
+    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") {
+      cli =>
+        cli.send("bob;l;smith", inputDone = true)
+        cli.expect("</name>")
+    }(ExitCode.Success)
   }
 
   @Test def extends2(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/extends-1.dfdl.xsd")
 
-    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
-      cli.send("ob;;smith", inputDone = true)
-      cli.expect("</name>")
-    } (ExitCode.Success) 
+    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") {
+      cli =>
+        cli.send("ob;;smith", inputDone = true)
+        cli.expect("</name>")
+    }(ExitCode.Success)
   }
 
   @Test def extends3(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/extends-1.dfdl.xsd")
 
-    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
-      cli.send(";;smith", inputDone = true)
-      cli.expectErr("Validation Error: first is blank")
-    } (ExitCode.ParseError)
+    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") {
+      cli =>
+        cli.send(";;smith", inputDone = true)
+        cli.expectErr("Validation Error: first is blank")
+    }(ExitCode.ParseError)
   }
 
   @Test def extends4(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/extends-1.dfdl.xsd")
 
-    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
-      cli.send("bob;l;", inputDone = true)
-      cli.expectErr("Validation Error: last is blank")
-    } (ExitCode.ParseError)
+    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") {
+      cli =>
+        cli.send("bob;l;", inputDone = true)
+        cli.expectErr("Validation Error: last is blank")
+    }(ExitCode.ParseError)
   }
 
   @Test def extends5(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/extends-1.dfdl.xsd")
 
-    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
-      cli.send(";l;", inputDone = true)
-      cli.expectErr("Validation Error: last is blank")
-      cli.expectErr("Validation Error: first is blank")
-    } (ExitCode.ParseError)
+    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") {
+      cli =>
+        cli.send(";l;", inputDone = true)
+        cli.expectErr("Validation Error: last is blank")
+        cli.expectErr("Validation Error: first is blank")
+    }(ExitCode.ParseError)
   }
 
   @Test def testWithNs1(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/with-ns-1.dfdl.xsd")
 
-    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
-      cli.send("0;1", inputDone = true)
-      cli.expect("</myns:interval>")
-    } (ExitCode.Success)
+    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") {
+      cli =>
+        cli.send("0;1", inputDone = true)
+        cli.expect("</myns:interval>")
+    }(ExitCode.Success)
   }
 
   @Test def testWithNs2(): Unit = {
     val schema = path("daffodil-schematron/src/test/resources/xsd/with-ns-1.dfdl.xsd")
 
-    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") { cli =>
-      cli.send("2;1", inputDone = true)
-      cli.expectErr("Validation Error")
-    } (ExitCode.ParseError)
+    runCLI(args"""parse --validate schematron="${jsonEscape(schema.toString)}" -s $schema""") {
+      cli =>

Review Comment:
   I think this is another example about this being very aggressive about line lengths which ultimately hurts readability.



##########
project/Rat.scala:
##########
@@ -101,12 +112,24 @@ object Rat {
     file("daffodil-tdml-lib/src/test/resources/test/tdml/test.txt"),
     file("daffodil-tdml-processor/src/test/resources/test/tdml/test.bin"),
     file("daffodil-tdml-processor/src/test/resources/test/tdml/test.txt"),
-    file("daffodil-test/src/test/resources/org/apache/daffodil/runtime2/ISRM_green_to_orange_60000.0.dat"),
-    file("daffodil-test/src/test/resources/org/apache/daffodil/runtime2/ISRM_green_to_orange_60000.1.dat"),
-    file("daffodil-test/src/test/resources/org/apache/daffodil/runtime2/ISRM_orange_to_green_60002.dat"),
-    file("daffodil-test/src/test/resources/org/apache/daffodil/runtime2/MPU_green_to_orange_60004.dat"),
-    file("daffodil-test/src/test/resources/org/apache/daffodil/runtime2/MPU_orange_to_green_60006.0.dat"),
-    file("daffodil-test/src/test/resources/org/apache/daffodil/runtime2/MPU_orange_to_green_60006.1.dat"),
+    file(
+      "daffodil-test/src/test/resources/org/apache/daffodil/runtime2/ISRM_green_to_orange_60000.0.dat",
+    ),
+    file(
+      "daffodil-test/src/test/resources/org/apache/daffodil/runtime2/ISRM_green_to_orange_60000.1.dat",
+    ),
+    file(
+      "daffodil-test/src/test/resources/org/apache/daffodil/runtime2/ISRM_orange_to_green_60002.dat",
+    ),
+    file(
+      "daffodil-test/src/test/resources/org/apache/daffodil/runtime2/MPU_green_to_orange_60004.dat",
+    ),
+    file(
+      "daffodil-test/src/test/resources/org/apache/daffodil/runtime2/MPU_orange_to_green_60006.0.dat",
+    ),
+    file(
+      "daffodil-test/src/test/resources/org/apache/daffodil/runtime2/MPU_orange_to_green_60006.1.dat",
+    ),

Review Comment:
   Another example where long lines really should be allowed. This changed 1 line that's over the line length limit, to two short lines and a third line that's still over the limit, just a bit shorter.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] stevedlawrence commented on a diff in pull request #965: Format test and sbt files

Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence commented on code in PR #965:
URL: https://github.com/apache/daffodil/pull/965#discussion_r1107267250


##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestBlob.scala:
##########
@@ -110,19 +111,23 @@ class TestBlob {
    *
    ***/
   @Test def test_2GB_blob(): Unit = {
-    val schema = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd")
+    val schema = path(
+      "daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd",
+    )

Review Comment:
   One reason I like the full path is it's easy to copy/paste when a test fails and I need to manually run a test. But I guess that happens rarely enough, and it's not much extra effort to manually replace the variable with the common part.
   
   This seems like a reasonable approach. I guess it's also good that it removes more boilerplate, and makes the actual test file (i.e. the important thing) stand out a bit more.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] tuxji commented on a diff in pull request #965: Format test and sbt files

Posted by "tuxji (via GitHub)" <gi...@apache.org>.
tuxji commented on code in PR #965:
URL: https://github.com/apache/daffodil/pull/965#discussion_r1107323337


##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestBlob.scala:
##########
@@ -110,19 +111,23 @@ class TestBlob {
    *
    ***/
   @Test def test_2GB_blob(): Unit = {
-    val schema = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd")
+    val schema = path(
+      "daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd",
+    )

Review Comment:
   Using a constant to shorten paths is reasonable as well although I've used copy/paste on test file paths to go look at a test file like Steve too.  Everything we do with test files will become easier to do if we actually remove their parent directories as much as possible, though.  Many tests shouldn't need more than 1 or 2 parent directories, IMO.
   
   Whatever we decide to do, let's do it in another PR.  I want to merge this PR before I work on my next runtime2 PR (daffodil-codegen-c and DaffodilC instead of Runtime2).  How long until we can hear from @mbeckerle too?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] tuxji commented on pull request #965: Format test and sbt files

Posted by "tuxji (via GitHub)" <gi...@apache.org>.
tuxji commented on PR #965:
URL: https://github.com/apache/daffodil/pull/965#issuecomment-1431497712

   > Feels like a number of these change hurt readability due to slightly long lines being preferred, but I'm not sure there's much we can do about it.
   
   We are not that helpless; the long lines due to long test file paths are under our control.  I will wait for @mbeckerle's opinion whether we should make further changes like that or live with the formatting changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] tuxji commented on a diff in pull request #965: Format test and sbt files

Posted by "tuxji (via GitHub)" <gi...@apache.org>.
tuxji commented on code in PR #965:
URL: https://github.com/apache/daffodil/pull/965#discussion_r1107185455


##########
DEVELOP.md:
##########
@@ -138,11 +138,10 @@ run `git push` from your reading copy.
 
 ### Code Style
 
-Daffodil mandates standard Scala formatting and its code generally
-keeps close to that formatting consistently.  No one has run an
-automatic Scala formatter on the codebase yet (there has not been much
-need since the code is already formatted pretty well) but
-[DAFFODIL-2133][] is waiting for someone willing to do that work.
+Daffodil code is formatted using [Scalafmt](https://scalameta.org/scalafmt/).
+Run `sbt scalafmtCheckAll` to see if changes to the source code reqiure

Review Comment:
   *require



##########
daffodil-cli/src/it/scala/org/apache/daffodil/cliTest/TestCLIUdfs.scala:
##########
@@ -179,105 +225,159 @@ class TestCLIUdfs {
    *   has unsupported return type
    */
   @Test def test_UDFClass_noEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/",
+    )
 
     runCLI(args"-v parse -s $schema -r user_func1", classpath) { cli =>
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.Replace." +
-        " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncA." +
-        " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncB." +
-        " Unsupported return type: void")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncC." +
-        " Unsupported parameter type(s): String[],int[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncD." +
-        " Unsupported parameter type(s): String[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncE." +
-        " Unsupported return type: String[]")
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.Replace." +
+          " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncA." +
+          " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncB." +
+          " Unsupported return type: void",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncC." +
+          " Unsupported parameter type(s): String[],int[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncD." +
+          " Unsupported parameter type(s): String[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncE." +
+          " Unsupported return type: String[]",
+      )
       cli.expectErr("[error] Schema Definition Error: Unsupported function: jsudf:replace")
-    } (ExitCode.UnableToCreateProcessor)
+    }(ExitCode.UnableToCreateProcessor)
   }
 
   /**
    * Tests the case when a function class:
    *   throws custom error on evaluate
    */
   @Test def test_UDFClass_CustomExceptionOnEvaluate(): Unit = {

Review Comment:
   This is one of the two IT tests which are failing in CI.  This one fails with `net.sf.expectit.ExpectIOException: Expect operation fails (timeout: -1 ms) for matcher: contains('at org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse.evaluate(StringFunctionsProvider.scala:56)')`.  I've looked at the formatting changes and I don't think they've changed the string arguments, only the whitespace around them.  You'll have to debug the test to see what the text being matched against really contains.  I'm pretty sure the line number changed because the other test file got reformatted (the StringFunctions.Reverse file).  Simply take out the line number from the string argument at line 288 below.



##########
daffodil-cli/src/it/scala/org/apache/daffodil/cliTest/TestCLIUdfs.scala:
##########
@@ -179,105 +225,159 @@ class TestCLIUdfs {
    *   has unsupported return type
    */
   @Test def test_UDFClass_noEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/",
+    )
 
     runCLI(args"-v parse -s $schema -r user_func1", classpath) { cli =>
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.Replace." +
-        " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncA." +
-        " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncB." +
-        " Unsupported return type: void")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncC." +
-        " Unsupported parameter type(s): String[],int[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncD." +
-        " Unsupported parameter type(s): String[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncE." +
-        " Unsupported return type: String[]")
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.Replace." +
+          " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncA." +
+          " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncB." +
+          " Unsupported return type: void",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncC." +
+          " Unsupported parameter type(s): String[],int[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncD." +
+          " Unsupported parameter type(s): String[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncE." +
+          " Unsupported return type: String[]",
+      )
       cli.expectErr("[error] Schema Definition Error: Unsupported function: jsudf:replace")
-    } (ExitCode.UnableToCreateProcessor)
+    }(ExitCode.UnableToCreateProcessor)
   }
 
   /**
    * Tests the case when a function class:
    *   throws custom error on evaluate
    */
   @Test def test_UDFClass_CustomExceptionOnEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/",
+    )
 
     runCLI(args"parse -s $schema -r user_func2", classpath) { cli =>
       cli.send("strng", inputDone = true)
-      cli.expectErr("[error] User Defined Function 'ssudf:reverse' Error. Cause: org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse$CustomException: UDF Error!")
-      cli.expectErr("at org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse.evaluate(StringFunctionsProvider.scala:56)")
-    } (ExitCode.UserDefinedFunctionError)
+      cli.expectErr(
+        "[error] User Defined Function 'ssudf:reverse' Error. Cause: org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse$CustomException: UDF Error!",
+      )
+      cli.expectErr(
+        "at org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse.evaluate(StringFunctionsProvider.scala:56)",
+      )
+    }(ExitCode.UserDefinedFunctionError)
   }
 
   /**
    * Tests the case when a function class:
    *   throws processing error on evaluate
    */
   @Test def test_UDFClass_ProcessingErrorOnEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/",
+    )
 
     runCLI(args"parse -s $schema -r user_func3", classpath) { cli =>
-      cli.expectErr("[error] Schema Definition Error: User Defined Function 'ssudf:rev-words' Error: UDF PE!")
-    } (ExitCode.UnableToCreateProcessor)
+      cli.expectErr(
+        "[error] Schema Definition Error: User Defined Function 'ssudf:rev-words' Error: UDF PE!",
+      )
+    }(ExitCode.UnableToCreateProcessor)
   }
 
   /**
    * Tests the case when a function class:
    *   throws an error while being loaded
    */
   @Test def test_UDFClass_exceptionOnLoad(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions2/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions2/StringFunctions/",
+    )
 
     runCLI(args"-v parse -s $schema -r user_func3", classpath) { cli =>
-      cli.expectErr("[error] User Defined Function could not be initialized: {http://example.com/scala/udf}rev-words.")
-      cli.expectErr("Cause: org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords$CustomException: UDF Error!")
-      cli.expectErr("at org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords.<init>(StringFunctionsProvider.scala:65)")
-    } (ExitCode.UserDefinedFunctionError)
+      cli.expectErr(
+        "[error] User Defined Function could not be initialized: {http://example.com/scala/udf}rev-words.",
+      )
+      cli.expectErr(
+        "Cause: org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords$CustomException: UDF Error!",
+      )
+      cli.expectErr(
+        "at org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords.<init>(StringFunctionsProvider.scala:65)",

Review Comment:
   Likewise, remove the line number (or more) from this string argument to avoid `Expect operation fails (timeout: -1 ms) for matcher: contains('at org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords.<init>(StringFunctionsProvider.scala:65)'`.  Being too verbose makes the test more brittle (what if the path changes due to renaming or shortening changes as well?).



##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestBlob.scala:
##########
@@ -110,19 +111,23 @@ class TestBlob {
    *
    ***/
   @Test def test_2GB_blob(): Unit = {
-    val schema = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd")
+    val schema = path(
+      "daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd",
+    )
     val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/2049MB.bin")
 
     assumeTrue("large test input file must be manually generated", exists(input))
 
     withTempFile { infoset =>
       withTempFile { unparse =>
         withBlobDir {
-          runCLI(args"parse -s $schema -o $infoset $input", timeout = 120) { cli =>
-          } (ExitCode.Success)
+          runCLI(args"parse -s $schema -o $infoset $input", timeout = 120) { cli => }(
+            ExitCode.Success,
+          )
 
-          runCLI(args"unparse -s $schema -o $unparse $infoset", timeout = 120) { cli =>
-          } (ExitCode.Success)
+          runCLI(args"unparse -s $schema -o $unparse $infoset", timeout = 120) { cli => }(
+            ExitCode.Success,
+          )

Review Comment:
   Yes, a well-placed comment like "// checks only exit code" in those places probably will preserve the desired formatting.



##########
daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestBlob.scala:
##########
@@ -110,19 +111,23 @@ class TestBlob {
    *
    ***/
   @Test def test_2GB_blob(): Unit = {
-    val schema = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd")
+    val schema = path(
+      "daffodil-cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd",
+    )

Review Comment:
   We have two options:
   
   1. Increase maxColumns (which means a lot of files get reformatting changes again).
   2. Shorten our file paths ("daf/cli/src/test/resources/org/apache/daffodil/cli/large_blob.dfdl.xsd" or go even further and remove the org/apache/daffodil entirely, since test files can use shorter paths).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] stevedlawrence commented on a diff in pull request #965: Format test and sbt files

Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence commented on code in PR #965:
URL: https://github.com/apache/daffodil/pull/965#discussion_r1107217607


##########
daffodil-cli/src/it/scala/org/apache/daffodil/cliTest/TestCLIUdfs.scala:
##########
@@ -179,105 +225,159 @@ class TestCLIUdfs {
    *   has unsupported return type
    */
   @Test def test_UDFClass_noEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/",
+    )
 
     runCLI(args"-v parse -s $schema -r user_func1", classpath) { cli =>
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.Replace." +
-        " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncA." +
-        " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncB." +
-        " Unsupported return type: void")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncC." +
-        " Unsupported parameter type(s): String[],int[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncD." +
-        " Unsupported parameter type(s): String[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncE." +
-        " Unsupported return type: String[]")
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.Replace." +
+          " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncA." +
+          " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncB." +
+          " Unsupported return type: void",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncC." +
+          " Unsupported parameter type(s): String[],int[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncD." +
+          " Unsupported parameter type(s): String[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncE." +
+          " Unsupported return type: String[]",
+      )
       cli.expectErr("[error] Schema Definition Error: Unsupported function: jsudf:replace")
-    } (ExitCode.UnableToCreateProcessor)
+    }(ExitCode.UnableToCreateProcessor)
   }
 
   /**
    * Tests the case when a function class:
    *   throws custom error on evaluate
    */
   @Test def test_UDFClass_CustomExceptionOnEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/",
+    )
 
     runCLI(args"parse -s $schema -r user_func2", classpath) { cli =>
       cli.send("strng", inputDone = true)
-      cli.expectErr("[error] User Defined Function 'ssudf:reverse' Error. Cause: org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse$CustomException: UDF Error!")
-      cli.expectErr("at org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse.evaluate(StringFunctionsProvider.scala:56)")
-    } (ExitCode.UserDefinedFunctionError)
+      cli.expectErr(
+        "[error] User Defined Function 'ssudf:reverse' Error. Cause: org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse$CustomException: UDF Error!",
+      )
+      cli.expectErr(
+        "at org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse.evaluate(StringFunctionsProvider.scala:56)",

Review Comment:
   Looks like this test is failing due to line numbers change from formatting. We should remove the line number from this tests. Our tests don't need to be that specific.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [daffodil] mike-mcgann commented on a diff in pull request #965: Format test and sbt files

Posted by "mike-mcgann (via GitHub)" <gi...@apache.org>.
mike-mcgann commented on code in PR #965:
URL: https://github.com/apache/daffodil/pull/965#discussion_r1107260984


##########
DEVELOP.md:
##########
@@ -138,11 +138,10 @@ run `git push` from your reading copy.
 
 ### Code Style
 
-Daffodil mandates standard Scala formatting and its code generally
-keeps close to that formatting consistently.  No one has run an
-automatic Scala formatter on the codebase yet (there has not been much
-need since the code is already formatted pretty well) but
-[DAFFODIL-2133][] is waiting for someone willing to do that work.
+Daffodil code is formatted using [Scalafmt](https://scalameta.org/scalafmt/).
+Run `sbt scalafmtCheckAll` to see if changes to the source code reqiure

Review Comment:
   Thanks. Updated. 



##########
daffodil-cli/src/it/scala/org/apache/daffodil/cliTest/TestCLIUdfs.scala:
##########
@@ -179,105 +225,159 @@ class TestCLIUdfs {
    *   has unsupported return type
    */
   @Test def test_UDFClass_noEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/java/org/badudfs/evaluate/StringFunctions/",
+    )
 
     runCLI(args"-v parse -s $schema -r user_func1", classpath) { cli =>
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.Replace." +
-        " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncA." +
-        " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncB." +
-        " Unsupported return type: void")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncC." +
-        " Unsupported parameter type(s): String[],int[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncD." +
-        " Unsupported parameter type(s): String[]")
-      cli.expectErr("[warn] User Defined Function ignored:" +
-        " org.badudfs.evaluate.StringFunctions.FuncE." +
-        " Unsupported return type: String[]")
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.Replace." +
+          " Missing evaluate method: urn:example:com:ext:badudfs:stringfunctions:replace",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncA." +
+          " Overloaded evaluate method: urn:example:com:ext:badudfs:stringfunctions:funcA",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncB." +
+          " Unsupported return type: void",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncC." +
+          " Unsupported parameter type(s): String[],int[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncD." +
+          " Unsupported parameter type(s): String[]",
+      )
+      cli.expectErr(
+        "[warn] User Defined Function ignored:" +
+          " org.badudfs.evaluate.StringFunctions.FuncE." +
+          " Unsupported return type: String[]",
+      )
       cli.expectErr("[error] Schema Definition Error: Unsupported function: jsudf:replace")
-    } (ExitCode.UnableToCreateProcessor)
+    }(ExitCode.UnableToCreateProcessor)
   }
 
   /**
    * Tests the case when a function class:
    *   throws custom error on evaluate
    */
   @Test def test_UDFClass_CustomExceptionOnEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/",
+    )
 
     runCLI(args"parse -s $schema -r user_func2", classpath) { cli =>
       cli.send("strng", inputDone = true)
-      cli.expectErr("[error] User Defined Function 'ssudf:reverse' Error. Cause: org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse$CustomException: UDF Error!")
-      cli.expectErr("at org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse.evaluate(StringFunctionsProvider.scala:56)")
-    } (ExitCode.UserDefinedFunctionError)
+      cli.expectErr(
+        "[error] User Defined Function 'ssudf:reverse' Error. Cause: org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse$CustomException: UDF Error!",
+      )
+      cli.expectErr(
+        "at org.sbadudfs.udfexceptions.evaluating.StringFunctions.Reverse.evaluate(StringFunctionsProvider.scala:56)",
+      )
+    }(ExitCode.UserDefinedFunctionError)
   }
 
   /**
    * Tests the case when a function class:
    *   throws processing error on evaluate
    */
   @Test def test_UDFClass_ProcessingErrorOnEvaluate(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions/evaluating/StringFunctions/",
+    )
 
     runCLI(args"parse -s $schema -r user_func3", classpath) { cli =>
-      cli.expectErr("[error] Schema Definition Error: User Defined Function 'ssudf:rev-words' Error: UDF PE!")
-    } (ExitCode.UnableToCreateProcessor)
+      cli.expectErr(
+        "[error] Schema Definition Error: User Defined Function 'ssudf:rev-words' Error: UDF PE!",
+      )
+    }(ExitCode.UnableToCreateProcessor)
   }
 
   /**
    * Tests the case when a function class:
    *   throws an error while being loaded
    */
   @Test def test_UDFClass_exceptionOnLoad(): Unit = {
-    val schema = path("daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd")
-    val classpath = udfClasspath("daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions2/StringFunctions/")
+    val schema = path(
+      "daffodil-udf/src/test/resources/org/apache/daffodil/udf/genericUdfSchema.xsd",
+    )
+    val classpath = udfClasspath(
+      "daffodil-udf/src/test/scala/org/sbadudfs/udfexceptions2/StringFunctions/",
+    )
 
     runCLI(args"-v parse -s $schema -r user_func3", classpath) { cli =>
-      cli.expectErr("[error] User Defined Function could not be initialized: {http://example.com/scala/udf}rev-words.")
-      cli.expectErr("Cause: org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords$CustomException: UDF Error!")
-      cli.expectErr("at org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords.<init>(StringFunctionsProvider.scala:65)")
-    } (ExitCode.UserDefinedFunctionError)
+      cli.expectErr(
+        "[error] User Defined Function could not be initialized: {http://example.com/scala/udf}rev-words.",
+      )
+      cli.expectErr(
+        "Cause: org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords$CustomException: UDF Error!",
+      )
+      cli.expectErr(
+        "at org.sbadudfs.udfexceptions2.StringFunctions.ReverseWords.<init>(StringFunctionsProvider.scala:65)",

Review Comment:
   Line numbers have been removed from the tests



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org