Skip to content

Run browser tests against a local HttpServer#2825

Merged
jonahgraham merged 1 commit intoeclipse-platform:masterfrom
jonahgraham:local-webserver-http
Dec 2, 2025
Merged

Run browser tests against a local HttpServer#2825
jonahgraham merged 1 commit intoeclipse-platform:masterfrom
jonahgraham:local-webserver-http

Conversation

@jonahgraham
Copy link
Contributor

@jonahgraham jonahgraham commented Nov 28, 2025

For a while we have suffered with patchy tests due to limited connectivity to external websites when running Browser tests.

This commit brings in a new Http Server based on the now available Java 21 simple web server available in the JDK. This is sufficient to test the various paths currently used in the browser tests, and make them reliable (or at least more resilient against external sites going dark)

Fixes #2804

Fixes #2561

This has as a parent commit PR #2824

@jonahgraham jonahgraham marked this pull request as draft November 28, 2025 03:12
@eclipse-platform-bot
Copy link
Contributor

eclipse-platform-bot commented Nov 28, 2025

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF
examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF
examples/org.eclipse.swt.examples.ole.win32/META-INF/MANIFEST.MF
examples/org.eclipse.swt.examples.ole.win32/pom.xml
examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From cb5d85a6d22f216c3f980fce235d90a64d11929e Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <[email protected]>
Date: Fri, 28 Nov 2025 13:52:46 +0000
Subject: [PATCH] Version bump(s) for 4.38 stream


diff --git a/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF
index ab0cf5f759..23460be600 100644
--- a/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin.SWTBrowserDemos.name
 Bundle-SymbolicName: org.eclipse.swt.examples.browser.demos; singleton:=true
-Bundle-Version: 3.108.600.qualifier
+Bundle-Version: 3.108.700.qualifier
 Bundle-Activator: org.eclipse.swt.examples.browser.demos.BrowserDemoPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF
index fdd3c6f1b0..fe6a19331b 100644
--- a/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin.SWTLauncherExample.name
 Bundle-SymbolicName: org.eclipse.swt.examples.launcher; singleton:=true
-Bundle-Version: 3.108.600.qualifier
+Bundle-Version: 3.108.700.qualifier
 Bundle-Activator: org.eclipse.swt.examples.launcher.LauncherPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/examples/org.eclipse.swt.examples.ole.win32/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.ole.win32/META-INF/MANIFEST.MF
index 36ef8c27a5..480e6a3c60 100644
--- a/examples/org.eclipse.swt.examples.ole.win32/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples.ole.win32/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin.SWTOLEExample.name
 Bundle-SymbolicName: org.eclipse.swt.examples.ole.win32; singleton:=true
-Bundle-Version: 3.109.400.qualifier
+Bundle-Version: 3.109.500.qualifier
 Bundle-Activator: org.eclipse.swt.examples.ole.win32.OlePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/examples/org.eclipse.swt.examples.ole.win32/pom.xml b/examples/org.eclipse.swt.examples.ole.win32/pom.xml
index fcf61342bd..c3090f0a25 100644
--- a/examples/org.eclipse.swt.examples.ole.win32/pom.xml
+++ b/examples/org.eclipse.swt.examples.ole.win32/pom.xml
@@ -20,7 +20,7 @@
     <relativePath>../../</relativePath>
   </parent>
   <artifactId>org.eclipse.swt.examples.ole.win32</artifactId>
-  <version>3.109.400-SNAPSHOT</version>
+  <version>3.109.500-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <build>
diff --git a/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
index d32085fde8..8388aff8df 100644
--- a/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin.SWTPaintExample.name
 Bundle-SymbolicName: org.eclipse.swt.examples.views;singleton:=true
-Bundle-Version: 3.108.600.qualifier
+Bundle-Version: 3.108.700.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.core.runtime,
-- 
2.51.2

Further information are available in Common Build Issues - Missing version increments.

@jonahgraham
Copy link
Contributor Author

The Windows tests I modified are currently failing - I tried to make these new test more robust. For example in the POST test we were just checking that the returned data was "big enough" without checking content. I have changed that to make sure the results are exactly as expected, which works on Linux. But Edge + IE both re-interpret/re-format the HTML leading to comparison errors.

For example: expected: <!DOCTYPE html><html><head> but was <HTML><HEAD><TITLE>.

I also think newlines change too. I'll provide an update that loosens the new requirements I just added.


This new server uses http://localhost:PORT where PORT is assigned per test (standard way using port 0 to get free port).


A while ago all the tests were changed from http: -> https: and this goes back to http:. There is a comment in the code that said:

"please use https instead, http do not work on mac out of the box and your test will hang there!"

But the tests all seem to pass on macOS. I will spin this up on my mac machine to make sure they work locally too.

I can add https to the webserver, but there is a few hoops to jump through to make keys. However I don't think the functionality being tested needs https. In reality we should have some https tests - for example to make sure that failed certs are somewhat displayed to users, but AFAICT there are no such tests today.

@jonahgraham
Copy link
Contributor Author

This pull request changes some projects for the first time in this development cycle.

This is really a parent commit - PR #2824 problem.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

Test Results

  118 files  ±0    118 suites  ±0   15m 55s ⏱️ - 2m 47s
4 653 tests ±0  4 636 ✅ ±0  17 💤 ±0  0 ❌ ±0 
  338 runs  ±0    334 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit 09a0915. ± Comparison against base commit a845cef.

♻️ This comment has been updated with latest results.

For a while we have suffered with patchy tests due to limited connectivity
to external websites when running Browser tests.

This commit brings in a new Http Server based on the now available
Java 21 simple web server available in the JDK. This is sufficient
to test the various paths currently used in the browser tests, and
make them reliable (or at least more resilient against external sites
going dark)

Fixes eclipse-platform#2804

Fixes eclipse-platform#2561
@jonahgraham
Copy link
Contributor Author

The last iteration of Jenkins all browswer tests passed: https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/PR-2825/2/testReport/org.eclipse.swt.tests.junit/Test_org_eclipse_swt_browser_Browser/

I would like to merge this now as I have a number of other commits related to #2824 that sit on top of this.

@jonahgraham
Copy link
Contributor Author

The Jenkins build ran against #2838 and shows my whole collection of commits to remove warnings has been successful. As I don't think there is anything controversial or risky about this change I am merging now.

@jonahgraham jonahgraham merged commit 258098c into eclipse-platform:master Dec 2, 2025
10 of 12 checks passed
@jonahgraham jonahgraham deleted the local-webserver-http branch December 2, 2025 17:31
@jonahgraham
Copy link
Contributor Author

Whoops - too many open PRs. #2825 (comment) was a comment meant for #2837

Anyways, this is now merged. If there is any concern I will address it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants