#juzzbott - Automated Testing
1 messages · Page 1 of 1 (latest)
Hi 👋
Let me check the flag usage.
However, I can answer the second one more directly. In that case, where you have some test data you wish to retain and others that are part of automated testing you want to remove, then using a teardown step that deletes the records created during the test is the best approach.
Okay the --project-name flag is used to segregate Stripe CLI configurations, not data.
You could segregate data but only by creating multiple Stripe accounts and using the --project-name flag to identify CLI configurations that used to API keys that corresponded to each account
Let me know if that makes sense.
Hello, thanks that does make sense. Thanks for the quick response. As we only have a single stripe account, it looks like the tear down method will be needed, as from what your saying even with a separate API key within the same account, there is no 'delete all by API key' functionality?
No. The records all still belong to the Account in that case
As an example, I've written scripts to generate a bunch of test data that was essentially garbage but I wanted to keep other stuff (Customers, Products, Coupons ,etc). I've used the metadata property to add a key like test_data_to_delete: true. Then when i iterate over all the records I delete the ones that have this key:value pair
Probably not the most efficient but it gets the job done
OK, that's not a bad idea, I'll keep that in mind. Thank you