Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 863 Bytes

README.md

File metadata and controls

42 lines (32 loc) · 863 Bytes

Coverage Plugin

Hapi coverage plugin for the Screwdriver API

Usage

const Hapi = require('hapi');
const server = new Hapi.Server();
const coveragePlugin = require('./');

server.connection({ port: 3000 });

server.register({
    register: coveragePlugin,
    options: {}
}, () => {
    server.start((err) => {
        if (err) {
            throw err;
        }
        console.log('Server running at:', server.info.uri);
    });
});

Routes

Returns an access token to talk to coverage server

GET /coverage/token

Get an object with coverage info

GET /coverage/info?buildId=1&jobId=123&startTime=2017-10-19T13%3A00%3A00%2B0200&endTime=2017-10-19T15%3A00%3A00%2B0200

Should resolve with something like

{
    coverage: '98.8',
    projectUrl: 'https://sonar.screwdriver.cd/dashboard?id=job%3A123'
}