Przeglądaj źródła

test: stop asserting which model happens to be loaded on the server

Both sdcpp fixtures named SD1x/AnythingXL_v50 and SD 1.x. That was never a
property of the code - it was a property of whatever someone had last loaded on
a shared server - and both failed the moment a different model was loaded.

They now assert the behaviour instead: whichever model the server has,
following it means Load Model finds it already there and does not reload. That
is the thing worth testing, and it holds whatever is loaded.

Caught by the suite after the server's model changed under it. Full suite
58/58.
fszontagh 1 miesiąc temu
rodzic
commit
24e2aa0134

+ 59 - 11
tests/nodes/sdcpp-model-follow-loaded.json

@@ -1,20 +1,68 @@
 {
   "name": "verify-sdcpp-model-follow-loaded",
   "nodes": [
-    {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
-    {"id": "pick", "name": "Model", "type": "sdcpp-model", "position": {"x": -200, "y": 100},
-     "config": {"serverUrl": "http://mulan:8077", "source": "loaded"}},
-    {"id": "load", "name": "Load", "type": "sdcpp-model-load", "position": {"x": 0, "y": 250},
-     "config": {"serverUrl": "http://mulan:8077",
-                "credentialId": "cred_62748b40-e9d1-4659-b175-6dbc691cc0b1"}}
+    {
+      "id": "n1",
+      "name": "Trigger",
+      "type": "click-trigger",
+      "position": {
+        "x": 0,
+        "y": 0
+      },
+      "config": {}
+    },
+    {
+      "id": "pick",
+      "name": "Model",
+      "type": "sdcpp-model",
+      "position": {
+        "x": -200,
+        "y": 100
+      },
+      "config": {
+        "serverUrl": "http://mulan:8077",
+        "source": "loaded"
+      }
+    },
+    {
+      "id": "load",
+      "name": "Load",
+      "type": "sdcpp-model-load",
+      "position": {
+        "x": 0,
+        "y": 250
+      },
+      "config": {
+        "serverUrl": "http://mulan:8077",
+        "credentialId": "cred_62748b40-e9d1-4659-b175-6dbc691cc0b1"
+      }
+    }
   ],
   "connections": [
-    {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "load", "targetInput": "data"},
-    {"sourceNodeId": "pick", "sourceOutput": "main", "targetNodeId": "load", "targetInput": "config"}
+    {
+      "sourceNodeId": "n1",
+      "sourceOutput": "main",
+      "targetNodeId": "load",
+      "targetInput": "data"
+    },
+    {
+      "sourceNodeId": "pick",
+      "sourceOutput": "main",
+      "targetNodeId": "load",
+      "targetInput": "config"
+    }
   ],
   "expectStatus": "completed",
   "expect": {
-    "pick": {"status": "completed", "output": {"modelName": "SD1x/AnythingXL_v50.safetensors", "architecture": "SD 1.x"}},
-    "load": {"status": "completed", "output": {"alreadyLoaded": true, "loaded": false}}
+    "pick": {
+      "status": "completed"
+    },
+    "load": {
+      "status": "completed",
+      "output": {
+        "alreadyLoaded": true,
+        "loaded": false
+      }
+    }
   }
-}
+}

+ 86 - 17
tests/nodes/sdcpp-model-load-idempotent.json

@@ -1,26 +1,95 @@
 {
   "name": "verify-sdcpp-model-load-idempotent",
   "nodes": [
-    {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
-    {"id": "srv", "name": "SD.cpp Server", "type": "configurator", "position": {"x": -260, "y": 100},
-     "config": {"label": "SD.cpp Server", "settings": [
-       {"name": "serverUrl", "value": "http://mulan:8077"},
-       {"name": "credentialId", "value": "cred_62748b40-e9d1-4659-b175-6dbc691cc0b1"}
-     ]}},
-    {"id": "pick", "name": "Model", "type": "sdcpp-model", "position": {"x": -260, "y": 220},
-     "config": {"modelType": "checkpoint", "modelName": "SD1x/AnythingXL_v50.safetensors"}},
-    {"id": "load", "name": "Load", "type": "sdcpp-model-load", "position": {"x": 0, "y": 320},
-     "config": {}}
+    {
+      "id": "n1",
+      "name": "Trigger",
+      "type": "click-trigger",
+      "position": {
+        "x": 0,
+        "y": 0
+      },
+      "config": {}
+    },
+    {
+      "id": "srv",
+      "name": "SD.cpp Server",
+      "type": "configurator",
+      "position": {
+        "x": -260,
+        "y": 100
+      },
+      "config": {
+        "label": "SD.cpp Server",
+        "settings": [
+          {
+            "name": "serverUrl",
+            "value": "http://mulan:8077"
+          },
+          {
+            "name": "credentialId",
+            "value": "cred_62748b40-e9d1-4659-b175-6dbc691cc0b1"
+          }
+        ]
+      }
+    },
+    {
+      "id": "pick",
+      "name": "Model",
+      "type": "sdcpp-model",
+      "position": {
+        "x": -260,
+        "y": 220
+      },
+      "config": {
+        "source": "loaded"
+      }
+    },
+    {
+      "id": "load",
+      "name": "Load",
+      "type": "sdcpp-model-load",
+      "position": {
+        "x": 0,
+        "y": 320
+      },
+      "config": {}
+    }
   ],
   "connections": [
-    {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "load", "targetInput": "data"},
-    {"sourceNodeId": "srv", "sourceOutput": "main", "targetNodeId": "pick", "targetInput": "config"},
-    {"sourceNodeId": "srv", "sourceOutput": "main", "targetNodeId": "load", "targetInput": "config"},
-    {"sourceNodeId": "pick", "sourceOutput": "main", "targetNodeId": "load", "targetInput": "config"}
+    {
+      "sourceNodeId": "n1",
+      "sourceOutput": "main",
+      "targetNodeId": "load",
+      "targetInput": "data"
+    },
+    {
+      "sourceNodeId": "srv",
+      "sourceOutput": "main",
+      "targetNodeId": "pick",
+      "targetInput": "config"
+    },
+    {
+      "sourceNodeId": "srv",
+      "sourceOutput": "main",
+      "targetNodeId": "load",
+      "targetInput": "config"
+    },
+    {
+      "sourceNodeId": "pick",
+      "sourceOutput": "main",
+      "targetNodeId": "load",
+      "targetInput": "config"
+    }
   ],
   "expectStatus": "completed",
   "expect": {
-    "load": {"status": "completed", "output": {"alreadyLoaded": true, "loaded": false,
-             "modelName": "SD1x/AnythingXL_v50.safetensors"}}
+    "load": {
+      "status": "completed",
+      "output": {
+        "alreadyLoaded": true,
+        "loaded": false
+      }
+    }
   }
-}
+}