From 8cf458cc653fc7baec6cb73da6e839bd3675ee93 Mon Sep 17 00:00:00 2001
From: ahmedk <karim.ahmed@xfel.eu>
Date: Mon, 8 Jan 2024 08:40:40 +0100
Subject: [PATCH] remove automated_test key for setup and don't assume
 availability of retrieved-constant key for all detectors

---
 .gitlab-ci.yml                                   |  2 +-
 setup.py                                         | 11 -----------
 tests/test_reference_runs/test_pre_deployment.py |  4 ++--
 3 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7ae2b28ae..4af4e454c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -64,7 +64,7 @@ automated_test:
   <<: *before_script
   script:
     - export LANG=C  # Hopefully detect anything relying on locale
-    - python3 -m pip install ".[automated_test]"
+    - python3 -m pip install ".[test]"
     - echo "Running automated test. This can take sometime to finish depending on the test data."
     - echo "Given variables are REFERENCE=$REFERENCE, OUTPUT=$OUTPUT, DETECTORS=$DETECTORS, CALIBRATION=$CALIBRATION"
     - python3 -m pytest ./tests/test_reference_runs --color yes --verbose --release-test --reference-folder /gpfs/exfel/d/cal_tst/reference_folder --out-folder /gpfs/exfel/data/scratch/xcaltst/test/$OUTPUT  --detectors $DETECTORS --calibration $CALIBRATION
diff --git a/setup.py b/setup.py
index 180520a3d..879da9c40 100644
--- a/setup.py
+++ b/setup.py
@@ -162,17 +162,6 @@ setup(
             "testpath",
             "unittest-xml-reporting==3.0.2",
         ],
-        "automated_test": [
-            "coverage",
-            "deepdiff==6.7.1",
-            "nbval",
-            "pytest-asyncio",
-            "pytest-cov",
-            "pytest-subprocess",
-            "pytest>=5.4.0",
-            "testpath",
-            "unittest-xml-reporting==3.0.2",
-        ],
         "dev": [
             "nbqa[toolchain]",
             "pre-commit",
diff --git a/tests/test_reference_runs/test_pre_deployment.py b/tests/test_reference_runs/test_pre_deployment.py
index 75bb05ed7..344be0cac 100644
--- a/tests/test_reference_runs/test_pre_deployment.py
+++ b/tests/test_reference_runs/test_pre_deployment.py
@@ -371,9 +371,9 @@ def test_xfel_calibrate(
         metadata_file = f"calibration_metadata_{cal_conf['karabo-id']}.yml"
         # Load the relevant section from both files
         ccvs_test = load_yaml(
-            out_folder / metadata_file)["retrieved-constants"]
+            out_folder / metadata_file).get("retrieved-constants", {})
         ccvs_reference = load_yaml(
-            reference_folder / metadata_file)["retrieved-constants"]
+            reference_folder / metadata_file).get("retrieved-constants", {})
         ccvs_diff = DeepDiff(ccvs_test, ccvs_reference, ignore_order=True)
         assert ccvs_diff == {}, "Found difference in the metadata for the retrieved Constants."  # noqa
         LOGGER.info("Retrieved CCVs validated.")
-- 
GitLab