SOAP UI Tests are running long time from jenkins - batch-file

I am trying to integrate my Jenkins with SOAP UI through Ant.
Below is my build.xml file.
<project name="RegressionTests" default="soapui-tests" basedir=".">
<description>Run the soapUI Regression Tests</description>
<!-- <property file="build.properties"/> -->
<property name="soapUITest.home" value="C:\Regression_Test"/>
<property name="SOAP_UI_PROJ_FILE" value="${SOAP_UI_PROJ_FILE}" />
<property name="SOAP_UI_TEST_SUITE" value="${SOAP_UI_TEST_SUITE}" />
<property name="SOAP_UI_TEST_CASE" value="${SOAP_UI_TEST_CASE}" />
<property name="SOAP_UI_TEST_REPORT" value="${SOAP_UI_TEST_REPORT}" />
<target name="checkos">
<condition property="testrunner.cmd" value="${soapUITest.home}\bin\testrunner.bat">
<os family="windows" />
</condition>
</target>
<target name="soapui-tests" depends="checkos">
<exec executable="${testrunner.cmd}"
failonerror="yes"
failifexecutionfails="yes" >
<arg value="${SOAP_UI_PROJ_FILE}"/>
<arg value="${SOAP_UI_TEST_SUITE}"/>
<arg value="${SOAP_UI_TEST_CASE}"/>
<arg value="${SOAP_UI_TEST_REPORT}"/>
</exec>
</target>
</project>
Now testrunner.bat calls SOAPUI testrunner batch file.
#echo off
set SOAP_UI_PROJ_FILE=%1
set SOAP_UI_TEST_SUITE=%2
set SOAP_UI_TEST_CASE=%3
set SOAP_UI_TEST_REPORT=%4
#echo off
set RESOURCE_HOME="C:\Regression_Test\resources"
set SOAP_UI_RESOURCE_FILE="%RESOURCE_HOME%/%SOAP_UI_PROJ_FILE%"
"C:\Program Files\SmartBear\SoapUI-5.2.1\bin\testrunner.bat" -s%SOAP_UI_TEST_SUITE% -c%SOAP_UI_TEST_CASE% -r -a -f"%SOAP_UI_TEST_REPORT%" %SOAP_UI_RESOURCE_FILE%
While I try to run from Jenkins
I see below SOAP UI is running for indefinite time but no error
Jenkins Log
I ran the same from command line argument and completed within seconds.
Can anyone suggest why the SOAPUI tests are running indefinitely in Jenkins
Thanks,
Ayan Bhattacharyya

I had the same issue. Check where the soapui-settings is being loaded from. When I ran from Jenkins, it was looking at C:\soapui-settings.xml which does not exist, as compared to running from the command prompt which was pointing to the correct file. After copying soapui-settings.xml to the C:\ drive, the Jenkins build completed successfully. Hope this helps.
11:42:45,088 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\soapui-settings.xml]

Related

Run npm, ng commands using Ant script on Windows, "The system cannot find the file specified" error

When I try to run the following Ant script, which executes the "npm" command:
<target name ="test">
<exec executable="npm" failonerror="true">
<arg value="install" />
</exec>
</target>
It fails with this error:
Execute failed: java.io.IOException: Cannot run program "npm"
(in directory "C:\Development\workspace\traqpath\WebSource"):
CreateProcess error=2, The system cannot find the file specified
The same happens when I try to run the Angular-CLI "ng" command:
<target name ="test">
<exec executable="ng" failonerror="true">
<arg value="build"/>
<arg value="--prod"/>
<arg value="--bh"/>
</exec>
</target>
With the same error message, but for "ng":
Execute failed: java.io.IOException: Cannot run program "ng"
(in directory "C:\Development\workspace\traqpath\WebSource"):
CreateProcess error=2, The system cannot find the file specified
Both commands run without problems in the Windows Command Line, which means NodeJS installation is right, and NodeJS path is properly configured in the PATH system variable.
I solved the problem by modifying the Ant script to specify the full name of the "npm" executable, (and the "ng" command in the second case):
My new Ant Scripts look like this now:
<target name ="test">
<exec executable="npm.cmd" failonerror="true">
<arg value="install" />
</exec>
</target>
<target name ="test">
<exec executable="ng.cmd" failonerror="true">
<arg value="build"/>
<arg value="--prod"/>
<arg value="--bh"/>
</exec>
</target>
Notice that I used "npm.cmd" instead of "npm", and "ng.cmd" instead of "ng".
I solved it similar to your solution, except I invoked "npm build" which is included by default in the package.json under "scripts" section.
<target name="build_windows">
<exec executable="npm.cmd" failonerror="true">
<arg value="run-script"/>
<arg value="build"/>
</exec>
</target>
I even introduced another npm script line similar to "build" named "buildprod" like this:
"scripts": {
"build": "ng build -bh /context/",
"buildprod": "ng build --prod --aot -bh /context/"
}
And then introduced a similar target in my ant build.xml file for the production build something like this:
<target name="build_prod_windows">
<exec executable="npm.cmd" failonerror="true">
<arg value="run-script"/>
<arg value="buildprod"/>
</exec>
</target>
That way, you can keep the same ant script in other angular projects, and don't have to worry about keeping different arguments in your build.xml file. Instead, you'll need to ensure your package.json has correct scripts.
<target name ="test">
<exec executable="ng" failonerror="true">
<arg value="build"/>
<arg value="--prod"/>
<arg value="--bh"/>
</exec>
</target>
When i try to run in linux , its again give the same error, saying
Execute failed: java.io.IOException: Cannot run program "ng" ....
How to run in linux env through ANT

