Topics

Script for launching select unit tests


Elestedt, Fredrik
 

Hi,

Being on windows, I do not have csh installed. As such I wrote a helper script to run the unit tests I needed to launch to test the IPOCSMR implementation.
I wrote this script in PowerShell Core - so it will be runnable on all platforms.

Would the community be interested in me opening a PR with this script?

Help text from the script:
<#
.SYNOPSIS
  Launch a subset of unit tests
.DESCRIPTION
  This script launches all unit tests in the specified package and subpackages.
  Additionally, a specific test class name can be given. The test class name
  must exist in the given package or one of its subpackages.
.PARAMETER Package
  JAVA package to look for tests in.
.PARAMETER TestClass
  Class name for a specific test to run.
.PARAMETER Clean
  If true, perform a 'mvn clean' before running the tests. Defaults to false.
.EXAMPLE
  . runtests.ps1 -Package jmri.jmrix -Clean:$true
.EXAMPLE
  . runtests.ps1 -Package jmri.jmrix 
.EXAMPLE
  . runtests.ps1 -Package jmri.jmrix -TestClass IpocsLightManagerTest
.NOTES
  Author: Fredrik Elestedt
  Date:   2020-09-12
#>

// Fredrik


Bob Jacobsen
 

I think this would be a good addition!

Could you add also add a mention of it to one or more of the technical web pages?

runtest.csh (the Mac/Linux one) is primarily described on help/en/html/doc/Technical/JUnit.shtml. but there are also mentions (as ways of doing things) on help/en/html/doc/Technical/XmlSchema.shtml help/en/html/doc/Technical/NewSystem.shtml help/en/html/doc/Technical/IntroStructure.shtml

Thanks!

Bob

On Sep 13, 2020, at 3:01 AM, Elestedt, Fredrik <fredrik@...> wrote:

Hi,

Being on windows, I do not have csh installed. As such I wrote a helper script to run the unit tests I needed to launch to test the IPOCSMR implementation.
I wrote this script in PowerShell Core - so it will be runnable on all platforms.

Would the community be interested in me opening a PR with this script?

Help text from the script:
<#
.SYNOPSIS
Launch a subset of unit tests
.DESCRIPTION
This script launches all unit tests in the specified package and subpackages.
Additionally, a specific test class name can be given. The test class name
must exist in the given package or one of its subpackages.
.PARAMETER Package
JAVA package to look for tests in.
.PARAMETER TestClass
Class name for a specific test to run.
.PARAMETER Clean
If true, perform a 'mvn clean' before running the tests. Defaults to false.
.EXAMPLE
. runtests.ps1 -Package jmri.jmrix -Clean:$true
.EXAMPLE
. runtests.ps1 -Package jmri.jmrix
.EXAMPLE
. runtests.ps1 -Package jmri.jmrix -TestClass IpocsLightManagerTest
.NOTES
Author: Fredrik Elestedt
Date: 2020-09-12
#>

// Fredrik

Bob Jacobsen
@BobJacobsen


Elestedt, Fredrik
 

Sure. I'll make that soon.
Right now it uses maven to run the tests. I haven't figured out which one is the preferred one by this project(?) :p
Maven seems to just be so much easier with dependency management. Gradle would be even better - but we don't have that.

// Fredrik

On Sun, 13 Sep 2020 at 20:48, Bob Jacobsen <rgj1927@...> wrote:
I think this would be a good addition!

Could you add also add a mention of it to one or more of the technical web pages?

runtest.csh (the Mac/Linux one) is primarily described on help/en/html/doc/Technical/JUnit.shtml. but there are also mentions (as ways of doing things) on help/en/html/doc/Technical/XmlSchema.shtml help/en/html/doc/Technical/NewSystem.shtml help/en/html/doc/Technical/IntroStructure.shtml

Thanks!

Bob

