Hello!!!
I’m testing new functionalities for an old workshop, I changed some functions and I want to test them in the workshop (I already tested them in the code repository), so how do I reference a function from a branch? I need to clone the repo and publish? What is the best and safest pattern to follow/use in this situation?
Hi @leonardo.rego,
The best way is to set up unit tests in your code repository, since these can provide a structured approach to testing out your functions. Here you can specify what the conditions for passing/failing is, and by running these you can always be sure that your function is doing what it’s supposed to being tested for.
Alternatively, if there’s a UAT-aspect to your change, and there is no way around using it in Workshop, you can release it as a new, grand version, and use that for your testing. Just make sure that where it is currently being used is set to a specific version and not “Use latest”.
Note: The above can get a bit messy, so good documentation is required if you plan on going this route. Alternatively, you can create a separate code repository and prefix all the functions you wish to test, before porting them over to the production repo after testing.
Workflow Builder can help surface where the function is being used.
2 Likes