Skip to content

DAOS-19247 test: Support scripted Test stages#526

Open
phender wants to merge 19 commits into
masterfrom
hendersp/DAOS-19247-fix
Open

DAOS-19247 test: Support scripted Test stages#526
phender wants to merge 19 commits into
masterfrom
hendersp/DAOS-19247-fix

Conversation

@phender

@phender phender commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Add support for scripted fault injection and RPM test stages.

Add support for scripted fault injection and RPM test stages.

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
@phender

phender commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Testing new functionality in daos-stack/daos#18597

@phender phender marked this pull request as draft July 2, 2026 02:36
phender added 8 commits July 1, 2026 22:53
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
@phender phender marked this pull request as ready for review July 2, 2026 21:02
@phender

phender commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Downstream testing skipped as it will not test the new groovy code. New code verified as part of daos-stack/daos#18597

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Comment thread vars/scriptedDockerStage.groovy Outdated
Comment thread vars/scriptedDockerStage.groovy Outdated
Comment thread vars/scriptedDockerStage.groovy Outdated
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
phender added 3 commits July 8, 2026 23:02
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
daltonbohning
daltonbohning previously approved these changes Jul 9, 2026
@phender phender added the forced-landing The PR has known failures or intentionally reduced testing, but should still be landed label Jul 9, 2026
Comment thread vars/scriptedTestRpmStage.groovy Outdated
*
* @param kwargs Map containing the following optional arguments (empty strings yield defaults):
* name test stage name
* runStage whether or not to run the test stage

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* runStage whether or not to run the test stage
* runStage whether or not to run the test stage; defaults to true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8cf3e29

Comment thread vars/scriptedTestRpmStage.groovy Outdated
* name test stage name
* runStage whether or not to run the test stage
* label test stage default cluster label
* testBranch if specified, checkout sources from this branch before running tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
* testBranch if specified, checkout sources from this branch before running tests
* testBranch if specified, checkout sources from this branch before running tests; defaults to ''

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8cf3e29

Comment thread vars/scriptedUnitTestStage.groovy
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
daltonbohning
daltonbohning previously approved these changes Jul 9, 2026
phender added 2 commits July 9, 2026 17:56
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
'test_script': kwargs.get('testScript', ''),
'with_valgrind': kwargs.get('withValgrind', ''),
'always_script': kwargs.get('alwaysScript', ''),
'test_results': kwargs.get('testResults', 'nlt-junit.xml'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't it the case that unitTest expects testResults instead of test_results?

p['testResults'] = config.get('testResults',

Suggested change
'test_results': kwargs.get('testResults', 'nlt-junit.xml'),
'testResults': kwargs.get('testResults', 'nlt-junit.xml'),

Comment on lines +11 to +33
* @param kwargs Map containing the following optional arguments (empty strings yield defaults):
* name test stage name
* runStage whether or not to run the test stage
* label test stage default cluster label
* testBranch if specified, checkout sources from this branch before running tests
* jobStatus Map of status for each stage in the job/build
* distro the distro to use for the test stage, e.g. 'el9'; defaults to ''
* timeoutTime unitTest() timeout time in minutes; defaults to 60
* instRepos unitTest() inst_repos argument; defaults to daosRepos()
* testScript unitTest() test_script argument; defaults to ''
* withValgrind unitTest() with_valgrind argument; defaults to ''
* alwaysScript unitTest() always_script argument, e.g.
* 'ci/unit/test_nlt_post.sh'; defaults to ''
* testResults unitTest() test_results argument; defaults to 'nlt-junit.xml'
* unstashOpt unitTest() unstash_opt argument; defaults to true
* unstashTests unitTest() unstash_tests argument; defaults to false
* instRpms unitTest() inst_rpms argument; defaults to
* unitPackages(target: distro) + ' daos-client-tests'
* imageVersion unitTest() image_version argument, e.g 'el9.7'; defaults to ''
* provEnvVars unitTest() prov_env_vars argument; defaults to ''
* unitTestPostArgs Map of arguments to pass to unitTestPost() for the stage
* archiveArtifactsArgs Map of arguments to pass to archiveArtifacts() for the stage
* @return a scripted stage to run in a pipeline

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we let the unitTest() function determine the default settings?

Comment thread vars/scriptedUnitTestStage.groovy
*/
Map call(Map kwargs = [:]) {
// General parameters
String name = kwargs.get('name', 'Unknown Unit Test Stage')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we have name as mandatory parameter and fail fast if not provided?

Comment on lines +45 to +57
Map unitTestArgs = [
'timeout_time': kwargs.get('timeoutTime', 60),
'inst_repos': kwargs.get('instRepos', daosRepos(distro)),
'test_script': kwargs.get('testScript', ''),
'with_valgrind': kwargs.get('withValgrind', ''),
'always_script': kwargs.get('alwaysScript', ''),
'test_results': kwargs.get('testResults', 'nlt-junit.xml'),
'unstash_opt': kwargs.get('unstashOpt', true),
'unstash_tests': kwargs.get('unstashTests', false),
'inst_rpms': kwargs.get('instRpms', unitPackages(target: distro) + ' daos-client-tests'),
'image_version': kwargs.get('imageVersion', ''),
'prov_env_vars': kwargs.get('provEnvVars', '')
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we have same names here as in unitTest() we can just iterate over kwargs to create the map automatically:

Suggested change
Map unitTestArgs = [
'timeout_time': kwargs.get('timeoutTime', 60),
'inst_repos': kwargs.get('instRepos', daosRepos(distro)),
'test_script': kwargs.get('testScript', ''),
'with_valgrind': kwargs.get('withValgrind', ''),
'always_script': kwargs.get('alwaysScript', ''),
'test_results': kwargs.get('testResults', 'nlt-junit.xml'),
'unstash_opt': kwargs.get('unstashOpt', true),
'unstash_tests': kwargs.get('unstashTests', false),
'inst_rpms': kwargs.get('instRpms', unitPackages(target: distro) + ' daos-client-tests'),
'image_version': kwargs.get('imageVersion', ''),
'prov_env_vars': kwargs.get('provEnvVars', '')
]
Set wrapperKeys = [
'name',
'runStage',
'label',
'testBranch',
'jobStatus',
'distro',
'unitTestPostArgs',
'archiveArtifactsArgs'
] as Set
Map unitTestArgs = new LinkedHashMap(kwargs)
unitTestArgs.keySet().removeAll(wrapperKeys)

If you want to introduce new names the following structure can be easier to read:

Map keyMap = [
    timeoutTime : 'timeout_time',
    instRepos   : 'inst_repos',
    testScript  : 'test_script',
    withValgrind: 'with_valgrind',
    alwaysScript: 'always_script',
    testResults : 'test_results',
    unstashOpt  : 'unstash_opt',
    unstashTests: 'unstash_tests',
    instRpms    : 'inst_rpms',
    imageVersion: 'image_version',
    provEnvVars : 'prov_env_vars'
]

Map unitTestArgs = [:]
keyMap.each { inKey, outKey ->
    if (kwargs.containsKey(inKey)) {
        unitTestArgs[outKey] = kwargs[inKey]
    }
}

'test_script': kwargs.get('testScript', ''),
'with_valgrind': kwargs.get('withValgrind', ''),
'always_script': kwargs.get('alwaysScript', ''),
'test_results': kwargs.get('testResults', 'nlt-junit.xml'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it a proper default?
The primary goal of this function will be to handle unit tests. NLT and FI is a special case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forced-landing The PR has known failures or intentionally reduced testing, but should still be landed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants