<commit_before>'use strict';

const _ = require(`lodash`);
const fs = require(`fs`);
const mkdirp = require(`mkdirp`);
const path = require(`path`);

module.exports = _.curry((argv, ci, result) => {
  const filename = `reports/junit/suite.xml`;
  return new Promise((resolve, reject) => {
    let errorCount, failureCount, testCase;
    switch (result.status) {
    case `success`:
    case `fixed`:
      failureCount = errorCount = 0;
      testCase = `<testcase name="suite" classname=suite" time="0.1"/>`;
      break;
    case `timedout`:
      failureCount = 0;
      errorCount = 1;
      testCase = `<testcase name="suite" classname=suite" time="0.1"><failure type="">Timed out</failure><testcase>`;
      break;
    case `failed`:
      failureCount = 1;
      errorCount = 0;
      testCase = `<testcase name="suite" classname=suite" time="0.1"><failure type="">failed</failure><testcase>`;
      break;
    default:
      failureCount = errorCount = 1;
      testCase = `<testcase name="suite" classname=suite" time="0.1"><failure type="">${result.status}</failure><testcase>`;
    }
    const out = `<?xml version="1.0"?>
    <testsuite
      name="spark-js-sdk"
      package="suite"
      timestamp="${(new Date()).toISOString()}"<commit_msg>fix(tooling): fix xml typo<commit_after>'use strict';

const _ = require(`lodash`);
const fs = require(`fs`);
const mkdirp = require(`mkdirp`);
const path = require(`path`);

module.exports = _.curry((argv, ci, result) => {
  const filename = `reports/junit/suite.xml`;
  return new Promise((resolve, reject) => {
    let errorCount, failureCount, testCase;
    switch (result.status) {
    case `success`:
    case `fixed`:
      failureCount = errorCount = 0;
      testCase = `<testcase name="suite" classname="suite" time="0.1"/>`;
      break;
    case `timedout`:
      failureCount = 0;
      errorCount = 1;
      testCase = `<testcase name="suite" classname="suite" time="0.1"><failure type="">Timed out</failure><testcase>`;
      break;
    case `failed`:
      failureCount = 1;
      errorCount = 0;
      testCase = `<testcase name="suite" classname="suite" time="0.1"><failure type="">failed</failure><testcase>`;
      break;
    default:
      failureCount = errorCount = 1;
      testCase = `<testcase name="suite" classname="suite" time="0.1"><failure type="">${result.status}</failure><testcase>`;
    }
    const out = `<?xml version="1.0"?>
    <testsuite
      name="spark-js-sdk"
      package="suite"
      timestamp="${(new Date()).toISOString()}"
{'fraction_non_alphanumeric': 0.1767497034400949, 'fraction_numerical': 0.01265322261763543, 'mean_word_length': 3.5667870036101084, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 2, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, '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': '4217334', 'n_tokens_mistral': 833, 'n_tokens_neox': 798, 'n_words': 180}