Properties

Introduction

Properties provide a simple way of collecting metrics over time. Go sets some standard properties for you. You can also set properties yourself using the Go REST APIs (see Properties API for more information). Go also allows you to download the history of your job in a convenient CSV format, so that you can analyse the results in spreadsheets or scripts.

Property history

Go allows you to download the history of properties that you have defined. This history is available as a Comma Separated Values (CSV) file. You can import this file into a spreadsheet program to generate charts and diagnostics of your project.

You can of course access these resources through standard URLs:

  • CSV -- http://[server]/go/properties/[pipelineName]/[pipelineLabel]/[stageName]/[stageCounter]/[job]/[propertyName]

To open the property history in a spreadsheet application, you can click on the Export property history to spreadsheet (csv) link on the Properties tab of the job.

Standard Properties

The standard properties defined by Go are:

  • cruise_agent -- the agent that is running the job
  • cruise_job_duration -- total time to run the job
  • cruise_job_result -- one of "passed" or "failed"
  • cruise_job_id -- the name of the folder that the artifacts of the job was stored in under the artifact repository on server side (on earlier versions of Go).
  • cruise_pipeline_label -- same as the value of the environment variable GO_PIPELINE_LABEL
  • cruise_pipeline_counter -- same as the value of the environment variable GO_PIPELINE_COUNTER
  • cruise_stage_counter -- same as the value of the environment variable GO_STAGE_COUNTER
  • cruise_timestamp_01_scheduled -- time at which the job was scheduled
  • cruise_timestamp_02_assigned -- time at which the job was assigned to the agent
  • cruise_timestamp_03_preparing -- time at which the job entered the "preparing" state
  • cruise_timestamp_04_building -- time at which the job started building
  • cruise_timestamp_05_completing -- time at which the job entered the completing state
  • cruise_timestamp_06_completed -- time at which the job completed

Generating Properties from Artifacts

Go allows you to generate properties from XML artifacts that you create during the build. This can be used to harvest statistics produced by coverage tools etc. By storing them as properties it becomes very easy to show the history and trends over time of these values.

Note that the properties are generated on the agent side, so the src path is relative to the working directory of the pipeline on the agent.

For example, to add support for the coverage tool "Emma", you might do this:

<job>
  <properties>
    <property name="coverage.class" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'class')]/@value, '%')" />
    <property name="coverage.method" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'method')]/@value, '%')" />
    <property name="coverage.block" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'block')]/@value, '%')" />
    <property name="coverage.line" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'line')]/@value, '%')" />
  </properties>
</job>

Tests

If you define a tests artifact that contains the test reports, then Go will add some properties associated with the tests.

  • tests_failed_count -- number of failed tests
  • tests_ignored_count -- number of ignored tests
  • tests_total_duration -- total time taken for the tests
  • tests_total_count -- total number of tests

results matching ""

    No results matching ""