> On Sep 13, 2020, at 3:01 AM, Elestedt, Fredrik <fredrik@...> wrote:
>
> Hi,
>
> Being on windows, I do not have csh installed. As such I wrote a helper script to run the unit tests I needed to launch to test the IPOCSMR implementation.
> I wrote this script in PowerShell Core - so it will be runnable on all platforms.
>
> Would the community be interested in me opening a PR with this script?
>
> Help text from the script:
> <#
> .SYNOPSIS
>   Launch a subset of unit tests
> .DESCRIPTION
>   This script launches all unit tests in the specified package and subpackages.
>   Additionally, a specific test class name can be given. The test class name
>   must exist in the given package or one of its subpackages.
> .PARAMETER Package
>   JAVA package to look for tests in.
> .PARAMETER TestClass
>   Class name for a specific test to run.
> .PARAMETER Clean
>   If true, perform a 'mvn clean' before running the tests. Defaults to false.
> .EXAMPLE
>   . runtests.ps1 -Package jmri.jmrix -Clean:$true
> .EXAMPLE
>   . runtests.ps1 -Package jmri.jmrix
> .EXAMPLE
>   . runtests.ps1 -Package jmri.jmrix -TestClass IpocsLightManagerTest
> .NOTES
>   Author: Fredrik Elestedt
>   Date:   2020-09-12
> #>
>
> // Fredrik

Bob Jacobsen
rgj1927@...








danielb987
 

Hi,

That script may be useful.

A simple way to test all tests in a package, that works on Windows, is:

mvn test -Dtest="jmri.jmrit.beantable.LogixNGTableActionTest,jmri.jmrit.logixng.**.*Test"

This command runs all the *Test classes in the packages jmri.jmrit.logixng and it's sub packages, and the test jmri.jmrit.beantable.LogixNGTableActionTest.

Daniel

2020-09-13 12:01 skrev Elestedt, Fredrik:

Hi,
Being on windows, I do not have csh installed. As such I wrote a
helper script to run the unit tests I needed to launch to test the
IPOCSMR implementation.
I wrote this script in PowerShell Core - so it will be runnable on all
platforms.
Would the community be interested in me opening a PR with this script?
Help text from the script:
<#
.SYNOPSIS
Launch a subset of unit tests
.DESCRIPTION
This script launches all unit tests in the specified package and
subpackages.
Additionally, a specific test class name can be given. The test
class name
must exist in the given package or one of its subpackages.
.PARAMETER Package
JAVA package to look for tests in.
.PARAMETER TestClass
Class name for a specific test to run.
.PARAMETER Clean
If true, perform a 'mvn clean' before running the tests. Defaults to
false.
.EXAMPLE
. runtests.ps1 -Package jmri.jmrix -Clean:$true
.EXAMPLE
. runtests.ps1 -Package jmri.jmrix
.EXAMPLE
. runtests.ps1 -Package jmri.jmrix -TestClass IpocsLightManagerTest
.NOTES
Author: Fredrik Elestedt
Date: 2020-09-12
#>
// Fredrik
Links:
------
[1] https://jmri-developers.groups.io/g/jmri/message/4368
[2] https://groups.io/mt/76816870/1303822
[3] https://jmri-developers.groups.io/g/jmri/post
[4] https://jmri-developers.groups.io/g/jmri/editsub/1303822
[5] https://jmri-developers.groups.io/g/jmri/leave/defanged


Bob Jacobsen
 

runtest.csh was originally a variant of the regular launcher script that would run a specific class via the jmri.util.junit.TestClassMainMethod class.

For reasons I don’t understand, it now runs through a .run.sh file that’s created by Ant. I’m not sure whether that can go back to the simpler form.

At least for my purposes, ./runtest.csh has substantial advantages over the man approach. First, it’s a lot easier to type. I copy the name of what I want to run and go:

./ru(tab)(paste)(return)

Second, it’s substantially faster. On my MacBook Pro 16, the times are 23 seconds for mvn and 1.2 second (not a typo) for ./runtest.csh to invoke something small like i.e. jmri.BundleTest

Finally, working from Terminal on the Mac, the verbosity of Maven makes it harder to look back through the terminal buffer.

===============

