Coding with expensive APIs - I'm afraid to run an integration tests - Cost...
Coding with expensive APIs
- I'm afraid to run an integration tests
- Cost logger essential
- pytest-network (disabled network in tests) now essential
- dry-run feature now essential
- API fake object is application code, not test support code
- Infinite loops are now infinitely expensive
- Halting problem is now a real problem with a dollar cost.
- Even a few cache hits pays off.
Self-replies
While it is probably hard to prove any program will stop, a simple python decorator that counts invocations and exits the program when the API call count goes over 9000 should guarantee that our particular program will stop. I mean ```print("hello world")``` is going to stop.
Thoughts brought to you by a $5 GPT4 bill. (One run of my program on a 35 file workload)