API Reference

Objects

Job

Description

A hash representing the coverage data from a single run of a test suite.

You must specify either repo_token or a service name and job id.

Arguments

repo_token

String

Required

The secret token for your repository, found at the bottom of your repository's page on Coveralls.

service_name

String

Required

The CI service or other environment in which the test suite was run. This can be anything, but certain services have special features (travis-ci, travis-pro, or coveralls-ruby).

service_number

String 

Optional

The build number. Will default to chronological numbering from builds on repo.

service_job_id

String

Optional

A unique identifier of the job on the service specified by service_name.

service_pull_request

String

Optional

The associated pull request ID of the build. Used for updating the status and/or commenting.

source_files

Array

Required

An array of source files, including their coverage data.

parallel

Boolean

Optional

If this is set, the build will not be considered done until a webhook has been sent to https://coveralls.io/webhook?repo_token=...

git

Hash

Optional

A hash of Git data that can be used to display more information to users.

"git": {
  "head": {
    "id": "b31f08d07ae564b08237e5a336e478b24ccc4a65",
    "author_name": "Nick Merwin",
    "author_email": "...",
    "committer_name": "Nick Merwin",
    "committer_email": "...",
    "message": "version bump"
  },
  "branch": "master",
  "remotes": [
    {
      "name": "origin",
      "url": "git@github.com:lemurheavy/coveralls-ruby.git"
    }
  ]
},      
commit_sha

String

Optional

The current SHA of the commit being built to override the "git" parameter.

run_at

Timestamp

Optional

A timestamp of when the job ran. Must be parsable by Ruby.

"run_at": "2013-02-18 00:52:48 -0800"

Source File

Description

A hash representing a source code file and its coverage data for a single job.

Arguments

name

String

Required

Represents the file path of this source file. Must be unique in the job. Can include slashes. The file type for syntax highlighting will be determined from the file extension in this parameter.

source_digest

String

Required

The MD5 digest of the full source code of this file.

coverage

Array

Required

The coverage data for this file for the file's job.

The item at index 0 represents the coverage for line 1 of the source code.

Acceptable values in the array:

  • A positive integer if the line is covered, representing the number of times the line is hit during the test suite.
  • 0 if the line is not covered by the test suite.
  • null to indicate the line is not relevant to code coverage (it may be whitespace or a comment).
[null, 1, 0, null, 4, 15, null]
source

String

Optional (Required for Manual repos on Enterprise)

The contents of the source file.

Have more questions? Submit a request

Comments

  • Avatar
    Jarrod Carlson

    This "reference" doesn't indicate where to send my requests, or with what HTTP verbs. This documentation is... lacking.

  • Avatar
    John Vandenberg

    Also missing is documentation for service_number , service_branch and service_build_url .
    And the service_name values which coveralls ruby gem uses for the various CI.

Powered by Zendesk