% ./runtest.csh jmri.BundleTest
Sep 13, 2020 8:04:04 PM org.junit.platform.launcher.core.LauncherConfigurationParameters fromClasspathResource
INFO: Loading JUnit Platform configuration parameters from classpath resource [file:/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/test-classes/junit-platform.properties].
log4j:WARN No appenders could be found for logger (com.tngtech.archunit.ArchConfiguration).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Test run finished after 64 ms
[ 4 containers found ]
[ 0 containers skipped ]
[ 4 containers started ]
[ 0 containers aborted ]
[ 4 containers successful ]
[ 0 containers failed ]
[ 6 tests found ]
[ 0 tests skipped ]
[ 6 tests started ]
[ 0 tests aborted ]
[ 6 tests successful ]
[ 0 tests failed ]


===============

% mvn test -Dtest="jmri.BundleTest"
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< org.jmri:jmri >----------------------------
[INFO] Building JMRI 4.21.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:timestamp-property (timestamp-property) @ jmri ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-maven) @ jmri ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (prepare-agent) @ jmri ---
[INFO] surefire.argLine set to -javaagent:/Users/jake/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-unit.exec,append=true
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (prepare-agent-integration) @ jmri ---
[INFO] failsafe.argLine set to -javaagent:/Users/jake/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-it.exec,append=true
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties (default) @ jmri ---
[INFO]
[INFO] --- javacc-maven-plugin:2.6:jjtree-javacc (default) @ jmri ---
[INFO] Skipping - all parsers are up to date
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-metadata (generate) @ jmri ---
[INFO] ShortRevision tag detected. The value is '7'.
[INFO] Executing: /bin/sh -c cd '/Users/jake/Documents/Trains/JMRI/projects/JMRI' && 'git' 'rev-parse' '--verify' '--short=7' 'HEAD'
[INFO] Working directory: /Users/jake/Documents/Trains/JMRI/projects/JMRI
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jmri ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2522 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jmri ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-test-source (add-test-source) @ jmri ---
[INFO] Test Source directory: /Users/jake/Documents/Trains/JMRI/projects/JMRI/java/acceptancetest/step_definitions added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jmri ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 518 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ jmri ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ jmri ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running jmri.BundleTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 s - in jmri.BundleTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:merge (post-test-merge) @ jmri ---
[INFO] Loading execution data file /Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco.exec
[INFO] Loading execution data file /Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-unit.exec
[INFO] Writing merged execution data to /Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco.exec
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.635 s
[INFO] Finished at: 2020-09-13T20:03:47-07:00
[INFO] ————————————————————————————————————


===============


I don’t work on Windows, so this please feel free to build whatever test launch approach that seems best, but I think there’s a lot to say to the “use the standard launcher and the mri.util.junit.TestClassMainMethod class” approach.

Bob



Bob Jacobsen
@BobJacobsen


danielb987
 

I think the main reason for why maven is slow is that it always recompiles the code. If I remember it correctly, it was Randall W who wanted that, while others argued against it. Now then Randall has left the JMRI organisation, maybe it's time to vote about if maven should always recompile or not. I see benefit of both cases, both for always recompile and for not always recompile. But since it's easy to clean the project, for example after a merge from upstream/master into my branch, it may be time to reverse that setting to not compile everything.

Daniel

2020-09-14 05:10 skrev Bob Jacobsen:

