TeamCity: How to run SOAtest

Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

You can run Parasoft SOAtest within TeamCity by using simple integration as external command line tool.
Such integration allows to use Parasoft SOAtest’s html reports in TeamCity report-ing view.

Preparing the build steps
As TeamCity administrator add build step which will start soatestcli/soatestcli.exe.
I'm uisng command line execution (Executable with parameter) as build step

In this step following command line allows me to run SOAtest cli interface and change defaults parameters:
soatestcli.exe -data “c:\SOAtest_workspace” -config “builtin://Demo Configuration” -localsettings “c:\My_Tests\localsettings.properties” -report %system.teamcity.build.workingDir%\Reports -fail

Note: I'm using locations/configuration options which could be changed and/or parametrized:
c:\SOAtest_workspace – SOAtest working workspace
builtin://Demo Configuration - SOAtest default run configuration
c:\My_Tests\localsettings.properties - SOAtest local settings for my run
%system.teamcity.build.workingDir%\Reports – report location for SOAtest, %system.teamcity.build.workingDir% - TeamCity variable

HTML Report view
Add SOAtest’s report location in TeamCity > Build Configuration Settings > General Settings > Artifacts paths

Add additional Report Tab View for TeamCity Project > Administration > Project Settings > Report Tabs

Avoiding increasing size of artifacts from test
I'm recommending to enable option “Clean all files in the checkout directory before the build” in TeamCity. It allows to keep the most recent report after SOAtest execution in Report Tabs

Note: that additional option -fail is not mandatory, I'm using it to pass information to TeamCity system about failures during tests run, and will mark whole execution as failure if any test end with an error.

Tagged:

Comments

  • ankit_sharmaankit_sharma Posts: 8

    Hi! I have a follow up question. I have developed a test on my machine which I want to execute in the Team City which is installed on a remote server. Hence this command is working on my system:
    C:\WINDOWS\system32\cmd.exe /s /c "C:\PROGRA~1\Parasoft\SOAtest\9.9\soatestcli.exe -config "Demo Configuration" -data C:\Users\E20028326\parasoft\gcr_ut_soa -resource Basic_Test.tst"

    but not in team city as it's on remote server where SOATest is not installed hence it fails to find the following locations:
    - C:\PROGRA~1\Parasoft\SOAtest\9.9\soatestcli.exe
    - C:\Users\E20028326\parasoft\gcr_ut_soa -resource Basic_Test.tst

    What should I do in a case like this?

  • jakubiakjakubiak Posts: 353 admin
    edited June 2017

    You have some options:
    1. It appears that TeamCity has build agents that can be installed on different machines to which the TeamCity server can connect to launch builds. You could look into installing one of these agents on the same machine that SOAtest is on - see https://confluence.jetbrains.com/display/TCD10/Setting+up+and+Running+Additional+Build+Agents
    2. Install SOAtest on the same machine as TeamCity.
    3. You could start SOAtest in server mode, and then access it via the SOAtest server REST API to tell it to run your tests and get results - see the SOAtest Help topic Parasoft SOAtest User's Guide > Setup and Testing Fundamentals > Using SOAtest APIs
    4. If you have Parasoft CTP, you can create a job within CTP that executes your SOAtest tests. Then you can use the CTP REST API to trigger the tests to be run.

  • ankit_sharmaankit_sharma Posts: 8

    Thanks Jakubiak. It's good info.

  • reactancexlreactancexl Posts: 103

    another way is to create a batch file on the server that has SOATest and share out the location of the .bat file. Reference that share name on teamcity command line. \server\sharename\nameOfBatchFile

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

    @reactancexl I don't think that will work as general solution. In your batch you need to consider how you are sharing resources.

    Better is to use TeamCity Build Agents or use SOAtest in server mode as has been mentioned by @jakubiak

  • reactancexlreactancexl Posts: 103

    You still use the "build agent" on the target machine and then the .bat file is launched from the "build configuration" on TC server. thx

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

    @reactancexl Yes, if you are using build agents with batch file then fine ( batch file should allow you to run SOAtest scenario from command line.
    Suggestion: Reference that share name on teamcity command line. \server\sharename\nameOfBatchFile will not work as you are running such batch file in different environment

  • atulsharma1989atulsharma1989 Posts: 5

    while running soatestcli i am getting below error

    ERROR: Error: No valid license (MachineId: LINUX2-2a1e9754)

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

    atulsharma1989

    apparently you don't have a valid license for machine where you want to run SOAtest using command line.
    You need a license which allows you run SOAtest in cli mode (command line feature)
    If you have such license please check in User Manual how to use local settings file to provide a license.

  • atulsharma1989atulsharma1989 Posts: 5

    License issue has been has been fixed please see the following error ,

    ./soatestcli -data /root/parasoft/workspace -import /sparse/functional-tests/gcs-aws-usps-av-ss-func/ -showdetails -config "user://Example Configuration" -environment \"AWS-SND-CI\" -localsettings local-setting.ls -Zjava_home $JAVA_HOME

    soatestcli: Version 9.7.0.20140227 -- Copyright (C) 2003-2014 Parasoft Corporation
    soatestcli: Using non default java: /usr/lib/jvm/jre
    OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=160m; support was removed in 8.0
    Exception in thread "Thread-10" java.lang.IllegalStateException: Store for:env.preferences not registered
    at com.parasoft.xtest.application.api.preferences.localsettings.LocalsettingsFrameworkManager.getLSPreferenceStore(LocalsettingsFrameworkManager.java:139)
    at com.parasoft.xtest.application.api.preferences.localsettings.LocalsettingsFrameworkManager.getRegisteredPreferenceStore(LocalsettingsFrameworkManager.java:124)
    at com.parasoft.xtest.common.web.XTestServerPreferenceProvider.(XTestServerPreferenceProvider.java:33)
    at com.parasoft.xtest.common.web.XTestPreferenceProvider.getServerPreferenceProvider(XTestPreferenceProvider.java:126)
    at com.parasoft.xtest.common.web.XTestPreferenceProvider.apply(XTestPreferenceProvider.java:324)
    at com.parasoft.preferences.AppPreferenceProvider.apply(AppPreferenceProvider.java:134)
    at com.parasoft.xtest.common.web.UWebkingAppInitializer.doStartupTasksBasedOnPreferences(UWebkingAppInitializer.java:235)
    at com.parasoft.xtest.common.web.UWebkingAppInitializer.initWebApp(UWebkingAppInitializer.java:103)
    at com.parasoft.xtest.common.eclipse.core.web.CommonCoreWebPlugin$1.run(CommonCoreWebPlugin.java:52)

    where
    -import sparse/functional-tests/gcs-aws-usps-av-ss-func/ ..

    its functional test suits that i want to run .. while run the soatestcli on linux getting above error
    please suggest how can i resolve this ...

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

    atulsharma1989

    the test should run as import should be successful, despite error.
    If you want to get rid of this error, upgrade SOAtest to latest version.

  • atulsharma1989atulsharma1989 Posts: 5

    also please confirm while running soatestcli on linux what is -config parameter

    What argument i should pass while running test from command line please confirm

    Thanks,

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 149 ✭✭

    @atulsharma1989
    the -config options specifies test configuration.
    In other words it allows you to change default test execution of test scenario.
    See manual for Test Configurations

Sign In or Register to comment.