You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Dave Thompson (Jira)" <ji...@apache.org> on 2022/11/18 19:30:00 UTC

[jira] [Closed] (DAFFODIL-2381) Refactor test util to eliminate redundant windows baggage from CLI Tests

     [ https://issues.apache.org/jira/browse/DAFFODIL-2381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Thompson closed DAFFODIL-2381.
-----------------------------------

Verified the specified commit (commit 1a0954a7b67bbe6c18b9396a8ac38f952b57355f) is included in the latest pull from the daffodil repository.

Verified, via review, changes and files identified in the commit comment were implemented.

Verified the affected daffodil subproject sbt test suites executed successfully, including the new and updated tests.

Verified the nightly test schemas compile and save successfully.

Verified the nightly test suite executes successfully

> Refactor test util to eliminate redundant windows baggage from CLI Tests
> ------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2381
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2381
>             Project: Daffodil
>          Issue Type: Improvement
>          Components: Clean Ups, CLI, QA
>            Reporter: Mike Beckerle
>            Assignee: Steve Lawrence
>            Priority: Minor
>              Labels: beginner
>             Fix For: 3.5.0
>
>
> The CLI tests have lots of verbose things explicit in test after test that should be pushed into libraries so that all the tests don't have to express them over and over.
> {code:java}
>  val DAFFODIL_JAVA_OPTS = Map("DAFFODIL_JAVA_OPTS" -> "-Xms256m -Xmx2048m -Djline.terminal=jline.UnsupportedTerminal -Dfile.encoding=UTF-8")
>   //  Dubugging tests were not executing under Windows and especially under Eclipse
>   //  due to the use of a non-interactive console.
>   //  Set the DAFFODIL_JAVA_OPTS environment variable for Debugger tests to specify
>   //  the use of an unsupported terminal: -Djline.terminal=jline.UnsupportedTerminal
>   //  Also added a Java option to specify the character encoding: -Dfile.encoding=UTF-8
>   @Test def test_3385_CLI_Debugger_invalidExpressions(): Unit = {
>     val schemaFile = Util.daffodilPath("daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/charClassEntities.dfdl.xsd")
>     val inputFile = Util.daffodilPath("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input1.txt")
>     val (testSchemaFile, testInputFile) = if (Util.isWindows) (Util.cmdConvert(schemaFile), Util.cmdConvert(inputFile)) else (schemaFile, inputFile)
>     val shell = if (Util.isWindows) Util.start("", envp = DAFFODIL_JAVA_OPTS) else Util.start("")
> {code}
> All this Util.isWindows conditionalization should be pushed down into the Util libraries so that tests don't have to contain this kind of conditionalization. 
> Every test in the file where the above code is taken has this same  start:
> {code}
>     val schemaFile = Util.daffodilPath("daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/charClassEntities.dfdl.xsd")
>     val inputFile = Util.daffodilPath("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input2.txt")
>     val (testSchemaFile, testInputFile) = if (Util.isWindows) (Util.cmdConvert(schemaFile), Util.cmdConvert(inputFile)) else (schemaFile, inputFile)
> {code}
> This conditional call to Util.cmdConvert should be pushed down into Util.daffodilPath, which should probably be shortened to just Util.path. 



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