runtest.csh was originally a variant of the regular launcher script
that would run a specific class via the
jmri.util.junit.TestClassMainMethod class.
For reasons I don’t understand, it now runs through a .run.sh file
that’s created by Ant. I’m not sure whether that can go back to the
simpler form.
At least for my purposes, ./runtest.csh has substantial advantages
over the man approach. First, it’s a lot easier to type. I copy the
name of what I want to run and go:
./ru(tab)(paste)(return)
Second, it’s substantially faster. On my MacBook Pro 16, the times are
23 seconds for mvn and 1.2 second (not a typo) for ./runtest.csh to
invoke something small like i.e. jmri.BundleTest
Finally, working from Terminal on the Mac, the verbosity of Maven
makes it harder to look back through the terminal buffer.
===============
% ./runtest.csh jmri.BundleTest
Sep 13, 2020 8:04:04 PM
org.junit.platform.launcher.core.LauncherConfigurationParameters
fromClasspathResource
INFO: Loading JUnit Platform configuration parameters from classpath
resource
[file:/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/test-classes/junit-platform.properties].
log4j:WARN No appenders could be found for logger
(com.tngtech.archunit.ArchConfiguration).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.
Test run finished after 64 ms
[ 4 containers found ]
[ 0 containers skipped ]
[ 4 containers started ]
[ 0 containers aborted ]
[ 4 containers successful ]
[ 0 containers failed ]
[ 6 tests found ]
[ 0 tests skipped ]
[ 6 tests started ]
[ 0 tests aborted ]
[ 6 tests successful ]
[ 0 tests failed ]
===============
% mvn test -Dtest="jmri.BundleTest"
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< org.jmri:jmri
----------------------------
[INFO] Building JMRI 4.21.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:timestamp-property
(timestamp-property) @ jmri ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-maven) @ jmri ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (prepare-agent) @ jmri ---
[INFO] surefire.argLine set to
-javaagent:/Users/jake/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-unit.exec,append=true
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent
(prepare-agent-integration) @ jmri ---
[INFO] failsafe.argLine set to
-javaagent:/Users/jake/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-it.exec,append=true
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties
(default) @ jmri ---
[INFO]
[INFO] --- javacc-maven-plugin:2.6:jjtree-javacc (default) @ jmri ---
[INFO] Skipping - all parsers are up to date
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-metadata (generate) @ jmri ---
[INFO] ShortRevision tag detected. The value is '7'.
[INFO] Executing: /bin/sh -c cd
'/Users/jake/Documents/Trains/JMRI/projects/JMRI' && 'git' 'rev-parse'
'--verify' '--short=7' 'HEAD'
[INFO] Working directory: /Users/jake/Documents/Trains/JMRI/projects/JMRI
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jmri ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2522 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jmri ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-test-source
(add-test-source) @ jmri ---
[INFO] Test Source directory:
/Users/jake/Documents/Trains/JMRI/projects/JMRI/java/acceptancetest/step_definitions
added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources
(default-testResources) @ jmri ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 518 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile
(default-testCompile) @ jmri ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ jmri ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running jmri.BundleTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
0.035 s - in jmri.BundleTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:merge (post-test-merge) @ jmri ---
[INFO] Loading execution data file
/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco.exec
[INFO] Loading execution data file
/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-unit.exec
[INFO] Writing merged execution data to
/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco.exec
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.635 s
[INFO] Finished at: 2020-09-13T20:03:47-07:00
[INFO] ————————————————————————————————————
===============
I don’t work on Windows, so this please feel free to build whatever
test launch approach that seems best, but I think there’s a lot to say
to the “use the standard launcher and the
mri.util.junit.TestClassMainMethod class” approach.
Bob

Bob Jacobsen
@BobJacobsen


Elestedt, Fredrik
 

Hi,

Bob, to get the equivalent of that - you could run maven with the --quiet option (-q for short). It will only print errors then.
Also, maven uses SLF4j for logging, so default log level can be changed in or  ${MAVEN_HOME}/conf/logging/simplelogger.properties via MAVEN_OPTS

But I can't disagree that it's slower and more verbose by default. It's just so much easier to work with when it comes to dependency management...
The biggest upside that you don't have to keep a local copy of all dependencies - it just downloads them on the fly.

// Fredrik


On Mon, 14 Sep 2020 at 05:11, Bob Jacobsen <rgj1927@...> wrote:
runtest.csh was originally a variant of the regular launcher script that would run a specific class via the jmri.util.junit.TestClassMainMethod class.

For reasons I don’t understand, it now runs through a .run.sh file that’s created by Ant.  I’m not sure whether that can go back to the simpler form.

At least for my purposes, ./runtest.csh has substantial advantages over the man approach. First, it’s a lot easier to type. I copy the name of what I want to run and go:

./ru(tab)(paste)(return)

