Skip to content

DAOS-19247 test: Support scripted Test stages - #526

Merged
phender merged 39 commits into
masterfrom
hendersp/DAOS-19247-fix
Jul 20, 2026
Merged

DAOS-19247 test: Support scripted Test stages#526
phender merged 39 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. Fixing skipping Functional test stages when builds are re-run and the stage
previously passed.

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

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.

The problem I see here (and in previous comments) is that we start using the scriptedUnitTestStage() method not for default unit test behavior but for an exceptional.
If Fault Injection requires some parameters different than default ones (e.g. additional daos-client-tests) they should be provided in Jenkinsfile (or via different wrapper function).

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.

I do agree with @grom72 here. IMO it's better to not hardcode this kind of thing into pipeline-lib

@phender phender Jul 20, 2026

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.

The tricky part is that methods like unitPackages() rely on parseStageInfo() and parseStageInfo relies on the environment variables like the stage name being set. Since this method returns the stage definition to be run, the stage name is not yet set to the stage we're going to run, so the return value of unitPackages() cannot be passed as an input - in its current form. We would essentially need to replace all the parseStageInfo() outputs with required inputs into a bunch of groovy methods. Then we could call:

scriptedUnitTestStage(
   ...
   inst_rpms: unitPackages(target: distro, script: 'ci/unit/required_packages.sh') + ' daos-client-tests',
   ....
)

This is something I think is better tackled in another PR - one where we could also consider using scriptedUnitTestStage() for the other stages that use unitTest().

Comment thread vars/scriptedUnitTestStage.groovy
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>
JohnMalmberg
JohnMalmberg previously approved these changes Jul 20, 2026
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 20, 2026 13:51
@phender
phender requested a review from JohnMalmberg July 20, 2026 13:52
@phender

phender commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

The removal of the env.UNIT_TEST quick exit in vars/testsInStage.groovy was verified not to break the Commit Pragma tests in https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/pipeline-lib/job/PR-526/35/stages with a Jenkinsfile self-reference. With this removed the master PR testing these pipeline-lib changes was able to execute the expected code paths.

/* groovylint-disable-next-line MethodSize */
Map call(Map kwargs = [:]) {
String name = kwargs.get('name', 'Unknown Functional Test Stage')
String name = kwargs.get('name', '')

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 empty string instead of null?

Boolean runStage = kwargs.get('runStage', true) as Boolean
String label = kwargs.get('label')
String testBranch = kwargs.get('testBranch', '')
Map jobStatus = kwargs.get('jobStatus', null) ?: [:]

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 this not the same?

Suggested change
Map jobStatus = kwargs.get('jobStatus', null) ?: [:]
Map jobStatus = kwargs.get('jobStatus', [:])

@phender phender Jul 20, 2026

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.

Not exactly:

def kwargs = [jobStatus: false]

// #1 Returns [:]    (same result for null, 0, or '' jobStatus value or an missing jobStatus key)
kwargs.get('jobStatus', null) ?: [:]

// #2 Returns false  ([:] is only returned if the 'jobStatus' key is not assigned in kwargs, regardless of its value)
kwargs.get('jobStatus', [:])

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 would we have [jobStatus: false] if it is supposed to be a map? This seems like we are masking other issues?

@phender
phender requested a review from a team July 20, 2026 15:40
@phender
phender merged commit 26c9cc1 into master Jul 20, 2026
5 checks passed
@phender
phender deleted the hendersp/DAOS-19247-fix branch July 20, 2026 16:31
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.

4 participants