Skip to content

Repository files navigation

Coverage Base

VersionDownloadsBuild StatusOpen IssuesLicense

Base class defining the interface for coverage upload implementations

Usage

npm install screwdriver-coverage-base

Interface

This is an interface for uploading code coverage results from a Screwdriver build to a code coverage server.

getAccessToken

Required Parameters
ParameterTypeDescription
configObject
config.buildCredentialsObjectInformation stored in the build JWT token
config.projectKeyStringProject key (can be directly passed in with just startTime and endTime)
config.scopeStringCoverage scope (pipeline or job)
config.usernameStringProject username
Expected Outcome

The getAccessToken function should resolve a Promise with an access token that build can use to talk to the code coverage server.

getInfo

Required Parameters
ParameterTypeDescription
configObject
config.jobIdStringThe unique ID for a job
config.jobNameStringThe Screwdriver job name
config.pipelineIdStringThe unique ID for a pipeline
config.pipelineNameStringThe Screwdriver pipeline name
config.prNumStringThe pull request number
config.startTimeStringThe job start time
config.endTimeStringThe job end time
config.projectKeyStringProject key (can be directly passed in with just startTime and endTime)
config.prParentJobIdStringPR parent job ID
config.scopeStringCoverage scope (pipeline or job)
Expected Outcome

The getInfo function should resolve a Promise with an object with metadata about the project coverage.

getUploadCoverageCmd

Required Parameters
ParameterTypeDescription
configObject
config.buildStringThe build
config.jobStringThe job
config.pipelineStringThe pipeline
Expected Outcome

The getUploadCoverageCmd function should resolve a Promise with a string of shell commands to upload code coverage results.

Extending

To extend the base class, the functions to override are:

  1. _getAccessToken
  2. _getInfo
  3. _getUploadCoverageCmd

Testing

npm test

Related links

See the coverage-bookend

License

Code licensed under the BSD 3-Clause license. See LICENSE file for terms.

About

Base class defining the interface for code coverage implementations

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

16 watching

Forks

Releases

Packages

Used by

Contributors

Languages