<commit_before>/*jlint node: true */
/*global require, console */

var jenkinsapi = require('./lib/jenkins');

var jenkins = jenkinsapi.init("http://awsjenkins.ventyx.abb.com:8080");

jenkins.job_info('/kitchen_ellipse', processResults.bind(null, '/kitchen_ellipse'));
jenkins.job_info('/ellipse-unit-tests', processResults.bind(null, '/ellipse-unit-tests'));
jenkins.job_info('/ellipse-service-tests', processResults.bind(null, '/ellipse-service-tests'));

function processResults(target, err, data) {
  if(err) {
    console.log("ERROR (job info): " + err);
    return;
  }
//  console.log("data: " + JSON.stringify(data, null, ' '));

  console.log("\t display name: " + data.displayName);
  console.log("\t  description: " + data.description);
  // console.log("\t         name: " + data.name);
  // console.log("\t          url: " + data.url);
  // console.log("\t    buildable: " + data.buildable);
  // console.log("\t        color: " + data.color);
  // console.log("\tHealth Report: " + data.healthReport[0].description);
  // console.log("\t     icon URL: " + data.healthReport[0].iconUrl);
  console.log("\t        score: " + data.healthReport[0].score);
  console.log("\t       builds: ");
  
  
  getJobResult(data.displayName, target, data.builds[0].number);
}

function getJobResult(displayName, target, jobNbr, callback) {
  jenkins.build_info(target, jobNbr, function(err, data) {
    // console.log(JSON.stringify(data, null, ' '));
    if(data.building) {
      console.log(displayName + "\t" + jobNbr + " -> " + Math.round((new Date().getTime() - data.timestamp) / data.estimatedDuration * 100) + "%");
    } else {
      if(data["actions"][6].failCount !== undefined) {
        console.log(displayName + "\t" + 
                    jobNbr + " : " + data.result + 
                    "\tFailed: " + data["actions"][6].failCount + 
                    "\tSkipped: " + data["actions"][6].skipCount + 
                    "\tPassed: " + 
      (parseInt(data["actions"][6].totalCount) - 
      (
        parseInt(data["actions"][6].failCount) + parseInt(data["actions"][6].skipCount) 
      )));
      } else {
        console.log(displayName + "\t" + jobNbr + " : " + data.result + " passed: " + passed + " failed: " + failed + " skipped: " + skipped);<commit_msg>Investigate other types of tests<commit_after>/*jlint node: true */
/*global require, console */

var jenkinsapi = require('./lib/jenkins');

var jenkins = jenkinsapi.init("http://awsjenkins.ventyx.abb.com:8080");

//jenkins.job_info('/kitchen_ellipse', processResults.bind(null, '/kitchen_ellipse'));
//jenkins.job_info('/ellipse-unit-tests', processResults.bind(null, '/ellipse-unit-tests'));
//jenkins.job_info('/ellipse-service-tests', processResults.bind(null, '/ellipse-service-tests'));
jenkins.job_info('/8.4_auto_test_report', processResults.bind(null, '/8.4_auto_test_report'));

function processResults(target, err, data) {
  if(err) {
    console.log("ERROR (job info): " + err);
    return;
  }
//  console.log("data: " + JSON.stringify(data, null, ' '));

  console.log("\t display name: " + data.displayName);
  console.log("\t  description: " + data.description);
  // console.log("\t         name: " + data.name);
  // console.log("\t          url: " + data.url);
  // console.log("\t    buildable: " + data.buildable);
  // console.log("\t        color: " + data.color);
  // console.log("\tHealth Report: " + data.healthReport[0].description);
  // console.log("\t     icon URL: " + data.healthReport[0].iconUrl);
  console.log("\t        score: " + data.healthReport[0].score);
  console.log("\t       builds: ");
  
  
  getJobResult(data.displayName, target, data.builds[0].number);
}

function getJobResult(displayName, target, jobNbr, callback) {
  jenkins.build_info(target, jobNbr, function(err, data) {
    console.log(JSON.stringify(data, null, ' '));
    if(data.building) {
      console.log(displayName + "\t" + jobNbr + " -> " + Math.round((new Date().getTime() - data.timestamp) / data.estimatedDuration * 100) + "%");
    } else {
      if(data["actions"][6].failCount !== undefined) {
        console.log(displayName + "\t" + 
                    jobNbr + " : " + data.result + 
                    "\tFailed: " + data["actions"][6].failCount + 
                    "\tSkipped: " + data["actions"][6].skipCount + 
                    "\tPassed: " + 
      (parseInt(data["actions"][6].totalCount) - 
      (
        parseInt(data["actions"][6].failCount) + parseInt(data["actions"][6].skipCount) 
      )));
      } else {
        // console.log(displayName + "\t" + jobNbr + " : " + data.result + " passed: " + passed + " failed: " + failed + " skipped: " + skipped);
        console.log(displayName + "\t" + jobNbr + " : " + data.result);
{'fraction_non_alphanumeric': 0.19630096679277007, 'fraction_numerical': 0.007986548970155528, 'mean_word_length': 2.9265676567656764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3056027', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1569, 'n_words': 238}