From 4a29d29cea1f3d6078b3726519d0cd0a9325e1ec Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <thomas@kluyver.me.uk>
Date: Tue, 9 Mar 2021 15:03:24 +0000
Subject: [PATCH] Add testing section to webservice README

---
 webservice/README.md | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/webservice/README.md b/webservice/README.md
index fef79ac81..a2921c4bc 100644
--- a/webservice/README.md
+++ b/webservice/README.md
@@ -155,3 +155,37 @@ Use
    ```
 
 to display a list of available options.
+
+Testing
+-------
+
+There is a test environment on ``max-exfl017``, separate from the production
+instance.
+
+```bash
+ssh xcaltst@max-exfl017.desy.de
+cd /home/xcaltst/pycalibration
+
+# Get the code you want to test 
+git pull
+git checkout <branch-to-test>
+
+# Stop the already running server, start a new one with your code
+ps aux | grep webservice/webservice.py | awk '{ print $2}' | xargs kill
+source ~/pycalibration_venv/bin/activate
+nohup ~/pycalibration_venv/bin/python ~/pycalibration/webservice/webservice.py \
+  --mode prod --logging INFO --config-file ~/pycalibration/webservice/webservice.yaml &
+
+# Follow the logs
+tail -f ~/pycalibration/web.log
+```
+
+The [test instance of myMdC](https://in.xfel.eu/test_metadata/) talks to this
+test service. Using data in the [CALLAB proposal](https://in.xfel.eu/test_metadata/proposals/259)
+there, request recalibration ([runs tab](https://in.xfel.eu/test_metadata/proposals/259#proposal-runs))
+and processing of dark runs ([calibration constants tab](https://in.xfel.eu/test_metadata/proposals/259#proposal-calibration))
+to send the 'correct' and 'dark_request' actions. The webservice logs and the
+status in myMdC should update as the processing occurs.
+
+The command ``squeue -u xcaltst`` will show running & pending Slurm jobs started
+by this test system.
-- 
GitLab