Repository navigation
Build the Device Detection example tests from a fresh clone - #187
Merged
Merged
Conversation
…ough the examples' own helpers
Draft
jwrosewell
marked this pull request as ready for review
November 16, 2026 13:29
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The specification this brings the code into conformance with
device-detection-specification/required-examples.md lines 90 to 96 at dbaf099c says
A fresh clone could not even build the Device Detection console examples, so it could not run them.
The problem
Run 43805804600, the push of
rc20f9089, failed the job "device-detection on ubuntu-latest, downloading its data file" at the step "Build the console examples against the published packages", withCOMPILATION ERRORand "cannot find symbol" inGettingStartedOnPremTest,ManualDataUpdateTest,MetadataOnPremTest,OfflineProcessingTestandUpdateDataFileTest.#175 moved the Device Detection test helpers out of
device-detection.shared'ssrc/mainand into itssrc/testunder the new namesTestFileUtilsandTestKeyUtils. Six example test files import those names. The examples takedevice-detection.sharedas a test jar atdevice-detection.version, which is 4.5.130 (examples/device-detection/pom.xmlline 53), the version already on Maven Central, and a published jar cannot hold classes a later pull request created.mvn -pl console -am package -DskipTestsstill compiles the test sources, so the build stops there.The examples build this way on purpose, because a developer who copies an example builds it against the packages they can download. So the fix is for the example tests to stop reaching into a package's test jar.
What changed
Links are to the head.
DataFileHelper.getDataFileLocation(null)for the data file,DataFileHelper.getEvidenceFile(null)for the evidence, andKeyHelper.getNamedKeyandKeyHelper.isInvalidKeyfor the licence key. Those helpers are inexamples/device-detection/shared, which every example module already depends on and which is built from the clone, so nothing published is needed.getDataFileLocation(null)looks for the TAC file, then the Enterprise file, then the free Lite file, which is the orderTestFileUtils.getHashFile()used, and where a free file is missing it follows the data repository's link and downloads it. The web test's property is set the same way, so it no longer needs its own fallback.The poms are unchanged.
device-detection.shared's test jar stays a declared test dependency, because the surefire listener the examples configure,fiftyone.devicedetection.shared.testhelpers.MavenRunListener, is insrc/testonrcand in the published 4.5.130 main jar, so the declaration is what keeps it resolving after Java next publishes.No package code changes, and no public name is removed or renamed.
Tests
The test here is the "Examples from a fresh clone" workflow itself, which builds the console examples against the published packages from a clone with its submodules.
Red, run 43805804600 on
rc20f9089, the commit this branch starts from. The device-detection job failed in "Build the console examples against the published packages". The same failure is on run 43856166324, the check on #177 afterrcwas merged into it, which shows the fault reaches every draft that takesrcuntil this one is in.Green, run 43855038132 on the head 37dccf3. All four jobs passed, being device-detection and ip-intelligence on ubuntu-latest downloading their data files, and both on windows-latest taking them from the cache.
Build
Run 43855879243 built 37dccf3 merged with
rc20f9089 on nine configurations, Ubuntu x64 with Java 8, 11, 17 and 21, Ubuntu arm64 with Java 17, and Windows with Java 8, 11, 17 and 21, and every job passed. Each of its tenSetting 'PullRequestSha'lines names 37dccf3, and its Configure job printed "Left out 6 macOS entries".macOS was left out of this draft's full build. The rc head is built with macOS before it merges into main.
What remains
GettingStartedOnPremTestandUpdateDataFileTestfrom the older base where the names were stillFileUtilsandKeyUtils, and itsUpdateDataFileTestis the same text as this one. When Add the Metrics component and the profiles for a property value, and read Device Detection results by position under one lock #174 takesrcafter this merges, its copies of those two files go andrc's are kept.examples/fails the fresh clone check until this is inrc, because each one carriesrc's renamed helpers without this fix. Each needsrcmerged in again afterwards.