Preparing the servers your app depends on

in Japanese(日本語)

Put the servers, DBs and stubs your own app (for example the test project myshop) uses into containers and declare them to fleetest. This is not needed if you only connect to an existing server. How to read the declaration and how to start it are in the tutorial with the sample app.

1. Declare the servers and check them

Prompt for the AI

Build the image myapp-server:local from the Dockerfile in <server folder> and declare it in
TestProjects/myshop/workspace/scripts/compose.yaml of the fleetest test project myshop. If there is no Dockerfile, create one
(split a build stage from a run stage, and include a command the healthcheck uses to read /health (curl or wget) in the run stage). Publish the port on 127.0.0.1:8080. Write a healthcheck.
If you use Apple Container, first enlarge the builder VM with `container builder stop && container builder start --cpus 6 --memory 8g`.
Make the app's server address switchable in the build settings: http://127.0.0.1:8080 for the iOS Simulator build and http://10.0.2.2:8080 for the Android Emulator build.
Rebuild both and update the paths in the app profile.
Check the start-up with fleetest services up --project myshop, confirm that /health returns ok, then services down and report the result.

Expected result:

2. Point the app at the server

The iOS Simulator build points at 127.0.0.1 and the Android Emulator build at 10.0.2.2 (the prompt above includes this). Physical devices differ by OS.

3. Things you write yourself

Do not have the AI assistant write them.

When you fix the server, ask the AI to rebuild the image under the same name.

Related:


Next: Testing an app that needs a login