Second, it’s substantially faster. On my MacBook Pro 16, the times are 23 seconds for mvn and 1.2 second (not a typo) for ./runtest.csh to invoke something small like i.e. jmri.BundleTest

Finally, working from Terminal on the Mac, the verbosity of Maven makes it harder to look back through the terminal buffer.

===============

% ./runtest.csh jmri.BundleTest   
Sep 13, 2020 8:04:04 PM org.junit.platform.launcher.core.LauncherConfigurationParameters fromClasspathResource
INFO: Loading JUnit Platform configuration parameters from classpath resource [file:/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/test-classes/junit-platform.properties].
log4j:WARN No appenders could be found for logger (com.tngtech.archunit.ArchConfiguration).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Test run finished after 64 ms
[         4 containers found      ]
[         0 containers skipped    ]
[         4 containers started    ]
[         0 containers aborted    ]
[         4 containers successful ]
[         0 containers failed     ]
[         6 tests found           ]
[         0 tests skipped         ]
[         6 tests started         ]
[         0 tests aborted         ]
[         6 tests successful      ]
[         0 tests failed          ]


===============

% mvn test -Dtest="jmri.BundleTest"       
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< org.jmri:jmri >----------------------------
[INFO] Building JMRI 4.21.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:timestamp-property (timestamp-property) @ jmri ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-maven) @ jmri ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (prepare-agent) @ jmri ---
[INFO] surefire.argLine set to -javaagent:/Users/jake/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-unit.exec,append=true
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (prepare-agent-integration) @ jmri ---
[INFO] failsafe.argLine set to -javaagent:/Users/jake/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-it.exec,append=true
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties (default) @ jmri ---
[INFO]
[INFO] --- javacc-maven-plugin:2.6:jjtree-javacc (default) @ jmri ---
[INFO] Skipping - all parsers are up to date
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-metadata (generate) @ jmri ---
[INFO] ShortRevision tag detected. The value is '7'.
[INFO] Executing: /bin/sh -c cd '/Users/jake/Documents/Trains/JMRI/projects/JMRI' && 'git' 'rev-parse' '--verify' '--short=7' 'HEAD'
[INFO] Working directory: /Users/jake/Documents/Trains/JMRI/projects/JMRI
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jmri ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2522 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jmri ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-test-source (add-test-source) @ jmri ---
[INFO] Test Source directory: /Users/jake/Documents/Trains/JMRI/projects/JMRI/java/acceptancetest/step_definitions added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jmri ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 518 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ jmri ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ jmri ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running jmri.BundleTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 s - in jmri.BundleTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:merge (post-test-merge) @ jmri ---
[INFO] Loading execution data file /Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco.exec
[INFO] Loading execution data file /Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco-unit.exec
[INFO] Writing merged execution data to /Users/jake/Documents/Trains/JMRI/projects/JMRI/target/jacoco.exec
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.635 s
[INFO] Finished at: 2020-09-13T20:03:47-07:00
[INFO] ————————————————————————————————————


===============


I don’t work on Windows, so this please feel free to build whatever test launch approach that seems best, but I think there’s a lot to say to the “use the standard launcher and the mri.util.junit.TestClassMainMethod class” approach.

Bob



Bob Jacobsen
rgj1927@...








Bob Jacobsen
 

On Sep 13, 2020, at 11:48 PM, Elestedt, Fredrik <fredrik@...> wrote:
But I can't disagree that it's slower and more verbose by default. It's just so much easier to work with when it comes to dependency management...
The biggest upside that you don't have to keep a local copy of all dependencies - it just downloads them on the fly.
Reasonable people can differ on whether those are features or not. I think the downloading is actually a bug.

Back in the old pre-COVID days, I was burned multiple times by being on an airplane, switching to a different branch, and having not-pre-downloaded content that Maven insisted it needed. There’s a _lot_ to be said for doing dependency management by “This particular SHA needs these files, and they’re included”.

Yes, the JMRI checkout is bigger, but those bytes have to be _somewhere_, and most people aren’t; developing multiple Java applications that use the same jar files.

Bob

Bob Jacobsen
@BobJacobsen