chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 (#9357)
* chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * reformat all the things (prettier 3) * update tests to await calls to prettier.format() --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: chris48s <git@chris-shaw.dev>
This commit is contained in:
@@ -22,9 +22,9 @@ const modernSchema = Joi.object({
|
||||
metric: Joi.string().required(),
|
||||
value: Joi.alternatives(
|
||||
Joi.number().min(0),
|
||||
Joi.allow('OK', 'ERROR')
|
||||
Joi.allow('OK', 'ERROR'),
|
||||
).required(),
|
||||
})
|
||||
}),
|
||||
)
|
||||
.min(0)
|
||||
.required(),
|
||||
@@ -40,12 +40,12 @@ const legacySchema = Joi.array()
|
||||
key: Joi.string().required(),
|
||||
val: Joi.alternatives(
|
||||
Joi.number().min(0),
|
||||
Joi.allow('OK', 'ERROR')
|
||||
Joi.allow('OK', 'ERROR'),
|
||||
).required(),
|
||||
})
|
||||
}),
|
||||
)
|
||||
.required(),
|
||||
}).required()
|
||||
}).required(),
|
||||
)
|
||||
.required()
|
||||
|
||||
@@ -87,7 +87,7 @@ export default class SonarBase extends BaseJsonService {
|
||||
httpErrors: {
|
||||
404: 'component or metric not found, or legacy API not supported',
|
||||
},
|
||||
})
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ t.create('Coverage (branch)')
|
||||
|
||||
t.create('Coverage (legacy API supported)')
|
||||
.get(
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -44,7 +44,7 @@ t.create('Coverage (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'coverage',
|
||||
|
||||
@@ -20,7 +20,7 @@ t.create('Documented API Density (not found)')
|
||||
|
||||
t.create('Documented API Density')
|
||||
.get(
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.somewhatold.com&sonarVersion=6.1'
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.somewhatold.com&sonarVersion=6.1',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.somewhatold.com/api')
|
||||
@@ -38,7 +38,7 @@ t.create('Documented API Density')
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'public documented api density',
|
||||
@@ -47,7 +47,7 @@ t.create('Documented API Density')
|
||||
|
||||
t.create('Documented API Density (legacy API supported)')
|
||||
.get(
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -67,7 +67,7 @@ t.create('Documented API Density (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'public documented api density',
|
||||
|
||||
@@ -39,8 +39,8 @@ describe('SonarFortifyRating', function () {
|
||||
defaultContext,
|
||||
config,
|
||||
{ component: 'org.ow2.petals:petals-se-ase' },
|
||||
{ server: 'http://sonar.petalslink.com' }
|
||||
)
|
||||
{ server: 'http://sonar.petalslink.com' },
|
||||
),
|
||||
).to.deep.equal({
|
||||
color: 'green',
|
||||
message: '4/5',
|
||||
|
||||
@@ -29,7 +29,7 @@ t.create('Fortify Security Rating')
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'fortify-security-rating',
|
||||
@@ -38,7 +38,7 @@ t.create('Fortify Security Rating')
|
||||
|
||||
t.create('Fortify Security Rating (legacy API supported)')
|
||||
.get(
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -58,7 +58,7 @@ t.create('Fortify Security Rating (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'fortify-security-rating',
|
||||
@@ -67,7 +67,7 @@ t.create('Fortify Security Rating (legacy API supported)')
|
||||
|
||||
t.create('Fortify Security Rating (legacy API not supported)')
|
||||
.get(
|
||||
'/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io&sonarVersion=4.2'
|
||||
'/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io&sonarVersion=4.2',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'fortify-security-rating',
|
||||
@@ -83,7 +83,7 @@ t.create('Fortify Security Rating (nonexistent component)')
|
||||
|
||||
t.create('Fortify Security Rating (legacy API metric not found)')
|
||||
.get(
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -98,7 +98,7 @@ t.create('Fortify Security Rating (legacy API metric not found)')
|
||||
{
|
||||
msr: [],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'fortify-security-rating',
|
||||
|
||||
@@ -5,7 +5,7 @@ export const t = await createServiceTester()
|
||||
t.create('Security Rating')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/security_rating/com.luckybox:luckybox.json?server=https://sonarcloud.io'
|
||||
'/security_rating/com.luckybox:luckybox.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'security rating',
|
||||
@@ -16,7 +16,7 @@ t.create('Security Rating')
|
||||
t.create('Security Rating (branch)')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/security_rating/com.luckybox:luckybox/master.json?server=https://sonarcloud.io'
|
||||
'/security_rating/com.luckybox:luckybox/master.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'security rating',
|
||||
|
||||
@@ -12,12 +12,12 @@ const ratingScaleColors = [
|
||||
]
|
||||
const negativeMetricColorScale = colorScale(
|
||||
ratingPercentageScaleSteps,
|
||||
ratingScaleColors
|
||||
ratingScaleColors,
|
||||
)
|
||||
const positiveMetricColorScale = colorScale(
|
||||
ratingPercentageScaleSteps,
|
||||
ratingScaleColors,
|
||||
true
|
||||
true,
|
||||
)
|
||||
|
||||
function isLegacyVersion({ sonarVersion }) {
|
||||
@@ -32,7 +32,7 @@ const sonarVersionSchema = Joi.alternatives(
|
||||
Joi.string()
|
||||
.regex(/[0-9.]+/)
|
||||
.optional(),
|
||||
Joi.number().optional()
|
||||
Joi.number().optional(),
|
||||
)
|
||||
|
||||
const queryParamSchema = Joi.object({
|
||||
|
||||
@@ -12,7 +12,7 @@ const isQualityGateStatus = Joi.allow('passed', 'failed')
|
||||
|
||||
t.create('Quality Gate')
|
||||
.get(
|
||||
'/quality_gate/swellaby%3Aazdo-shellcheck.json?server=https://sonarcloud.io'
|
||||
'/quality_gate/swellaby%3Aazdo-shellcheck.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'quality gate',
|
||||
@@ -21,7 +21,7 @@ t.create('Quality Gate')
|
||||
|
||||
t.create('Quality Gate (branch)')
|
||||
.get(
|
||||
'/quality_gate/swellaby%3Aazdo-shellcheck/master.json?server=https://sonarcloud.io'
|
||||
'/quality_gate/swellaby%3Aazdo-shellcheck/master.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'quality gate',
|
||||
@@ -30,7 +30,7 @@ t.create('Quality Gate (branch)')
|
||||
|
||||
t.create('Quality Gate (Alert Status)')
|
||||
.get(
|
||||
'/alert_status/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/alert_status/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -50,7 +50,7 @@ t.create('Quality Gate (Alert Status)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'quality gate',
|
||||
@@ -61,7 +61,7 @@ t.create('Quality Gate (Alert Status)')
|
||||
// https://github.com/badges/shields/pull/6636#issuecomment-886172161
|
||||
t.create('Quality Gate (version >= 6.6)')
|
||||
.get(
|
||||
'/quality_gate/de.chkpnt%3Atruststorebuilder-gradle-plugin.json?server=https://sonar.chkpnt.de&sonarVersion=8.9'
|
||||
'/quality_gate/de.chkpnt%3Atruststorebuilder-gradle-plugin.json?server=https://sonar.chkpnt.de&sonarVersion=8.9',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'quality gate',
|
||||
|
||||
@@ -9,38 +9,38 @@ export const t = new ServiceTester({
|
||||
|
||||
t.create('sonar version')
|
||||
.get(
|
||||
'/4.2/http/sonar.petalslink.com/org.ow2.petals:petals-se-ase/alert_status.svg'
|
||||
'/4.2/http/sonar.petalslink.com/org.ow2.petals:petals-se-ase/alert_status.svg',
|
||||
)
|
||||
.expectRedirect(
|
||||
`/sonar/alert_status/org.ow2.petals:petals-se-ase.svg?${queryString.stringify(
|
||||
{
|
||||
server: 'http://sonar.petalslink.com',
|
||||
sonarVersion: '4.2',
|
||||
}
|
||||
)}`
|
||||
},
|
||||
)}`,
|
||||
)
|
||||
|
||||
t.create('sonar host parameter')
|
||||
.get(
|
||||
'/http/sonar.petalslink.com/org.ow2.petals:petals-se-ase/alert_status.svg'
|
||||
'/http/sonar.petalslink.com/org.ow2.petals:petals-se-ase/alert_status.svg',
|
||||
)
|
||||
.expectRedirect(
|
||||
`/sonar/alert_status/org.ow2.petals:petals-se-ase.svg?${queryString.stringify(
|
||||
{
|
||||
server: 'http://sonar.petalslink.com',
|
||||
}
|
||||
)}`
|
||||
},
|
||||
)}`,
|
||||
)
|
||||
|
||||
t.create('sonar host parameter with version')
|
||||
.get(
|
||||
'/http/sonar.petalslink.com/org.ow2.petals:petals-se-ase/alert_status.svg?sonarVersion=4.2'
|
||||
'/http/sonar.petalslink.com/org.ow2.petals:petals-se-ase/alert_status.svg?sonarVersion=4.2',
|
||||
)
|
||||
.expectRedirect(
|
||||
`/sonar/alert_status/org.ow2.petals:petals-se-ase.svg?${queryString.stringify(
|
||||
{
|
||||
server: 'http://sonar.petalslink.com',
|
||||
sonarVersion: '4.2',
|
||||
}
|
||||
)}`
|
||||
},
|
||||
)}`,
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ export const t = await createServiceTester()
|
||||
|
||||
t.create('Tech Debt')
|
||||
.get(
|
||||
'/tech_debt/brave_brave-core.json?server=https://sonarcloud.io&sonarVersion=9.0'
|
||||
'/tech_debt/brave_brave-core.json?server=https://sonarcloud.io&sonarVersion=9.0',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tech debt',
|
||||
@@ -26,7 +26,7 @@ t.create('Tech Debt (branch)')
|
||||
|
||||
t.create('Tech Debt (legacy API supported)')
|
||||
.get(
|
||||
'/tech_debt/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/tech_debt/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -46,7 +46,7 @@ t.create('Tech Debt (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tech debt',
|
||||
|
||||
@@ -102,7 +102,7 @@ class SonarTestsSummary extends SonarBase {
|
||||
passed_label: passedLabel,
|
||||
failed_label: failedLabel,
|
||||
skipped_label: skippedLabel,
|
||||
}
|
||||
},
|
||||
) {
|
||||
const json = await this.fetch({
|
||||
sonarVersion,
|
||||
|
||||
@@ -15,7 +15,7 @@ export const t = new ServiceTester({
|
||||
})
|
||||
const isMetricAllowZero = Joi.alternatives(
|
||||
isMetric,
|
||||
Joi.number().valid(0).required()
|
||||
Joi.number().valid(0).required(),
|
||||
)
|
||||
|
||||
// The service tests targeting the legacy SonarQube API are mocked
|
||||
@@ -27,7 +27,7 @@ const isMetricAllowZero = Joi.alternatives(
|
||||
t.create('Tests')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/tests/swellaby:azure-pipelines-templates.json?server=https://sonarcloud.io'
|
||||
'/tests/swellaby:azure-pipelines-templates.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tests',
|
||||
@@ -37,7 +37,7 @@ t.create('Tests')
|
||||
t.create('Tests (branch)')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/tests/swellaby:azure-pipelines-templates/master.json?server=https://sonarcloud.io'
|
||||
'/tests/swellaby:azure-pipelines-templates/master.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tests',
|
||||
@@ -46,7 +46,7 @@ t.create('Tests (branch)')
|
||||
|
||||
t.create('Tests (legacy API supported)')
|
||||
.get(
|
||||
'/tests/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/tests/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -74,7 +74,7 @@ t.create('Tests (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tests',
|
||||
@@ -122,7 +122,7 @@ t.create('Tests with compact message and custom labels')
|
||||
t.create('Total Test Count')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/total_tests/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io'
|
||||
'/total_tests/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'total tests',
|
||||
@@ -132,7 +132,7 @@ t.create('Total Test Count')
|
||||
t.create('Total Test Count (branch)')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/total_tests/swellaby:azdo-shellcheck/master.json?server=https://sonarcloud.io'
|
||||
'/total_tests/swellaby:azdo-shellcheck/master.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'total tests',
|
||||
@@ -141,7 +141,7 @@ t.create('Total Test Count (branch)')
|
||||
|
||||
t.create('Total Test Count (legacy API supported)')
|
||||
.get(
|
||||
'/total_tests/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/total_tests/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -161,7 +161,7 @@ t.create('Total Test Count (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'total tests',
|
||||
@@ -171,7 +171,7 @@ t.create('Total Test Count (legacy API supported)')
|
||||
t.create('Test Failures Count')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/test_failures/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io'
|
||||
'/test_failures/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'test failures',
|
||||
@@ -180,7 +180,7 @@ t.create('Test Failures Count')
|
||||
|
||||
t.create('Test Failures Count (legacy API supported)')
|
||||
.get(
|
||||
'/test_failures/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/test_failures/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -200,7 +200,7 @@ t.create('Test Failures Count (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'test failures',
|
||||
@@ -210,7 +210,7 @@ t.create('Test Failures Count (legacy API supported)')
|
||||
t.create('Test Errors Count')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/test_errors/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io'
|
||||
'/test_errors/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'test errors',
|
||||
@@ -219,7 +219,7 @@ t.create('Test Errors Count')
|
||||
|
||||
t.create('Test Errors Count (legacy API supported)')
|
||||
.get(
|
||||
'/test_errors/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/test_errors/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -239,7 +239,7 @@ t.create('Test Errors Count (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'test errors',
|
||||
@@ -249,7 +249,7 @@ t.create('Test Errors Count (legacy API supported)')
|
||||
t.create('Skipped Tests Count')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/skipped_tests/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io'
|
||||
'/skipped_tests/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'skipped tests',
|
||||
@@ -258,7 +258,7 @@ t.create('Skipped Tests Count')
|
||||
|
||||
t.create('Skipped Tests Count (legacy API supported)')
|
||||
.get(
|
||||
'/skipped_tests/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/skipped_tests/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -278,7 +278,7 @@ t.create('Skipped Tests Count (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'skipped tests',
|
||||
@@ -288,7 +288,7 @@ t.create('Skipped Tests Count (legacy API supported)')
|
||||
t.create('Test Success Rate')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/test_success_density/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io'
|
||||
'/test_success_density/swellaby:azdo-shellcheck.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tests',
|
||||
@@ -297,7 +297,7 @@ t.create('Test Success Rate')
|
||||
|
||||
t.create('Test Success Rate (legacy API supported)')
|
||||
.get(
|
||||
'/test_success_density/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/test_success_density/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -317,7 +317,7 @@ t.create('Test Success Rate (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tests',
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
|
||||
const violationsColorScale = colorScale(
|
||||
[1, 2, 3, 5],
|
||||
['brightgreen', 'yellowgreen', 'yellow', 'orange', 'red']
|
||||
['brightgreen', 'yellowgreen', 'yellow', 'orange', 'red'],
|
||||
)
|
||||
|
||||
const violationCategoryColorMap = {
|
||||
@@ -148,7 +148,7 @@ export default class SonarViolations extends SonarBase {
|
||||
|
||||
async handle(
|
||||
{ component, metric, branch },
|
||||
{ server, sonarVersion, format }
|
||||
{ server, sonarVersion, format },
|
||||
) {
|
||||
// If the user has requested the long format for the violations badge
|
||||
// then we need to include each individual violation metric in the call to the API
|
||||
|
||||
@@ -5,8 +5,8 @@ export const t = await createServiceTester()
|
||||
const isViolationsLongFormMetric = Joi.alternatives(
|
||||
Joi.allow(0),
|
||||
withRegex(
|
||||
/(([\d]+) (blocker|critical|major|minor|info))(,\s([\d]+) (critical|major|minor|info))?/
|
||||
)
|
||||
/(([\d]+) (blocker|critical|major|minor|info))(,\s([\d]+) (critical|major|minor|info))?/,
|
||||
),
|
||||
)
|
||||
|
||||
// The service tests targeting the legacy SonarQube API are mocked
|
||||
@@ -33,7 +33,7 @@ t.create('Violations (branch)')
|
||||
|
||||
t.create('Violations (legacy API supported)')
|
||||
.get(
|
||||
'/violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -53,7 +53,7 @@ t.create('Violations (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'violations',
|
||||
@@ -63,7 +63,7 @@ t.create('Violations (legacy API supported)')
|
||||
t.create('Violations Long Format')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/violations/brave_brave-core.json?server=https://sonarcloud.io&format=long'
|
||||
'/violations/brave_brave-core.json?server=https://sonarcloud.io&format=long',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'violations',
|
||||
@@ -72,7 +72,7 @@ t.create('Violations Long Format')
|
||||
|
||||
t.create('Violations Long Format (legacy API supported)')
|
||||
.get(
|
||||
'/violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2&format=long'
|
||||
'/violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2&format=long',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -113,7 +113,7 @@ t.create('Violations Long Format (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'violations',
|
||||
@@ -130,7 +130,7 @@ t.create('Blocker Violations')
|
||||
|
||||
t.create('Blocker Violations (legacy API supported)')
|
||||
.get(
|
||||
'/blocker_violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/blocker_violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -150,7 +150,7 @@ t.create('Blocker Violations (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'blocker violations',
|
||||
@@ -160,7 +160,7 @@ t.create('Blocker Violations (legacy API supported)')
|
||||
t.create('Critical Violations')
|
||||
.timeout(10000)
|
||||
.get(
|
||||
'/critical_violations/brave_brave-core.json?server=https://sonarcloud.io'
|
||||
'/critical_violations/brave_brave-core.json?server=https://sonarcloud.io',
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'critical violations',
|
||||
@@ -169,7 +169,7 @@ t.create('Critical Violations')
|
||||
|
||||
t.create('Critical Violations (legacy API supported)')
|
||||
.get(
|
||||
'/critical_violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
||||
'/critical_violations/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2',
|
||||
)
|
||||
.intercept(nock =>
|
||||
nock('http://sonar.petalslink.com/api')
|
||||
@@ -189,7 +189,7 @@ t.create('Critical Violations (legacy API supported)')
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
]),
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'critical violations',
|
||||
|
||||
Reference in New Issue
Block a user