Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

Conformance cases /

derived-fan-out-missing

Tests one part of the structure checks.

Our implementation passes this case when its check --json output for the input below equals the expected output.

Input

nodes/d-name.md
---
id: d-name
type: derived
fields:
  name: name
  template: '{id}-{runs-in/token}'
  applies_to: {type: db}
---
nodes/dangling.md
---
id: dangling
type: db
links:
  - {type: runs-in, to: nowhere}
---
nodes/e1.md
---
id: e1
type: env
fields:
  token: dev
---
nodes/e2.md
---
id: e2
type: env
fields:
  token: prod
---
nodes/no-token.md
---
id: no-token
type: env
---
nodes/none.md
---
id: none
type: db
---
nodes/two.md
---
id: two
type: db
links:
  - {type: runs-in, to: e2}
  - {type: runs-in, to: e1}
---
nodes/wrong-end.md
---
id: wrong-end
type: db
links:
  - {type: runs-in, to: no-token}
---

Expected output

0 ghosts · 0 load errors · 8 nodes · 0 results

expected.json
{
 "ghosts": [],
 "load_errors": [],
 "nodes": [
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "db"
    },
    "name": "name",
    "template": "{id}-{runs-in/token}"
   },
   "id": "d-name",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "d-name",
   "type": "derived"
  },
  {
   "body": "",
   "derived": {
    "name": {
     "missing": [
      "runs-in/token"
     ]
    }
   },
   "fields": {},
   "id": "dangling",
   "links": [
    {
     "to": "nowhere",
     "type": "runs-in"
    }
   ],
   "parent": null,
   "plane": null,
   "title": "dangling",
   "type": "db"
  },
  {
   "body": "",
   "fields": {
    "token": "dev"
   },
   "id": "e1",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "e1",
   "type": "env"
  },
  {
   "body": "",
   "fields": {
    "token": "prod"
   },
   "id": "e2",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "e2",
   "type": "env"
  },
  {
   "body": "",
   "fields": {},
   "id": "no-token",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "no-token",
   "type": "env"
  },
  {
   "body": "",
   "derived": {
    "name": {
     "missing": [
      "runs-in/token"
     ]
    }
   },
   "fields": {},
   "id": "none",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "none",
   "type": "db"
  },
  {
   "body": "",
   "derived": {
    "name": {
     "values": [
      "two-dev",
      "two-prod"
     ]
    }
   },
   "fields": {},
   "id": "two",
   "links": [
    {
     "to": "e2",
     "type": "runs-in"
    },
    {
     "to": "e1",
     "type": "runs-in"
    }
   ],
   "parent": null,
   "plane": null,
   "title": "two",
   "type": "db"
  },
  {
   "body": "",
   "derived": {
    "name": {
     "missing": [
      "runs-in/token"
     ]
    }
   },
   "fields": {},
   "id": "wrong-end",
   "links": [
    {
     "to": "no-token",
     "type": "runs-in"
    }
   ],
   "parent": null,
   "plane": null,
   "title": "wrong-end",
   "type": "db"
  }
 ],
 "results": [],
 "structure": {
  "errors": [
   {
    "kind": "missing_link_target",
    "node": "dangling",
    "ref": "runs-in->nowhere"
   }
  ],
  "warnings": []
 }
}