codeday-clarity / ci-visualizer

This holds the code for the CI CD Visualizer. See README for details of how to view the demo
http://app.ci-visualizer.com
0 stars 0 forks source link

I see the count of passed / cancelled / failed builds, as exported by the Jenkins API #3

Open robmoore-i opened 3 years ago

robmoore-i commented 3 years ago
robmoore-i commented 3 years ago

Example of having swappable dependencies

Things you can google:

function MyComponent => {
  let jenkinsAdaptor = new JenkinsAdaptor()

  render() {
    let myData = jenkinsAdaptor.getTestCounts()
    <TestCountsChart data={myData}>...</TestCountsChart>
  }
}

class JenkinsAdaptor {

  // Returns a JSON object
  getTestCounts() {
    // In the real implementation, I make a HTTP call to the backend
    // But! I'm just testing. So I'll return some constant data.
    return {
      "successes": 5,
      "failures": 3,
      "cancelled": 1,
      "count": 9,
      "avgTimeSeconds": 10,
    }
  }
}