test: add internal semantic smoke
This commit is contained in:
@@ -102,7 +102,13 @@ checker=(node --import "$tsx_loader" "$root/scripts/task13-runtime-fixture-check
|
||||
}
|
||||
"${checker[@]}" "$rendered" "$workspace" "$profile"
|
||||
|
||||
for mutation in wrong-service wrong-value wrong-secret-mount; do
|
||||
for mutation in \
|
||||
wrong-service \
|
||||
wrong-value \
|
||||
wrong-secret-mount \
|
||||
wrong-qdrant-service \
|
||||
wrong-embedding-service \
|
||||
external-semantic-urls; do
|
||||
mutated="$fixture/$mutation.json"
|
||||
node - "$rendered" "$mutated" "$mutation" <<'NODE'
|
||||
const fs = require("fs");
|
||||
@@ -115,8 +121,15 @@ if (mutation === "wrong-service") {
|
||||
delete config.services.core.environment[name];
|
||||
} else if (mutation === "wrong-value") {
|
||||
config.services.core.environment.THT_WS_TASK13_SMOKE_DWH_HOST = "wrong.task13.invalid";
|
||||
} else {
|
||||
} else if (mutation === "wrong-secret-mount") {
|
||||
config.secrets.thothii_secrets.file = source + ".missing";
|
||||
} else if (mutation === "wrong-qdrant-service") {
|
||||
config.services.core.environment.THT_INTERNAL_QDRANT_URL = "http://vector:6333";
|
||||
} else if (mutation === "wrong-embedding-service") {
|
||||
config.services.core.environment.THT_INTERNAL_EMBEDDING_URL = "http://ollama:11434";
|
||||
} else if (mutation === "external-semantic-urls") {
|
||||
config.services.core.environment.THT_INTERNAL_QDRANT_URL = "https://qdrant.example.test";
|
||||
config.services.core.environment.THT_INTERNAL_EMBEDDING_URL = "https://embedding.example.test";
|
||||
}
|
||||
fs.writeFileSync(destination, JSON.stringify(config));
|
||||
NODE
|
||||
@@ -127,4 +140,28 @@ NODE
|
||||
fi
|
||||
done
|
||||
|
||||
for mutation in collection-reuse dimension-change; do
|
||||
mutated="$fixture/$mutation.yaml"
|
||||
node - "$root/backend/package.json" "$workspace" "$mutated" "$mutation" <<'NODE'
|
||||
const fs = require("fs");
|
||||
const { createRequire } = require("module");
|
||||
const requireFromBackend = createRequire(process.argv[2]);
|
||||
const yaml = requireFromBackend("yaml");
|
||||
const [source, destination, mutation] = process.argv.slice(3);
|
||||
const workspace = yaml.parse(fs.readFileSync(source, "utf8"));
|
||||
if (mutation === "collection-reuse") {
|
||||
workspace.semantic_index.vector_store.collection = "shared-semantic";
|
||||
} else if (mutation === "dimension-change") {
|
||||
workspace.semantic_index.vector_store.dimensions = 1536;
|
||||
workspace.semantic_index.embedding.dimensions = 1536;
|
||||
}
|
||||
fs.writeFileSync(destination, yaml.stringify(workspace));
|
||||
NODE
|
||||
if "${checker[@]}" "$rendered" "$mutated" "$profile" \
|
||||
>"$fixture/$mutation.out" 2>"$fixture/$mutation.err"; then
|
||||
echo "runtime fixture checker accepted workspace mutation: $mutation" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Task 13 $profile rendered runtime fixture contract passed."
|
||||
|
||||
Reference in New Issue
Block a user