Config file Ignite discovery in zeppelin, config xml not working even after IgniteConfiguration bean is present

I am using zookeeper based discovery for ignite cluster and ignite nodes are getting properly connected.
When i am setting same config.xml file in zeppelin ignite interpreter in , I am not able to run the ignite. it fails with below exception.
It gives me below error on zepplin:
Failed to find configuration in: file:////tmp/shared.xml
Failed to find configuration in: file:////tmp/shared.xml
Exception details: please click this link
ignite_client.xml i am using:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="clientMode" value="true"/>
<property name="peerClassLoadingEnabled" value="false"/>
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder">
<property name="zkConnectionString" value="zookeeper:2181"/>
</bean>
</property>
</bean>
</property>
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="testcache"/>
<property name="startSize" value="10"/>
</bean>
</list>
</property>
</bean>
I saw the Ignite code and found that its failing because spring bean is not found of type IgniteConfiguration, but in xml it is actually present as can be seen in shared xml above.
Analysis so far
Debugged zeppelin and Ignite code and verified correct xml file is passed to ignite.start
Verified even content of file tobe double sure by reading inputStream and file content is correct , inputStream is from org.springframework.beans.factory.xml.XmlBeanDefinitionReader#loadBeanDefinitions(org.springframework.core.io.support.EncodedResource)
On further debug verified that beanDefinitionMap in ApplicationContext contains IgniteConfiguration, attaching snapshot
Tried getting bean by name , it works ... instead of cfgMap = springCtx.getBeansOfType(cls); in org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl#loadConfigurations(java.net.URL, java.lang.Class, java.lang.String...)
For sake of trial I used sprintContext.getBean(), assuming it would run, but its getting weired , I got below class cast exception
After analysis so far, only thing I can understand is some how IgniteConfiguration loaded by diff classloader is causing issue, but dont know why its happening
Debugged further and confirmed, it is because IgniteConfiguration loaded by different class loader, one loaded already was from sun.misc.Launcher.AppClassLoader#AppClassLoader and in sprinContext IgnitConfiguration bean present is loded by scala.reflect.internal.util.ScalaClassLoader and that is why the error "Failed to find configuration in: file:////tmp/shared.xml"
Logically I can think it as spark program is scala code and spring bean loaded at runtime that is why this mismatch
Is this normal ?
I tried your configuration and it works for me. Did you have another version of the file before? If so, I think it was not updated properly, because the only way to get this exception is having valid Spring XML file, but without IgniteConfiguration bean.
Are you sure you actually use the correct file? Can this be caused by the fact that you have it in /tmp folder?

How to write Nant script for publish the code and it should use sql server authentication

I am successful in writing the Nant script to Publish the code for Database.
<project name="Local-Deploy" basedir="." default="publish_code">
<property name="MSBuildPath" value="C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"/>
<property name="Solution_file_path" value="xxx.WebUI/xxxWebUI.csproj"/>
<property name="Published_path" value="C:\demo\Publish_code"/>
<target name="publish_code">
<exec program="${MSBuildPath}">
<arg line='"${Solution_file_path}"'/>
<arg line='/property:Configuration="TEST";DeployOnBuild=true;PublishProfile=Local-Deploy;_PackageTempDir=${Published_path}'/>
<arg value="/target:Build" />
</exec>
</target>
</project>
How can I write Nant script for publish the code to target Database connection should be xxx.amazonaws.com and it should use SQL server authentication with username XXX and Password xxx.
Please suggest me.
Thanks is advance. :)
As per : Using NAnt to deploy the database:
<target name="test">
<property name="test.script" value="${dir.sql}/test.sql"/>
<property name="test.connstring"
value="Provider=SQLOLEDB;Server=localhost;Database=nHello;User ID=nHelloUser;Password=showme"/>
<echo file="${test.script}" message="execute p_GetMessage;"/>
<echo message="* Connecting to ${test.connstring}"/>
<echo message="* Executing ${path::get-file-name(test.script)}"/>
<sql connstring="${test.connstring}" delimiter=";" delimstyle="Normal" source="${test.script}"/>
</target>

