docs: add testing instructions for developers
@@ -32,7 +32,36 @@ Liqo leverages lerna-changelog to create the changelog of a certain version. PRs
Liqo components can be developed locally. We provide a [deployment script](/examples/kind.sh) to spawn multiple
kubernetes clusters by using [Kind](https://kind.sigs.k8s.io/) with Liqo installed. This script can be used as a starting
-point to improve/replace one Liqo component.
+point to improve/replace one Liqo component:
+
+ 1. deploy Liqo on a local Kind cluster;
+ 2. `describe` the pod running the component you wish to replace, and copy its command-line flags;
+ 3. `scale --replicas=0` the component;
+ 4. run the component on the host, with the command-line flags you copied before.
+
+#### Running tests
+
+You can use the `liqo-test` Docker image (in `build/liqo-test`) to run tests: just mount the repository in `/go/src/github.com/liqotech/liqo` inside the container.
+
+If you want to debug tests, you can use Delve for remote debugging:
+
+ 1. Start the container with an idle entrypoint, exposing a port of choice (e.g. 2345):
+
+ docker run --name=liqo-test -d -p 2345:2345 -v /c/liqo:/go/src/github.com/liqotech/liqo --entrypoint="" liqo-test tail -f /dev/null
+
+ 2. Open a shell into the container:
+
+ docker exec -it liqo-test bash
+
+ 3. Once inside the container, install Delve:
+
+ go install github.com/go-delve/delve/cmd/dlv@latest
+
+ 4. Run a specific test inside the container:
+
+ dlv test --headless --listen=:2345 --api-version=2 --accept-multiclient ./pkg/liqo-controller-manager/foreign-cluster-operator/
+
+ 5. From the host, connect to `localhost:2345` with your remote debugging client of choice (e.g. [GoLand](https://www.jetbrains.com/help/go/attach-to-running-go-processes-with-debugger.html#step-3-create-the-remote-run-debug-configuration-on-the-client-computer)).
### Pull Requests
