tests.json.template 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. %YAML 1.2
  2. --- |
  3. <%!
  4. import json
  5. def gen_one_target(tgt):
  6. out = {"name": tgt.name,
  7. "language": tgt.language,
  8. "platforms": tgt.platforms,
  9. "ci_platforms": tgt.ci_platforms,
  10. "gtest": tgt.gtest,
  11. "exclude_configs": tgt.get("exclude_configs", []),
  12. "exclude_iomgrs": tgt.get("exclude_iomgrs", []),
  13. "args": tgt.get("args", []),
  14. "flaky": tgt.flaky,
  15. "cpu_cost": tgt.get("cpu_cost", 1.0),
  16. "uses_polling": tgt.get("uses_polling", True)}
  17. timeout_seconds = tgt.get("timeout_seconds", None)
  18. if timeout_seconds:
  19. out['timeout_seconds'] = timeout_seconds
  20. excluded_poll_engines = tgt.get("excluded_poll_engines", None)
  21. if excluded_poll_engines:
  22. out['excluded_poll_engines'] = excluded_poll_engines
  23. return out
  24. %>
  25. ${json.dumps([gen_one_target(tgt)
  26. for tgt in targets
  27. if tgt.get('run', True) and tgt.build == 'test'] +
  28. tests,
  29. sort_keys=True, indent=2)}