What's the best way to handle authentication when deploying app engine apps from Hudson/Jenkins?

I'm able to deploy my App Engine project from the command line using appcfg.sh without a problem. I'd like to get this to work in Jenkins but the problem is the deploy utility prompts for my Google password. I can pass in the email using the --email parameter but there's no way to pass in the password (please don't suggest using --passin b/c that's not what it's for).
The best case senario I can think of is that when someone runs the Jenkins job it asks for the username/password then and runs the deploy using that.
But I'd settle for any way to get it working at this point. Thanks.
If you don't mind your password to be visible in plaintext, this is what I use on my build XML to auto-deploy my app from Jenkins:
<target name="update"
depends="enhance"
description="Uploads the application, including indexes">
<java classname="com.google.appengine.tools.admin.AppCfg"
inputstring="<YOUR_PASSWORD>"
classpath="${appengine.sdk}\lib\appengine-tools-api.jar">
<classpath>
<fileset dir="${war.dir}/WEB-INF/lib" includes="**/*.jar" />
</classpath>
<arg value="--email=<YOUR_EMAIL>" />
<arg value="--passin" />
<arg value="update" />
<arg value="war" />
</java>
</target>
Where appengine.sdk points to your GAE folder, i.e.
<property name="appengine.sdk" location="D:\libs\appengine-java-sdk-1.5.1"/>.

Arquillian and Tomcat6 issue

I have two questions regarding Arquillian and Tomcat:
-My arquillian tests fail with the following error message:
org.jboss.jsfunit.example.hellojsf.HelloJSFTest Time elapsed: 0 sec
<<< ERROR! org.jboss.arquillian.container.spi.ConfigurationException:
Unable to connect to Tomcat manager. The server command
(/deploy?path=%2Ftest) failed with responseCode (401) and
responseMessage (Non-Autorisé). Please make sure that you provided
correct credentials to an user which is able to access Tomcat manager
application. These credentials can be specified in the Arquillian
container configuration as "user" and "pass" properties. The user must
have appripriate role specified in tomcat-users.xml file.
FYI my arquillian.xml file is as follows:
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
<engine>
<property name="deploymentExportPath">target/</property>
<property name="jmxPort">8099</property>
<property name="user">admin</property>
<property name="pass">admin75</property>
</engine>
<defaultProtocol type="Servlet 2.5" />
<container qualifier="tomcat-remote">
<configuration>
<property name="jmxPort">8099</property>
<property name="user">admin</property>
<property name="pass">admin75</property>
</configuration>
</container>
</arquillian>
I am trying to adapt the sample app for tomcat 6. Can anyone please help?
-When will Arquillian support tomcat 7?
Regards,
J.
tomcat-users.xml:
<tomcat-users>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="admin" password="admin75" roles="manager,admin"/>
</tomcat-users>
This message
Unable to connect to Tomcat manager. The server command (/deploy?path=%2Ftest) failed with responseCode (401) and responseMessage (Non-Autorisé).
indicates that one of the following is true:
the tomcat-users.xml file used by your Tomcat installation does not have the admin user (that you've specified in arquillian.xml),
or the admin user is not mapped to the manager role in Tomcat 6, or the manager-script role in Tomcat 7.
When will Arquillian support tomcat 7?
Arquillian supports Tomcat 7, as an emebedded or a managed container. The documentation is not up to date (as of now), but the configuration parameters are more or less the same as the embedded and managed equivalents in Tomcat 6. The artifact Id to use for
a managed Tomcat 7 instance is org.jboss.arquillian.container:arquillian-tomcat-managed-7.
an embedded Tomcat 7 instance is org.jboss.arquillian.container:arquillian-tomcat-embedded-7.
As of today, 1.0.0.CR2 is the latest stable release. You can use 1.0.0.Final-SNAPSHOT, if you want to work against the development build.
Also, you can omit several redundant properties from your arquillian.xml file. A cleaner configuration would look like:
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
<engine>
<property name="deploymentExportPath">target/</property>
</engine>
<container qualifier="tomcat-remote">
<configuration>
<property name="jmxPort">8099</property>
<property name="user">admin</property>
<property name="pass">admin75</property>
</configuration>
</container>
</arquillian>

Resources