Skip to content

Commit

Permalink
add hacky extra jenkins output
Browse files Browse the repository at this point in the history
  • Loading branch information
edd committed Jan 12, 2024
1 parent d605e58 commit f5756f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/check-references.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ function checkReferences(specsGlob, testsGlob, categoriesPath, ignoreGlob, featu
const specList = ignoreFiles(glob.sync(specsGlob, {}), ignoreList)
const testList = ignoreFiles(glob.sync(testsGlob, {}), ignoreList, 'test')
let categories
const milestones = new Map()
const totals = []

let specs, tests, features, specFeatures
const exitCode = 0
Expand Down Expand Up @@ -292,9 +294,7 @@ function checkReferences(specsGlob, testsGlob, categoriesPath, ignoreGlob, featu
}

if (featuresPath) {
const totals = []
const milestoneNames = new Set()
const milestones = new Map()

Object.keys(specFeatures).forEach(key => milestoneNames.add(specFeatures[key].milestone))
milestoneNames.forEach(m => milestones.set(m, []))
Expand Down Expand Up @@ -425,9 +425,10 @@ function checkReferences(specsGlob, testsGlob, categoriesPath, ignoreGlob, featu
}

if (shouldOutputJenkins) {
const currentMilestone = totals.pop()
const skipCategories = ['Category', 'Specs', 'Acceptable']
let jenkinsLine = `All ACs: \r\n ${Object.entries(categories.pop()).map(([key, value]) => skipCategories.indexOf(key) === -1 ? `*${key}*: ${value}` : '').join(' ').trim()} \r\n`
jenkinsLine += `Current milestone ACs: \r\n ${Object.entries(milestones.pop()).map(([key, value]) => skipCategories.indexOf(key) === -1 ? `*${key}*: ${value}` : '').join(' ').trim()}`
let jenkinsLine = `All ACs: ${Object.entries(categories.pop()).map(([key, value]) => skipCategories.indexOf(key) === -1 ? `*${key}*: ${value}` : '').join(' ').trim()}`
jenkinsLine += `\r\nCurrent milestone ACs: *${currentMilestone.Milestone}*: ${currentMilestone.Coverage}`
fs.writeFileSync(`${outputPath}/jenkins.txt`, jenkinsLine)
}

Expand Down

0 comments on commit f5756f1

Please sign in to comment.