GithubHelp home page GithubHelp logo

xebialabs-community / xld-smoke-test-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.0 40.0 1.0 1.16 MB

The Smoke Tests plugin is an XL Deploy plugin that triggers http requests at the end of the deployment task.

Home Page: http://xebialabs.com/

License: MIT License

PowerShell 17.12% FreeMarker 72.15% Shell 10.73%
wget xld xldeploy healthcheck smoketest

xld-smoke-test-plugin's Introduction

Smoke Test plugin

Build Status Codacy Badge Code Climate License: MIT Github All Releases

Overview

The Smoke Test plugin is an XL Deploy plugin that triggers http requests at the end of the deployment task. It uses either wget executable file (Unix / Windows) or Invoke-WebRequest PowerShell cmdlet (Windows).

Requirements

  • XL Deploy requirements
    • XL Deploy: version 6.0.+

Installation

Place the plugin xldp file into your SERVER_HOME/plugins directory.

Usage

A smoketest.Runner CI is a container from which the test will be performed.

3 Deployables are provided that will be deployed onto a smoketest.Runner

  • smoketest.HttpRequestTest for a HTTP request using the GET verb
  • smoketest.HttpPostRequestTest for a HTTP request using the POST verb
  • smoketest.HttpPostRequestFileTest for a HTTP request using the POST verb and a file that contains the post data.

Expected and Unexpected text

You can specify what text you expect to be in the response, like version numbers. And/or you can specify the text that should not be in the response, like error statements.

Note

