tests: fix the comfyui Containerfile test instead of living with it red
This test failed on a clean tree for many sessions, and the working belief became "test 73 is a known failure, ignore it" — which is exactly what a permanently red suite teaches. The cause was a selector bug: `find dankclaw -name 'Containerfile*' | head -1` returned whichever Containerfile the directory listing happened to put first (dankclaw/alloy/Containerfile), so the assertion read a file that never claimed to be ComfyUI's. It would equally have passed on a wrong file. The test now resolves the Containerfile the way the build does — build.context joined with build.dockerfile, both read from dankclaw/compose.yaml — so it checks the file the deploy actually builds (dankclaw/Containerfile.comfyui, the one compose, deploy-remote.sh and the ComfyUI doc all name) and follows a future rename instead of guessing. Suite: ALL TESTS PASSED (310), no exceptions to explain away.
This commit is contained in:
1 parent
56edfabb19
commit
3d5b1f44a6
1 file changed
+19
-2
+19
-2
@@ -34,9 +34,26 @@ PYEOF
|
||||
}
|
||||
|
||||
@test "comfyui Containerfile is based on the gfx1151 torch image" {
|
||||
# Resolve the Containerfile the way the build does — build.context joined
|
||||
# with build.dockerfile — rather than asking the filesystem. A
|
||||
# `find … | head -1` here returned whichever Containerfile the directory
|
||||
# listing happened to put first (dankclaw/alloy/Containerfile), so the test
|
||||
# failed for sessions while the real ComfyUI Containerfile was correct — and
|
||||
# it would equally have passed on a wrong file.
|
||||
local cf
|
||||
cf=$(find "$REPO_ROOT/dankclaw" -name 'Containerfile*' 2>/dev/null | head -1)
|
||||
[ -n "$cf" ] || { echo "no Containerfile under dankclaw/"; return 1; }
|
||||
cf=$(python3 - "$REPO_ROOT/dankclaw/compose.yaml" "$REPO_ROOT/dankclaw" <<'PYEOF'
|
||||
import os, sys, yaml
|
||||
with open(sys.argv[1]) as fh:
|
||||
svc = yaml.safe_load(fh)["services"]["comfyui"]
|
||||
build = svc.get("build") or {}
|
||||
# Compose resolves dockerfile relative to context, context relative to the
|
||||
# compose file's own directory.
|
||||
print(os.path.normpath(os.path.join(
|
||||
sys.argv[2], build.get("context", "."), build.get("dockerfile", "Containerfile"))))
|
||||
PYEOF
|
||||
)
|
||||
[ -n "$cf" ] || { echo "could not resolve the comfyui Containerfile"; return 1; }
|
||||
[ -f "$cf" ] || { echo "$cf (from compose build) does not exist"; return 1; }
|
||||
grep -q "gfx1151" "$cf" || { echo "$cf does not reference gfx1151"; return 1; }
|
||||
grep -q "FROM" "$cf" || { echo "$cf has no FROM"; return 1; }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user