fix(device-core): adopt legacy model profiles safely
This commit is contained in:
+14
@@ -17,3 +17,17 @@ test("catalog, Edge and route upserts enforce irreversible lifecycle transitions
|
||||
assert.doesNotMatch(source, /device_(?:adapter_versions|model_profiles|edges|routes)\.lifecycle_state = 'retired'[\s\S]{0,160}excluded\.lifecycle_state = 'active'/);
|
||||
});
|
||||
|
||||
test("legacy model adoption is a one-way exact-identity registry transition", async () => {
|
||||
const source = await readFile(
|
||||
new URL("../src/infrastructure-repository.mjs", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
assert.match(source, /profile ->> 'schemaVersion' = excluded\.schema_version/);
|
||||
assert.match(source, /profile ->> 'profileRef' = excluded\.profile_ref/);
|
||||
assert.match(source, /profile ->> 'vendor' = excluded\.vendor/);
|
||||
assert.match(source, /profile ->> 'model' = excluded\.model/);
|
||||
assert.match(source, /profile ->> 'deviceType' = excluded\.device_type/);
|
||||
assert.match(source, /profile ->> 'protocol' = excluded\.protocol/);
|
||||
assert.match(source, /adapter_version_id is null[\s\S]*schema_artifact_ref is null[\s\S]*profile_digest is null[\s\S]*cardinality\(device_model_profiles\.capabilities\) = 0[\s\S]*lifecycle_state = 'active'[\s\S]*excluded\.lifecycle_state = 'draft'/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user