TEST: Run the cloud tests again, and let a property have no value - #178
jwrosewell wants to merge 1 commit into
Conversation
Two cloud test classes were turned off in May 2025 with no reason given, so ValueCloudTests and MissingPropertyHandlingTests have not run since, six tests in all. Turning them back on showed two real problems. The fixture in MissingPropertyHandlingTests still named the element ip-intelligence, whereas the engine reads ip, so the test threw looking for a key the response did not have. The value type test asked every listed property for its value. A property the key is not entitled to, or one the client script populates, is listed but carries no value and gives a reason instead, and asking such a value for its type throws. It now reads whether there is a value first, checks that the reason was given when there is none, and checks the type when there is one. Checked against the live cloud with a paid key, ip-intelligence.cloud reports 12 tests run, none failing and none skipped, where before the change the six restored tests error.
Run on this branch: the cloud tests come back on, but nothing gives them a resource keyRun: https://github.com/51Degrees/ip-intelligence-java/actions/runs/35192147021 The workflow was dispatched against this branch to get real evidence in place of the link lint a draft gets. It built the branch on its own as pull request 0, so nothing was merged. What passedThe on premise side is fine. The Ubuntu ARM Java 17 job reports "Tests run: 3, Failures: 0, Errors: 0, Skipped: 0", then "Tests run: 22, Failures: 0, Errors: 0, Skipped: 2" and "Tests run: 22, Failures: 0, Errors: 0, Skipped: 1", and the IP Intelligence, Shared, On Premise and Translation modules are all SUCCESS. What failed, and why it is about this branchThe Cloud module fails, and the run ends with "Tests run: 12, Failures: 0, Errors: 4" and BUILD FAILURE. All four errors are the same, on The four are The cause is in secrets:
token: ${{ secrets.ACCESS_TOKEN }}
IpIntelligenceUrl: ${{ secrets.IPI_DATA_FILE_URL }}There is no So turning the cloud tests back on needs one more line in the workflow, giving I have not picked one, because which key to use is an entitlement question rather than a formatting one. The key has to actually carry the IP intelligence properties these tests read, and a key that does not will come back saying the property is a paid feature, or will return no element data for the component at all, which reads like a broken service when it is the entitlement working correctly. Worth confirming which key carries them before wiring it in. A second, separate failure in the same runThe integration step then failed for a different reason, the same one on the sibling branch that adds the dry run input:
The pull request has not been marked ready and no review has been requested. |
What is wrong
ValueCloudTestsandMissingPropertyHandlingTestsboth carry a class level@Ignore, added on 28 May 2025 in commitbc5559c, "TEST: Ignore cloud tests",with no reason recorded. Six tests have not run since, anywhere, and the jobs
have reported success the whole time. They are the only tests this repository
has for reading values out of a cloud answer.
Turning them back on showed two real problems.
MissingPropertyHandlingTestsnames the elementip-intelligence. The engine readsip, which is whatIPIntelligenceCloudEngine.getElementDataKey()returns and what the servicesends, so both tests threw
JSONObject["ip"] not found.ValueTests.valueTypesasks every listed property for its value and itstype. A property the resource key is not entitled to, or one the client
script populates, is listed but carries no value and gives a reason instead,
and asking such a value for its type throws. With a paid key the failure is
ip is a paid feature.The change
ip.ValueTests.valueTypesreadshasValue()first. Where there is no value itchecks that the reason was given, which is what a caller reads, and moves on.
Where there is a value the type check is unchanged. Nothing is skipped
silently.
How it was checked
mvn -pl ip-intelligence.cloud -am testagainsthttps://cloud.51degrees.comwith
TestResourceKeyset to a paid key, on 17 September 2026:@Ignoreremoved and nothing else changed,Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, the six errors being thetwo problems above;
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0.ValueCloudTestsneedsevidence.csvfrom the data repository, which theintegration job already fetches.
Still outstanding
CloudRequestOriginTests.ResourceKeyWithOrigincarries its own@Ignoreand aresource key written into the source. That one needs a decision about which key
it should use before it can run, so it is left alone here.
The pull request and nightly jobs of this repository pass no test resource key
to the shared workflow, so the cloud tests that read one still ask to be skipped
in CI even with this change. That is covered in
#177, and adding
the secret is a change for a person to make.
The same change in the other repositories
device-detection-java#590
makes the same change to both copies of
ValueTests.valueTypesthere, wherethe same walk hits a property the 51Degrees client script populates.
Why this is still a draft, 17 September 2026
Three things stand between this branch and a green run, and none of them is in
this change.
ci/run-integration-tests.ps1still clonesip-intelligence-java-examplesat this branch's own name, which does notexist there, so the step ends with
fatal: Remote branch <branch> not found in upstream origin..github/workflows/pull-requests.ymlpasses noTestResourceKeyto the shared workflow, so a cloud test either skips orfails with
A resource key is required to access the cloud server.Points 1 and 2 are fixed by
#180, which falls
back to
mainwhen the branch has no twin in the examples repository and passesthe bespoke resource key secret to the pull request and nightly jobs. Its own run
35252381918
shows both working, with the line
No 'fix/pr-workflow-examples-branch-and-key' branch in 'ip-intelligence-java-examples', using 'main'and no resource key error anywhere in the log.
Point 3 is what that run then failed on, in the examples repository rather than
here:
So this pull request stays a draft until #180 has merged and the
CompareOnPremTestfailure inip-intelligence-java-exampleshas been cleared.Both are outside this repository's control, so someone with the examples
repository and the CI secrets has to clear them.