Giter Site home page Giter Site logo

gradle-test-export-plugin's Introduction

Build Status

Gradle Test Export Plugin

This plugin allows an application to post the JUnit test results to an ElasticSearch cluster.

The main prupose of this plugin is to read the xml test results files and post the results for visualization on a Kibana Dashboard.

Maven/Gradle

You can add this plugin as a dependency to your project through JitPack.

apply: plugin 'test-export'
  • Group id: com.ullink.gradle
  • Artifact id: gradle-test-export-plugin

How to use it?

The plugin depends on the Gradle Test tasks. Therefore, it ensures that the test task is up to date before executing. Once it executes, it reads the xml reports generated by the JUnit runners and posts them to an elastic search cluster.

Settings for the cluster can be modified in the build.gradle file

testExport {
    host = '127.0.0.1'
    port = 9300
    clusterName = 'elasticsearch'
    properties = [
            any: "property"
        ]
    // properites = {
    //        return [
    //            any: "property"
    //        ]
    //    }
    type = 'testcase'
    targetDirectory = 'build/test-results'
}

Parameters

name optional default value type
host true 127.0.0.1 string
port true 9300 int
clusterName true elasticsearch string
properties true null map / closure
type true testcase string / closure
indexPrefix true testresults- string
indexTimestampPattern true yyyy-MM string
targetDirectory true build/test-results string

Properties

Properties can take a closure or a map as input. The closure must return a map of extra properties that one might want to push to the elastic search.

Type

Type is a string or a closure that returns string, it is the _type field in the ElasticSearch record.

Final TestExport JSON

{
    "_index": "testresults-LOWER-CASED-SUITE-NAME-DATESTAMP",
    "_type": Type_Property_Field,
    "_id": TESTCASE_NAME_TIMESTAMP,
    "_score": 1,
    "_source": {
      "classname":  CLASS_NAME,
      "failureType": "",
      "executionTime": INT_MILLISECONDS,
      "failureMessage": "",
      "timestamp": TIMESTAMP,
      "name": TESTCASE_NAME,
      "properties": {
        "key": "value"
      },
      "resultType": FAILURE/SUCCESS/SKIPPED
    }
}

gradle-test-export-plugin's People

Contributors

amngupta avatar bcorne avatar fhervieux avatar josselinchevalay avatar ngyukman avatar peter-ng-ullink avatar timotei avatar

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.