-
Notifications
You must be signed in to change notification settings - Fork 52
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
AxisTest
fails when Git plugin is on the test classpath
#615
Comments
The
The problem can be reproduced outside of PCT by checking out diff --git a/pom.xml b/pom.xml
index a9bdf84..7d13f0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,6 +74,11 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jenkins-ci.plugins</groupId>
+ <artifactId>git</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<dependencyManagement>
<dependencies> then running |
AxisTest
fails with cryptic PCT-only errorsAxisTest#submitInvalidAxisValue
fails when Git plugin is on the test classpath
FYI @MarkEWaite since the above failure only occurs when the Git plugin is on the test classpath |
It appears that the test relies on a lookup of the input form by name but the name is ambiguous when the git plugin is loaded. The test finds an input for by name("_.name"). Without the git plugin loaded, there is only one form with that name on the page. With the git plugin loaded, there is another form with that same name and the form from the git plugin is selected instead of the form from the matrix project plugin. Maybe an XPath selection could be used instead of finding the input form by name? I'll need to do more searching as time allows. |
Seems like a good idea. For what it's worth, I think ChatGPT is pretty good at writing XPath queries. |
jenkinsci/bom#615 describes the problem in more detail. When the git plugin is loaded along with the matrix project plugin, there are multiple input fields on the job configuration page with the name `_.name`. The previous code waited until there was at least one input field with the name `_.name`, but instead it needs to wait for the arrival of an additional input field with the name `_.name`. Adds a new `setName` method that sets the value of the `_.name` field that was created by this plugin. Previously, it would set the first `_.name` field. Setting the first `_.name` field works when running the matrix plugin tests without the git plugin loaded, but fails when the git plugin is loaded. The combination of waiting for the correct `_.name` field to appear and setting the value on the correct `_.name` field allows oone of the four tests to pass when the git plugin is loaded. The remaining tests need more investigation to pass when the git plugin is loaded. Also removes a nearly silent skip of the tests when the input does not appear within the timeout. Also increases the time between retries so that my fast computer needs only two or three retries. I confirmed on a much slower computer (Intel Core i5-2410M CPU @ 2.30GHz) that even on that slow computer, it found the necessary field in 8 tries or less. The upper bound of 18 tries should be more than enough for all the test environments. The retry period should not be increased beyond the current ~300ms because one of the tests is using a form that does not include `_.name`. That test falls through to the end of the retry period.
jenkinsci/bom#615 describes the problem in more detail. When the git plugin is loaded along with the matrix project plugin, there are multiple input fields on the job configuration page with the name `_.name`. The previous code waited until there was at least one input field with the name `_.name`, but instead it needs to wait for the arrival of an additional input field with the name `_.name`. Adds a new `setName` method that sets the value of the `_.name` field that was created by this plugin. Previously, it would set the first `_.name` field. Setting the first `_.name` field works when running the matrix plugin tests without the git plugin loaded, but fails when the git plugin is loaded. The combination of waiting for the correct `_.name` field to appear and setting the value on the correct `_.name` field allows oone of the four tests to pass when the git plugin is loaded. The remaining tests need more investigation to pass when the git plugin is loaded. Also removes a nearly silent skip of the tests when the input does not appear within the timeout. Also increases the time between retries so that my fast computer needs only two or three retries. I confirmed on a much slower computer (Intel Core i5-2410M CPU @ 2.30GHz) that even on that slow computer, it found the necessary field in 8 tries or less. The upper bound of 18 tries should be more than enough for all the test environments. The retry period should not be increased beyond the current ~300ms because one of the tests is using a form that does not include `_.name`. That test falls through to the end of the retry period.
jenkinsci/bom#615 describes the problem in more detail. When the git plugin is loaded along with the matrix project plugin, there are multiple input fields on the job configuration page with the name `_.name`. The previous code waited until there was at least one input field with the name `_.name`, but instead it needs to wait for the arrival of an additional input field with the name `_.name`. Adds a new `setName` method that sets the value of the `_.name` field that was created by this plugin. Previously, it would set the first `_.name` field. Setting the first `_.name` field works when running the matrix plugin tests without the git plugin loaded, but fails when the git plugin is loaded. The combination of waiting for the correct `_.name` field to appear and setting the value on the correct `_.name` field allows oone of the four tests to pass when the git plugin is loaded. The remaining tests need more investigation to pass when the git plugin is loaded. Also removes a nearly silent skip of the tests when the input does not appear within the timeout. Also increases the time between retries so that my fast computer needs only two or three retries. I confirmed on a much slower computer (Intel Core i5-2410M CPU @ 2.30GHz) that even on that slow computer, it found the necessary field in 8 tries or less. The upper bound of 18 tries should be more than enough for all the test environments. The retry period should not be increased beyond the current ~300ms because one of the tests is using a form that does not include `_.name`. That test falls through to the end of the retry period.
AxisTest#submitInvalidAxisValue
fails when Git plugin is on the test classpathAxisTest
fails when Git plugin is on the test classpath
As of #2767 at least 1 out of 4 tests is running on a regular basis. Now this I call progress. |
See #251 (comment). It would be good to get to the bottom of this and remove the
AxisTest
exclusion.The text was updated successfully, but these errors were encountered: