App Connect

 View Only
Expand all | Collapse all

IntegrationServer --test-project JUnit results formatting

  • 1.  IntegrationServer --test-project JUnit results formatting

    Posted Wed January 26, 2022 08:53 AM
    Hey all,

    When you run tests with "--test-project" is there any option to specify the output format and location for the results ?

    When maven runs tests, surefire and safefire allow you to produce test reports in different formats:
    JUnit Report Generation Example
    Examples Java Code Geeks remove preview
    JUnit Report Generation Example
    In this example we shall show users how we can generate reports using the Maven and JUnit. JUnit Report Generation example demonstrates the basic usage of the reporting functionality of JUnit tests. As you already know, JUnit is the basic unit test framework for the Java programmers.
    View this on Examples Java Code Geeks >

    Are there any options with the "IntegrationServer" command ?



    ------------------------------
    Richard Huegill
    ------------------------------


  • 2.  RE: IntegrationServer --test-project JUnit results formatting

    Posted Wed February 02, 2022 11:10 AM
    Hello Richard,

     There are no configurable options at the moment, but this has come up in the past; the easiest way for ACE to do this would be to enable the standard JUnit5 options with a command-line parameter on IntegrationServer, but I'm not sure if that would give you everything you want.

    The JUnit5 "--reports-dir" option (see https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher-options) produces the Jenkins-standard XML format, which contains everything that's needed for the reporting and trend graphs and so on produced by Jenkins, and that could probably be made to work with IntegrationServer (no promises, of course!). There's an output example at https://help.catchsoftware.com/display/ET/JUnit+Format for reference on what that would look like.

    Maven's surefire plugin runs a different launcher (as far as I can tell) and so has other options like HTML output, but that would be harder to integrate into IntegrationServer because it's a custom launcher that might have a lot of assumptions built in.

    Would the Jenkins-style reports be
    a) useful, and
    b) sufficient?



  • 3.  RE: IntegrationServer --test-project JUnit results formatting

    Posted Fri September 23, 2022 10:22 AM
    Edited by Trevor Dolby Thu November 10, 2022 05:05 PM
    Hello @Richard Huegill ,

     ACE v12 does now have the option to add JUnit options when running tests: you can add
    --test-junit-options "--reports-dir=/tmp/reports-dir"
    to the run line and the server will create XML files in the specified directory.

    To verify this using 12.0.5, I just cloned https://github.com/tdolby-at-uk-ibm-com/ace-demo-sap-unittest and ran the build-and-ut.sh command in that repo, which creates a work directory and runs the tests. Those passed, so I then ran the test project again with the extra arguments for the IntegrationServer:
    IntegrationServer -w /tmp/ace-demo-sap-work-dir --mq-queue-manager-name dummy --start-msgflows false --no-nodejs --admin-rest-api -1 --test-project SAPApplication_UnitTest --test-junit-options "--reports-dir=/tmp/reports-dir"
    and it created a couple of XML files:
    tdolby@IBM-LAPTOP:~/github.com/ace-demo-sap-unittest$ ls -l /tmp/reports-dir/*
    -rw-rw---- 1 tdolby tdolby 12626 Sep 22 16:56 /tmp/reports-dir/TEST-junit-jupiter.xml
    -rw-rw---- 1 tdolby tdolby 10937 Sep 22 16:56 /tmp/reports-dir/TEST-junit-vintage.xml

    Other options also work, including --config=junit.jupiter.execution.timeout.default=1ns, --include-package=other, --include-tag=firstTag, --include-classname=.+somestring.+ and the exclude variants, plus other options.
    ​​

    ------------------------------
    Trevor Dolby
    ------------------------------