This is the preferred way we’re handling server URLs: in the query string. While we still have a mix of these, I’ve argued this way is better for these reasons: 1. It allows us to make the URLs a bit more standardized across services. 2. It makes the routes unambiguous. 3. It requires less code. While it introduces a URL-encoding requirement on the parameter, I think these tradeoffs are worth it.
25 lines
624 B
JavaScript
25 lines
624 B
JavaScript
'use strict'
|
|
|
|
const Joi = require('@hapi/joi')
|
|
const t = (module.exports = require('../tester').createServiceTester())
|
|
|
|
const isQualityGateStatus = Joi.allow('passed', 'failed')
|
|
|
|
t.create('Quality Gate')
|
|
.get(
|
|
'/quality_gate/swellaby%3Aazdo-shellcheck.json?server=https://sonarcloud.io'
|
|
)
|
|
.expectBadge({
|
|
label: 'quality gate',
|
|
message: isQualityGateStatus,
|
|
})
|
|
|
|
t.create('Quality Gate (Alert Status)')
|
|
.get(
|
|
'/alert_status/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
|
|
)
|
|
.expectBadge({
|
|
label: 'quality gate',
|
|
message: isQualityGateStatus,
|
|
})
|