ci: force default Squish params for PR jobs

This way we prevent situation in which a developer or QA engineer runs a
custom job with adjusted parameters, and then all following jobs use
those modified parameters implicitly. The more sane behavior is to
always revert to defaults for PR builds, but remember last used
parameters for non-PR builds.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-04-18 14:31:44 +02:00 committed by Jakub
parent 54bdb867bf
commit 4bd81e8a9a

View File

@ -17,12 +17,12 @@ pipeline {
string(
name: 'SQUISH_SUITE',
description: 'Name of test suite to run in Squish. Defaults to all.',
defaultValue: '*'
defaultValue: forcePRDefaults(params.SQUISH_SUITE, '*')
)
string(
name: 'SQUISH_TAGS',
description: 'List of tags to use for Squish tests separated by spaces.',
defaultValue: '~mayfail ~merge ~relyon-mailserver'
defaultValue: forcePRDefaults(params.SQUISH_TAGS, '~mayfail ~merge ~relyon-mailserver')
)
choice(
name: 'VERBOSE',
@ -195,3 +195,9 @@ def getPeerAddress() {
assert rpcResp : 'Could not get node address from RPC API!'
return readJSON(text: rpcResp)['result']['listenAddresses'][0]
}
/* Helper that prevents saving of parameters in PR jobs. */
def String forcePRDefaults(String previousValue, String defaultValue) {
if (utils.isPRBuild()) { return defaultValue }
return previousValue ?: defaultValue
}