Skip to content

test: no test reaches a real server - #240

Merged
Xyzcancer merged 4 commits into
masterfrom
test/no-live-server
Nov 16, 2026
Merged

Xyzcancer merged 4 commits into
masterfrom
test/no-live-server

Conversation

@Xyzcancer

Copy link
Copy Markdown
Contributor
  • The unit-test task routes every connection to another host to a SOCKS proxy that does not exist, so a request that would reach a server fails at once; this machine (MockWebServer), .test hosts and Maven Central (Robolectric's jars) stay direct. NoLiveServerGuardTest pins it.
  • The demo's instrumented tests against the live API (core, two shops, catalog, loyalty, orders, purchase, tracking namespace) and their test runner are removed. Their contracts are pinned by mocked unit tests; orders had none, so OrdersManagerImplTest checks orders/by_user and orders/last_for_user against the documented requests and answers.

The unit-test task routes every connection to a host other than this machine to a SOCKS proxy that
does not exist, so a request that would reach a server fails at once. This machine (MockWebServer),
hosts of the reserved .test domain that tests map to it with their own DNS, and Maven Central, where
Robolectric fetches its Android jars on a fresh machine, stay direct. http and https URLs read
http.nonProxyHosts, so both lists carry the exemptions. NoLiveServerGuardTest pins the guard.
…ck: orders/by_user and orders/last_for_user, their params, the documented answers and errors
They checked the work of a real server and a real shop, not the SDK's contract, and every contract
they touched is pinned on a mock: profile, counters, category, loyalty, orders, the tracking namespace
and purchase, two shops in one process, both cores. The demo's test runner, which only served the live
core test, goes with them.
@Xyzcancer
Xyzcancer merged commit 280d61e into master Nov 16, 2026
1 check passed
@Xyzcancer
Xyzcancer deleted the test/no-live-server branch November 16, 2026 17:30
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