Skip to content

Make Geocoding test with remote service optional#472

Merged
chrismayer merged 1 commit into
wegue-oss:masterfrom
chrismayer:geocode-test-handle-remote-fails
Jan 22, 2026
Merged

Make Geocoding test with remote service optional#472
chrismayer merged 1 commit into
wegue-oss:masterfrom
chrismayer:geocode-test-handle-remote-fails

Conversation

@chrismayer
Copy link
Copy Markdown
Collaborator

@chrismayer chrismayer commented Dec 17, 2025

This ensures that our unit test suite does not fail in case the remote Geocoding service is not available. This service is external and unrelated to Wegue and thus leading to unwanted unit test failures.

If the "real" Geocoding API fails due to network issues in the tests this is now caught and the tests are skipped. Only "real" errors are forwarded, so the test suite can fail.

Note: Based on #471, so this needs to be merged first.

Copy link
Copy Markdown
Collaborator

@sronveaux sronveaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chrismayer

Thanks for adding this, this remote service test is really interesting and important but is a functional test, not a unit test. This means it can fail from time to time which is not good when used inside a build hook like here.

It seems #471 is present inside this PR... depending whether some changes are done inside it before merge, this one will need to be amended afterwards...

I think for this patch to work as expected, you'd need to add the condition I added in commentary otherwise it will not skip the test in case the server never replies at all. You can test this case very easily by forcing the url where requests are done with an IP address from a private range like http://10.255.255.1. You can easily force it directly in GeocoderController.js by setting url: "http://10.255.255.1",

I propose to wait for #471 to be adressed before including this one, or at least it should be curated and include only changes inside Geocoder.spec.js...

Comment thread tests/unit/specs/components/geocoder/Geocoder.spec.js Outdated
@chrismayer chrismayer force-pushed the geocode-test-handle-remote-fails branch from c3d0916 to 7e0ef1e Compare January 21, 2026 13:57
@chrismayer
Copy link
Copy Markdown
Collaborator Author

Thanks for your review @sronveaux . Since #471 is merged now I rebased this PR. I also added an additional check for ECONNABORTED as suggested by you. Please review again. TIA!

@chrismayer chrismayer requested a review from sronveaux January 21, 2026 14:01
Copy link
Copy Markdown
Collaborator

@sronveaux sronveaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chrismayer,

Thanks for taking this back. I dis some test thoroughly and it works like a charm! That's a nice addition for the CI pipeline!

While parsing the modified unit test, I came across a design flaw inside the test suite including it and made a simple suggestion to make the test even more future-proof. However I let you choose whether it should be applied or not, the PR is approved and ready to merge!

Comment thread tests/unit/specs/components/geocoder/Geocoder.spec.js
@chrismayer
Copy link
Copy Markdown
Collaborator Author

Thanks for your ongoing review @sronveaux ...I am going to merge now.

@chrismayer chrismayer merged commit 2429f68 into wegue-oss:master Jan 22, 2026
1 check passed
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.

2 participants