Skip to content

DAOS-19247 test: Support scripted Test stages#526

Draft
phender wants to merge 38 commits into
masterfrom
hendersp/DAOS-19247-fix
Draft

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

Conversation

@phender

@phender phender commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Adding the scriptedTestRpmStage() method to provide a scripted stage definition for the Test RPM
stages and the scriptedUnitTestStage() method to provide a scripted stage definition for the Fault
Injection Testing stage.

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
Comment thread vars/scriptedTestRpmStage.groovy Outdated
Comment thread vars/scriptedUnitTestStage.groovy
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Comment thread vars/scriptedUnitTestStage.groovy Outdated
'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'),

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.

Thanks for the suggestion. Fixed in https://github.com/daos-stack/pipeline-lib/pull/526/changes/037d0ddc14145bc96d08751797e10cc4b86a0d2a..0162051eb3f92cb52c3abeabeb3404c1c389b1ed. The arguments for unitTest.groovy are now passed through.

Comment thread vars/scriptedUnitTestStage.groovy
Comment thread vars/scriptedUnitTestStage.groovy
Comment thread vars/scriptedUnitTestStage.groovy Outdated
Comment thread vars/scriptedUnitTestStage.groovy Outdated
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]
    }
}

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.

Thanks, I've just updated the code to pass the unitTest.groovy arguments through in https://github.com/daos-stack/pipeline-lib/pull/526/changes/037d0ddc14145bc96d08751797e10cc4b86a0d2a..0162051eb3f92cb52c3abeabeb3404c1c389b1ed w/o any renaming.

Comment thread vars/scriptedUnitTestStage.groovy Outdated
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
@phender
phender marked this pull request as draft July 13, 2026 14:23
phender added 4 commits July 13, 2026 23:30
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
@phender
phender marked this pull request as ready for review July 14, 2026 15:01
phender added 2 commits July 14, 2026 11:15
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Comment thread vars/scriptedUnitTestStage.groovy Outdated
Comment on lines +18 to +20
* unitTestArgs Map of arguments to pass to unitTest; defaults to an empty Map.
* unitTestPostArgs Map of arguments to pass to unitTestPost() for the stage
* archiveArtifactsArgs Map of arguments to pass to archiveArtifacts() for the 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
* unitTestArgs Map of arguments to pass to unitTest; defaults to an empty Map.
* unitTestPostArgs Map of arguments to pass to unitTestPost() for the stage
* archiveArtifactsArgs Map of arguments to pass to archiveArtifacts() for the stage
* unitTestArgs Map of arguments to pass to unitTest; defaults to an empty Map.
* unitTestPostArgs Map of arguments to pass to unitTestPost() for the stage; defaults to an empty Map.
* archiveArtifactsArgs Map of arguments to pass to archiveArtifacts() for the stage; defaults to an empty Map.

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 8130ede

Comment on lines +49 to +57
// Add defaults for any missing unitTest() arguments
if (!unitTestArgs.containsKey('inst_repos')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_repos'] = daosRepos(distro)
}
if (!unitTestArgs.containsKey('inst_rpms')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_rpms'] = unitPackages(target: distro) + ' daos-client-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.

Would it be better to fix unitTest() in unitTest.groovy?

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.

This PR is a prerequisite for the daos-stack/daos#18597 where the scriptedUnitTestStage() method is being used to run the Fault Injection Testing stage. In this case we want to call the daosRepos() and unitPackages() methods from inside the stage - not when defining arguments for a stage in the Jenkinsfile. As such they have been assigned here as defaults if no inst_repos or inst_rpms arguments are provided.

If in the future we decide to use this for other unit test stages I think we can investigate other options for providing daosRepos() as an input for the unit_test argument for the unitTest() method w/o calling it outside of the stage - which may include passing more arguments to the method and other methods it calls. It is a bit beyond the scope of this change in my opinion.

Comment on lines +49 to +57
// Add defaults for any missing unitTest() arguments
if (!unitTestArgs.containsKey('inst_repos')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_repos'] = daosRepos(distro)
}
if (!unitTestArgs.containsKey('inst_rpms')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_rpms'] = unitPackages(target: distro) + ' daos-client-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.

Do we have DAOS PR that removes this default from Jenkinsfile?

                                unitTest(timeout_time: 60,
                                        unstash_opt: true,
                                        // inst_repos: daosRepos(),
                                        // inst_rpms: unitPackages(target: 'el9'),
                                        image_version: 'el9.7',
                                        )
                            )

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.

No, the change is for daos-stack/daos#18597 and the Fault Injection Testing stage.

Comment on lines +54 to +57
if (!unitTestArgs.containsKey('inst_rpms')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_rpms'] = unitPackages(target: distro) + ' daos-client-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.

Why do we add ' daos-client-test'?
The actual Jenkins file does not require it:

                stage('Unit Test') {
...
                    steps {
                            job_step_update(
                                unitTest(timeout_time: 60,
                                        unstash_opt: true,
                                        inst_repos: daosRepos(),
                                        inst_rpms: unitPackages(target: 'el9'),
                                        image_version: 'el9.7',
                                        )
                            )
                    }
...
                }
Suggested change
if (!unitTestArgs.containsKey('inst_rpms')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_rpms'] = unitPackages(target: distro) + ' daos-client-tests'
}
if (!unitTestArgs.containsKey('inst_rpms')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_rpms'] = unitPackages(target: distro)
}

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.

This is needed for the Fault Injection Testing stage, where scriptedUnitTestStage() is being used.

// Add defaults for any missing unitTest() arguments
if (!unitTestArgs.containsKey('inst_repos')) {
/* groovylint-disable-next-line DuplicateStringLiteral */
unitTestArgs['inst_repos'] = daosRepos(distro)

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.

Do we have a DAOS PR that removes these defaults from Jenkinsfile?

                                unitTest(timeout_time: 60,
                                        unstash_opt: true,
                                        // inst_repos: daosRepos(),
                                        // inst_rpms: unitPackages(target: 'el9'),
                                        image_version: 'el9.7',
                                        )
                            )

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.

No, the change is for daos-stack/daos#18597 and the Fault Injection Testing stage.

Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
@phender
phender requested review from daltonbohning and grom72 July 15, 2026 13:52
phender added 4 commits July 15, 2026 10:36
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
@phender
phender marked this pull request as draft July 16, 2026 04:00
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
@phender
phender marked this pull request as ready for review July 16, 2026 04:53
@phender
phender marked this pull request as draft July 16, 2026 13:01
phender added 6 commits July 16, 2026 09:53
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
THe env.UNIT_TEST handling was bypassing the ability to check the tags
for test matches in the stage.

Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
Skip-daos-build-and-test: true

Signed-off-by: Phil Henderson <phillip.henderson@hpe.com>
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