Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-13527 test: Support default tag assignment through Jenkinsfile #377

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 31 additions & 23 deletions vars/parseStageInfo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -274,34 +274,42 @@ Map call(Map config = [:]) {
}

// Determine which tests tags to use
String tag
if (startedByUser() || startedByUpstream()) {
// Test tags defined by the build parameters override all other tags
tag = get_build_params_tags()
}
if (!tag && startedByTimer()) {
// Stage defined tags take precedence in timed builds
tag = config['test_tag']
if (!tag) {
// Otherwise use the default timed build tags
tag = 'pr daily_regression'
if (env.BRANCH_NAME.startsWith('weekly-testing')) {
tag = 'full_regression'
// config Build Param Commit Pragma
// Started by 'test_tag' (TestTag) (Test-tag) Default Use
// -------------- ---------- ---------- ------------- ---------- ----------
// PR | Upstream None None None defaul_tag defaul_tag
// PR | Upstream None None commit_tag defaul_tag commit_tag
// PR | Upstream None param_tag None defaul_tag param_tag
// PR | Upstream None param_tag commit_tag defaul_tag commit_tag
// Manual | Timer None None <any> defaul_tag defaul_tag
// Manual | Timer None param_tag <any> defaul_tag param_tag
// <any> config_tag <any> <any> <any> config_tag
//
String tag = config['test_tag']
if (!tag) {
if (startedByUser() || startedByTimer()) {
// Get tags from the build parameters
tag = get_build_params_tags()
if (!tag) {
// Default to the pr tag for any other build stage
tag = 'pr'
}
}
} else if (!tag) {
if (env.BRANCH_NAME.matches(testBranchRE())) {
tag = 'always_passes'
} else {
// Tags defined by commit pragmas have priority in user PRs
else {
// Get tags from the commit pragmas
tag = get_commit_pragma_tags(result['pragma_suffix'])
if (!tag) {
// Followed by stage defined tags
tag = config['test_tag']
/* groovylint-disable-next-line CouldBeElvis */
// Get tags from the build parameters
tag = get_build_params_tags()
if (!tag) {
// Otherwise use the default PR tag
tag = 'pr'
if (startedByUpstream()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same problem as we discussed before, in that downstream test jobs' parameters are ignored if the branch being used for the downstream job has commit pragmas on it (ignoring for now the commit we add to override the commit pragmas)?

// Default to run simple tests for dowstream builds
tag = 'always_passes'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this reflect

value: ('load_mpi test_core_files ' +
?

TBH, I'm on the fence about whether the default tags for downstream testing belong here or above.

}
else {
// Default to the pr tag for any other build stage
tag = 'pr'
}
}
}
}
Expand Down