On Unix hosts, the plugin will use wgetthat should be already installed. On Windows hosts, there are 2 options

  • use a version of wget bundled in the plugin and uploaded to perform the http request. (default option)
  • use a PowerShell implementation. To activate this option you need to ** enable the property powershellInstalledon thesmoketest.Runner` ** install PowerShell v3+ on the remote Windows Host.

If you wish to use a different wget that is already present on the path of your target systems you can simply prevent the included version from being uploaded by modifying SERVER_HOME/conf/deployit-defaults.properties as follows:

# Classpath Resources
# smokeTest.ExecutedHttpRequestTest.classpathResources=smoketest/runtime/wget.exe

to

# Classpath Resources
smokeTest.ExecutedHttpRequestTest.classpathResources=

XLD Smoke Test plugin in action

Sample App

xl apply --xl-deploy-url http://localhost:4540 -f xebialabs.yaml

[1/4] Applying infrastructure.yaml (imported by xebialabs.yaml)
    Created CI Infrastructure/xld-smoke-test/localhost/test runner
    Created CI Infrastructure/xld-smoke-test/localhost
    Created CI Infrastructure/xld-smoke-test

[2/4] Applying environments.yaml (imported by xebialabs.yaml)
    Created CI Environments/xld-smoke-test/dev
    Created CI Environments/xld-smoke-test/dev.conf
    Created CI Environments/xld-smoke-test

[3/4] Applying applications.yaml (imported by xebialabs.yaml)
    Created CI Applications/xld-smoke-test/postcodes.io/1.0/manual test
    Created CI Applications/xld-smoke-test/postcodes.io/1.0/get
    Created CI Applications/xld-smoke-test/postcodes.io/1.0/post file
    Created CI Applications/xld-smoke-test/postcodes.io/1.0/post
    Created CI Applications/xld-smoke-test/postcodes.io/1.0
    Created CI Applications/xld-smoke-test/postcodes.io
    Created CI Applications/xld-smoke-test

[4/4] Applying xebialabs.yaml
Done
``

xld-smoke-test-plugin's People

Contributors

bastiaanb avatar cvandenthillart avatar jdewinne avatar ndebuhr avatar paulvanderende avatar vlussenburg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bastiaanb

xld-smoke-test-plugin's Issues

DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]

Dear All,

When i use this plugin i get the following error when i try to deploy an application with the xldeploy jenkins plugin 7.5.5 on XL Deploy version 8.0.8:

hudson.remoting.ProxyException: java.lang.IllegalArgumentException: DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
	at com.xebialabs.deployit.booter.remote.RemoteDescriptorRegistry._getDescriptor(RemoteDescriptorRegistry.java:56)
	at com.xebialabs.deployit.plugin.api.reflect.DescriptorRegistry.getDescriptor(DescriptorRegistry.java:128)
	at com.xebialabs.deployit.plugin.api.reflect.Type.getDescriptor(Type.java:64)
	at com.xebialabs.xltype.serialization.ConfigurationItemConverter.readCi(ConfigurationItemConverter.java:194)
	at com.xebialabs.xltype.serialization.xstream.XStreamCiConverter.unmarshal(XStreamCiConverter.java:30)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
Caused: hudson.remoting.ProxyException: com.thoughtworks.xstream.converters.ConversionException: DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest] : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
---- Debugging information ----
message             : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
cause-exception     : java.lang.IllegalArgumentException
cause-message       : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
class               : com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
required-type       : com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
converter-type      : com.xebialabs.deployit.booter.remote.xml.RemoteXStreamCiConverter
path                : /deployment/deployeds/smoketest.ExecutedHttpRequestTest
line number         : 16
class[1]            : com.xebialabs.deployit.engine.api.dto.Deployment
converter-type[1]   : com.xebialabs.xltype.serialization.xstream.DeploymentConverter
version             : not available
-------------------------------
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
	at com.xebialabs.xltype.serialization.xstream.Converters.readList(Converters.java:21)
	at com.xebialabs.xltype.serialization.xstream.DeploymentConverter.unmarshal(DeploymentConverter.java:83)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
	at com.xebialabs.xltype.serialization.xstream.XStreamReaderWriter.read(XStreamReaderWriter.java:149)
	at com.xebialabs.xltype.serialization.xstream.XStreamReaderWriter.readFrom(XStreamReaderWriter.java:143)
	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:61)
	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
	at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)
	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:55)
	at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:448)
Caused: hudson.remoting.ProxyException: org.jboss.resteasy.spi.ReaderException: com.thoughtworks.xstream.converters.ConversionException: DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest] : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
---- Debugging information ----
message             : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
cause-exception     : java.lang.IllegalArgumentException
cause-message       : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
class               : com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
required-type       : com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
converter-type      : com.xebialabs.deployit.booter.remote.xml.RemoteXStreamCiConverter
path                : /deployment/deployeds/smoketest.ExecutedHttpRequestTest
line number         : 16
class[1]            : com.xebialabs.deployit.engine.api.dto.Deployment
converter-type[1]   : com.xebialabs.xltype.serialization.xstream.DeploymentConverter
version             : not available
-------------------------------
	at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:483)
	at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:396)
	at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:367)
	at org.jboss.resteasy.client.core.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:75)
	at com.xebialabs.deployit.booter.remote.resteasy.DeployitBodyEntityExtractor.extractEntity(DeployitBodyEntityExtractor.java:27)
	at org.jboss.resteasy.client.core.ClientInvoker.invoke(ClientInvoker.java:138)
	at org.jboss.resteasy.client.core.ClientProxy.invoke(ClientProxy.java:98)
	at com.sun.proxy.$Proxy127.prepareAutoDeployeds(Unknown Source)
	at com.xebialabs.deployit.ci.server.DeployCommand.deploy(DeployCommand.java:108)
	at com.xebialabs.deployit.ci.server.DeployitServerImpl.deploy(DeployitServerImpl.java:89)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.xebialabs.deployit.ci.server.PluginFirstClassloaderInvocationHandler.doInvoke(PluginFirstClassloaderInvocationHandler.java:70)
	at com.xebialabs.deployit.ci.server.PluginFirstClassloaderInvocationHandler.invoke(PluginFirstClassloaderInvocationHandler.java:56)
Caused: hudson.remoting.ProxyException: com.xebialabs.deployit.ci.DeployitPluginException: org.jboss.resteasy.spi.ReaderException: com.thoughtworks.xstream.converters.ConversionException: DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest] : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
---- Debugging information ----
message             : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
cause-exception     : java.lang.IllegalArgumentException
cause-message       : DescriptorRegistry does not know about type [smoketest.ExecutedHttpRequestTest]
class               : com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
required-type       : com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
converter-type      : com.xebialabs.deployit.booter.remote.xml.RemoteXStreamCiConverter
path                : /deployment/deployeds/smoketest.ExecutedHttpRequestTest
line number         : 16
class[1]            : com.xebialabs.deployit.engine.api.dto.Deployment
converter-type[1]   : com.xebialabs.xltype.serialization.xstream.DeploymentConverter
version             : not available
-------------------------------
	at com.xebialabs.deployit.ci.server.PluginFirstClassloaderInvocationHandler.invoke(PluginFirstClassloaderInvocationHandler.java:60)
	at com.sun.proxy.$Proxy97.deploy(Unknown Source)
	at com.xebialabs.deployit.ci.workflow.XLDeployDeployStep$XLDeployPublishExecution.run(XLDeployDeployStep.java:101)
	at com.xebialabs.deployit.ci.workflow.XLDeployDeployStep$XLDeployPublishExecution.run(XLDeployDeployStep.java:77)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
	at hudson.security.ACL.impersonate(ACL.java:290)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

My manifest looks like

<smoketest.HttpRequestTest name="/spring-petclinic-smoke-test">
      <tags />
      <netscalerServiceGroup>{{NETSCALER_SERVICE_GROUP}}</netscalerServiceGroup>
      <netscalerServiceGroupName>{{NETSCALER_SERVICE_GROUP_NAME}}</netscalerServiceGroupName>
      <netscalerServiceGroupPort>{{NETSCALER_SERVICE_GROUP_PORT}}</netscalerServiceGroupPort>
      <url>{{petclinic.smoke.test.url}}</url>
      <expectedResponseText>PetClinic :: a Spring Framework demonstration</expectedResponseText>
      <unexpectedResponseText>Error 404--Not Found</unexpectedResponseText>
      <headers />
    </smoketest.HttpRequestTest>

My pipelinestep looks like:

    stage ('spring-petclinic-weblogic-12c-pipeline - deploy application') {
      /* Deploy application to environmet in XL Deploy */
      steps {
        xldDeploy environmentId: 'Environments/TPE/O/Petclinic-Weblogic12c-pipeline-O/Petclinic-Weblogic12c-pipeline-O',
           packageId: 'Applications/TPE/Petclinic-Weblogic12c-pipeline/Petclinic-Weblogic12c-pipeline/2.1.0-SNAPSHOT',
           serverCredentials: 'XL Deploy deployment user TPE'
      }
    }

What do i have to do to solve this ?
Deploying manual from inside the GUI works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.