Skip to content

Commit

Permalink
🧪 Add a simple Azure Pipelines task definition version test
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Nov 30, 2022
1 parent 12f5137 commit c90adc2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion scan/__tests__/main.test.ts
Expand Up @@ -6,7 +6,8 @@ import {
getQodanaScanArgs,
Inputs,
getQodanaUrl,
getQodanaArchiveName
getQodanaArchiveName,
VERSION
} from '../../common/qodana'
import * as fs from 'fs'

Expand Down Expand Up @@ -128,3 +129,19 @@ test('download all Qodana CLI archives and check their checksums', async () => {
}
}
})

test('check whether Azure Pipelines task.json definitions is up to date', () => {
const taskJson = JSON.parse(
fs.readFileSync(path.join(__dirname, '..', '..', 'vsts', 'QodanaScan', 'task.json'), 'utf8')
)
expect(`${taskJson.version.Major}.${taskJson.version.Minor}.${taskJson.version.Patch}`).toEqual(VERSION)
})

test('check whether action README.md contains the latest version mentioned everywhere', () => {
const readmeMd = fs.readFileSync(path.join(__dirname, '..', '..', 'README.md'), 'utf8')
const mentions = readmeMd.match(/uses: JetBrains\/qodana-action@v\d+\.\d+\.\d+/g) || []
expect(mentions.length > 0).toEqual(true)
for (const mention of mentions??[]) {
expect(mention).toEqual(`uses: JetBrains/qodana-action@v${VERSION}`)
}
})

0 comments on commit c90adc2

Please sign in to comment.