Skip to content

Let the web examples find their folder and their data from wherever they run - #7

Merged
ben51degrees merged 1 commit into
mainfrom
fix/web-example-resolve-folder-from-main
Nov 2, 2026
Merged

ben51degrees merged 1 commit into
mainfrom
fix/web-example-resolve-folder-from-main

Conversation

@ben51degrees

Copy link
Copy Markdown
Contributor

The rerun of the Publish dry run passed every Maven test on every platform and then failed the Selenium contract tests on the six x64 and macOS jobs: all nine cases timed out with the page loaded but the core script never defined.

Cause

The earlier change that named the Device Detection web examples' webapp folder in full fixed the test, which resolves the folder by searching, but the examples' own main method hands that folder to Jetty as a path relative to the working directory. The contract run starts the jar from inside examples/device-detection, so Jetty got examples/device-detection/examples/device-detection/... and served an empty application. The Jetty log line in the job shows exactly that doubled path.

Changes

  • Both Device Detection web examples resolve the folder by searching in main as well, so they run from the repository root or from inside their tree.
  • The example configurations' default data file paths pointed at the data folders where the separate repositories kept them. They now point at the folders inside the cxx submodule, so an example started from the repository root finds the free data file. The tests were unaffected because they pass the data file in.

What was checked

  • The on-premise web example, built against the reactor and started from the repository root, answers 200, its page carries the apple-detection element and the core script tag, and /51Degrees.core.js serves 51 KB that defines fod. Jetty logs the right folder.
  • The cloud example needs a resource key, so its check is the rerun of the dry run's Test jobs after this merges.

…hey run

The two Device Detection web examples handed Jetty their webapp folder as a
path relative to the working directory, so starting them from inside
examples/device-detection, as the Selenium contract run does, doubled the
path and Jetty served nothing. They now resolve the folder by searching, as
their tests already did.

The example configurations' default data file paths pointed at the data
folders as they were in the separate repositories. They now point at the
folders inside the cxx submodule, so an example run from the repository
root finds the free data file without being told where it is.
@ben51degrees
ben51degrees marked this pull request as ready for review November 2, 2026 18:11
@ben51degrees
ben51degrees merged commit cbbfcb3 into main Nov 2, 2026
1 check passed
@ben51degrees
ben51degrees deleted the fix/web-example-resolve-folder-from-main branch November 2, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant