Branch: refs/heads/master
Home:
https://github.com/jenkinsci/nodelabelparameter-plugin
Commit: d93212896a6b2f826096acbea9047685d6f68e62
https://github.com/jenkinsci/nodelabelparameter-plugin/commit/d93212896a6b2f826096acbea9047685d6f68e62
Author: Arnab Munshi <
119315596+...@users.noreply.github.com>
Date: 2024-12-26 (Thu, 26 Dec 2024)
Changed paths:
A src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/IgnoreTempOfflineNodeEligibilityTest.java
A src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinitionTest.java
M src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterValueTest.java
A src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterDefinitionTest.java
M src/test/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterValueTest.java
Log Message:
-----------
Improve test coverage (#371)
* [Jenkins-69756] Improve test coverage
* Improve Test Coverage of NodeLabelParameter
* Broaden the temp offline eligibility tests
Start the Jenkins controller only once for the entire test so that it
runs faster. This is more important on Windows than on Linux, but is not
harmful because the tests configure their needed Jenkins configuration
at the start of each test.
Use nodeName as the isEligible argument rather than label string.
Label string did not match a node so would always return false.
Remove the label declaration since it is not needed for these tests.
Confirm that the Jenkins controller is eligible when it has executors
and is not eligible when it does not have executors.
Check more details of the descriptors.
* Broaden LabelParameterDefinitionTest
Assert more values are set by the constructors
Use both deprecated constructors in a test and mark the test as deprecated
so that the compiler does not warn about the use of deprecated methods.
Test agent and controller doList and test a case that doList fails to
find the agent label.
* Test more getters and more branches of doListNodes
The doListNodes checks now cover failure cases
* More clear assertion in one test
* Test getNextLabels and deprecated constructors more deeply
The getNextLabels test needs JenkinsRule and an agent, so those are
added to the test.
The deprecated constructor tests now check more values that are assigned
during object construction.
* Expand assertions in NodeParameterDefinitionTest
Unexpected that myValue is not returned by parameterValue.getValue().
Seems to be a bug in the NodeParameterDefinition implementation.
NodeParameterDefinition declares a private field 'label' that receives
the value instead of it being stored in LabelParameterValue.label but
does not override the LabelParameterValue implementation of getValue().
Expanded coverage by using different triggerIfResult values that change
the behavior of the constructor.
Prefer agents in local variables rather than slaves.
---------
Co-authored-by: Mark Waite <
mark.ea...@gmail.com>
To unsubscribe from these emails, change your notification settings at
https://github.com/jenkinsci/nodelabelparameter-plugin/settings/notifications