Skip to content

ibutsu/ibutsu-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://img.shields.io/github/v/release/ibutsu/ibutsu-utils

Ibutsu Utilities

Some command line utilities for Ibutsu. There are currently three tools:

Installation

These utilities are available on PyPI and can be installed with pip:

$ pip install ibutsu-utils

Authentication

An API token can be provided in two ways:

  1. Via the -t / --api-token command line option.
  2. Via the IBUTSU_TOKEN environment variable.

If both are set, the command line option takes precedence.

$ export IBUTSU_TOKEN="AwEdE...4GyT"
$ ibutsu-upload -H https://my.ibutsu.com/api -p my-project results.xml

Download Tool

The ibutsu-download command line tool downloads an artifact from Ibutsu.

Usage

$ ibutsu-download -h
usage: ibutsu-download [-h] -H HOST [-t API_TOKEN] [-o OUTPUT] artifact_id

A tool to download an artifact from an Ibutsu server

positional arguments:
  artifact_id           The ID of the artifact to download

options:
  -h, --help            show this help message and exit
  -H HOST, --host HOST  The Ibutsu instance for uploading, e.g. https://my.ibutsu.com/api
  -t API_TOKEN, --api-token API_TOKEN
                        An API token for authentication (can also be set via IBUTSU_TOKEN env var)
  -o OUTPUT, --output OUTPUT
                        The destination to save the file. If omitted will use the current directory and the artifact file name

Example

$ ibutsu-download --host https://my.ibutsu.com/api --api-token AwEdE...4GyT --output errors.log ea8550e2-7eeb-4b4e-8a31-92d8a3e1169c

Upload Tool

The ibutsu-upload command line tool uploads JUnit XML or Ibutsu archives to Ibutsu.

Usage

$ ibutsu-upload --help
usage: ibutsu-upload [-h] -H HOST -p PROJECT [-t API_TOKEN] [-s SOURCE] [-m METADATA] [-w] input [input ...]

A tool to upload a jUnit XML or Ibutsu archive to Ibutsu

positional arguments:
  input                 The file(s) to upload

options:
  -h, --help            show this help message and exit
  -H HOST, --host HOST  The Ibutsu instance for uploading, e.g. https://my.ibutsu.com/api
  -p PROJECT, --project PROJECT
                        The project for the upload
  -t API_TOKEN, --api-token API_TOKEN
                        An API token for authentication (can also be set via IBUTSU_TOKEN env var)
  -s SOURCE, --source SOURCE
                        The source used in the test results
  -m METADATA, --metadata METADATA
                        Additional metadata to set when uploading, in the format of dotted.key.path=value
  -w, --wait            Wait for the upload to complete (by default this command does not wait)

Example

$ ibutsu-upload --host https://my.ibutsu.com/api --api-token AwEdE...4GyT --project ibutsu-server --source jenkins-run-tests-53 --metadata component=frontend --metadata env=prod --metadata durations.call=34.405 --metadata durations.setup=0.0005 --metadata durations.teardown=0.689 --metadata markers=core,smoke,frontend --wait 550aed75-b214-4d17-983d-fe0829311b98.tar.gz

The above --metadata arguments will populate the metadata field in the run object:

{
  "metadata": {
    "component": "frontend",
    "env": "prod",
    "durations": {
      "call": 34.405,
      "setup": 0.0005,
      "teardown": 0.689
    },
    "markers": [
      "core",
      "smoke",
      "frontend"
    ]
  },
}

Combine Tool

Some test runners output multiple JUnit XML files for a single test run. The ibutsu-xmerge utility will combine multiple XML files into a single file.

Usage

$ ibutsu-xmerge --help
usage: ibutsu-xmerge [-h] [-o OUTPUT] input [input ...]

positional arguments:
  input                 Input files

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output to a file. Defaults to stdout without this.

Example

$ ibutsu-xmerge --output ../merged.xml *.xml

About

Some command line utilities for Ibutsu

Resources

License

Stars

1 star

Watchers

2 watching

Forks

Packages

 
 
 

Contributors

Languages