Bulk Testing Python Scripts in Dynamo

Yes. Look into Journal automation - that is the literal method which the Revit development team uses.

What I would do is build a model in your current model and some some manor of selection to ensure that the Python nodes in the graph have what it needs to process data correctly. Run the nodes, convert the results into a string, and combine the outputs into a list which has the Revit build and the current time at the front. Have that list append into a CSV and you have your testing framework.

Next clear out the CSV and then prep your journal. The key to building such a journal is to keep things minimal and remove mouse use from the process - open Revit and utilize keyboard shortcuts to open the test file and launch Dynamo. Then open the graph in question in Dynamo and run it. Swap back to Revit and quit. Then navigate to the journal from that session, and clean it up. Remove any comments, and notes. When done it should be very few lines, and you should be able to drag and drop it into any Revit desktop shortcut to get the same actions you performed to execute again.

With the journal ready, you can move onto bulk testing of any build as your code grows. Simply drag and drop the testing journal onto the shortcuts and let it run. When done verify the results of each column in the CSV is the same - any which are different or return an error or null will throw an error in their respective build (column A if you followed the list structure).

I outlined some of this and provided a tool to build a repeatable journal at BiLT a few years back in a session with Dana DiFillippi. The journal base and some DYN nodes to help with automation have been shared here.

5 Likes