-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adapt plugin for Data Table API 2.0.x #642
Adapt plugin for Data Table API 2.0.x #642
Conversation
Hey @mPokornyETM, thanks so much for getting this plugin working with the new version of Data Tables. Unfortunately, those two tests are still failing when running in Plugin Compatibility Tester (PCT). I can reproduce the same failures in this repository with diff --git a/pom.xml b/pom.xml
index b9cd6a3..e77cae1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,8 +70,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
- <artifactId>bom-2.387.x</artifactId>
- <version>2543.vfb_1a_5fb_9496d</version>
+ <artifactId>bom-2.440.x</artifactId>
+ <version>2950.va_633b_f42f759</version>
<type>pom</type>
<scope>import</scope>
</dependency> and running:
These problems persisted with the latest release of HtmlUnit (4.0.0). Shortly before these problems occur, Rhino prints JavaScript problems with bootstrap:
These problems persist after disabling JavaScript: diff --git a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java
index 4972e7d..13edf41 100644
--- a/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java
+++ b/src/test/java/org/jenkins/plugins/lockableresources/LockStepTest.java
@@ -746,6 +746,7 @@ public class LockStepTest extends LockStepTestBase {
p.setDefinition(new CpsFlowDefinition("lock('resource1') { semaphore('wait-inside') }", true));
JenkinsRule.WebClient wc = j.createWebClient();
+ wc.getOptions().setThrowExceptionOnScriptError(false);
WorkflowRun prevBuild = null;
for (int i = 0; i < 3; i++) {
diff --git a/src/test/java/org/jenkins/plugins/lockableresources/LockableResourceApiTest.java b/src/test/java/org/jenkins/plugins/lockableresources/LockableResourceApiTest.java
index 3a7a126..4a70743 100644
--- a/src/test/java/org/jenkins/plugins/lockableresources/LockableResourceApiTest.java
+++ b/src/test/java/org/jenkins/plugins/lockableresources/LockableResourceApiTest.java
@@ -36,6 +36,7 @@ public class LockableResourceApiTest {
j.jenkins.setAuthorizationStrategy(new FullControlOnceLoggedInAuthorizationStrategy());
JenkinsRule.WebClient wc = j.createWebClient();
+ wc.getOptions().setThrowExceptionOnScriptError(false);
wc.login("user");
TestHelpers.clickButton(wc, "reserve");
assertThat(LockableResourcesManager.get().fromName("a1").isReserved(), is(true)); This makes no difference. Per the HtmlUnit maintainer in HtmlUnit/htmlunit#498 (comment):
This message was written on August 15, 2022. I think you have a few options:
None of these options seem particularly great, but I believe we should choose a path forward one way or another. |
Can you add the explicit version https://github.com/jenkinsci/data-tables-api-plugin/releases/tag/v2.0.3-1 here: lockable-resources-plugin/pom.xml Line 89 in 67c1000
Then we see if there are test failures. |
@uhafner it provides some dependency issues see also https://github.com/jenkinsci/lockable-resources-plugin/pull/642/checks?check_run_id=24088006393 |
I think you are using a too old BOM that does not match your Jenkins version:
You should use: |
thx for your time @basil . I mont realy happy :-( No one of the option is fast and good.
|
Agreed; this option is tantamount to dropping your dependency on the other plugins that use advanced JavaScript.
@uhafner is probably the best person to talk about how to run this from a Jenkins plugin repository since I don't think anyone else does this. For writing tests within the ATH repository there is plenty of documentation at https://github.com/jenkinsci/acceptance-test-harness.
Unfortunately, HtmlUnit is increasingly unsuitable for modern JavaScript: HtmlUnit/htmlunit#755 jenkinsci/jenkins-test-harness#569 This would be my preferred short-term approach, and is consistent with the status quo, although it is not great from a testing perspective.
For what it's worth, BOM updates of things rarely break frontends. The recent incompatible release of Data Tables is an exception to what is otherwise a fairly consistent track record of compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have confirmed that this allows the exclusions from jenkinsci/bom#3066 to be removed by running
PLUGINS=lockable-resources TEST=org.jenkins.plugins.lockableresources.LockableResourceApiTest#reserveUnreserveApi,org.jenkins.plugins.lockableresources.LockStepTest#unlockButtonWithWaitingRuns bash local-test.sh
@@ -81,6 +81,7 @@ | |||
<dependency> | |||
<groupId>io.jenkins.plugins</groupId> | |||
<artifactId>data-tables-api</artifactId> | |||
<version>2.0.5-1</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be omitted since this plugin is in BOM.
fixes #634
Do not mixed Jenkins and data-table css classes.
closes #647
Testing done
Tested also with dark mode and it looks fine.
Proposed upgrade guidelines
N/A
Localizations
N/A
Submitter checklist