cruise-automation / isopod

An expressive DSL and framework for Kubernetes configuration without YAML
Apache License 2.0
482 stars 32 forks source link

Print stacktrace for runtime errors #83

Closed max0ne closed 3 years ago

max0ne commented 3 years ago

This PR makes CLI print starlark runtime error with full stacktrace. Currnelty the CLI prints runtime errors like this, now way to tell where the error is from:

> isopod test /Users/mingfei.huang/workspace/paas-addon-common-bundle/addons/istio
invalid call of non-function (string)
FAIL    /Users/mingfei.huang/workspace/paas-addon-common-bundle/addons/istio/cert_update_test.ipd

With this PR:

> go run . test /Users/mingfei.huang/workspace/paas-addon-common-bundle/addons/istio
Traceback (most recent call last):
  /Users/mingfei.huang/workspace/paas-addon-common-bundle/addons/istio/cert_update_test.ipd:8:24: in test_install_cert_update
  ./cert_update.ipd:24:17: in install_cert_update
  ./cert_update.ipd:122:7: in install_cron
Error: invalid call of non-function (string)
FAIL    /Users/mingfei.huang/workspace/paas-addon-common-bundle/addons/istio/cert_update_test.ipd