rss-skip-on-error.json 2.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {
  2. "name": "verify-rss-skip-on-error",
  3. "nodes": [
  4. {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "dead", "name": "Dead Feed", "type": "rss-reader", "position": {"x": -150, "y": 100},
  6. "config": {"url": "http://10.255.255.1/feed.xml", "timeout": 1000, "retries": 0,
  7. "skipOnError": true, "detectNewItems": false, "maxItems": 0}},
  8. {"id": "alive", "name": "Live Feed", "type": "code", "position": {"x": 150, "y": 100},
  9. "config": {"code": "return { items: [ { title: 'one', enclosure: { url: 'https://cdn/1.jpg' } }, { title: 'two', enclosure: { url: 'https://cdn/2.jpg' } } ] };"}},
  10. {"id": "merge", "name": "Merge", "type": "merge", "position": {"x": 0, "y": 220},
  11. "config": {"mode": "combine-by-key", "key": "enclosure.url", "path1": "items", "path2": "result.items"}},
  12. {"id": "check", "name": "Check", "type": "code", "position": {"x": 0, "y": 340},
  13. "config": {"code": "const d = input.data || input; return { survived: (d.merged || []).length };"}}
  14. ],
  15. "connections": [
  16. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "dead", "targetInput": "data"},
  17. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "alive", "targetInput": "data"},
  18. {"sourceNodeId": "dead", "sourceOutput": "main", "targetNodeId": "merge", "targetInput": "input1"},
  19. {"sourceNodeId": "alive", "sourceOutput": "main", "targetNodeId": "merge", "targetInput": "input2"},
  20. {"sourceNodeId": "merge", "sourceOutput": "main", "targetNodeId": "check", "targetInput": "data"}
  21. ],
  22. "expectStatus": "completed",
  23. "expect": {
  24. "dead": {
  25. "status": "completed",
  26. "errorContains": "HTTP request failed",
  27. "output": {"success": false, "itemCount": 0}
  28. },
  29. "merge": {"status": "completed", "output": {"count": 2}},
  30. "check": {"status": "completed", "output": {"result": {"survived": 2}}}
  31. },
  32. "expectExecution": {
  33. "toleratedErrorCount": 1
  34. }
  35. }