Bulk Testing Python Scripts in Dynamo

Hello Dynamo Friends :slight_smile:

Let´s say we have a few thousands of python scripts on GitHub and then Revit 2025 is released.
How could we automatically run these codes in dynamo for testing?

The results could easily be printed to an excel file and reviewed pretty fast, so the problem is just getting the code into dynamo and run it.

Currently I´m setting up e few hundred codes with code blocks and python from string nodes. Also exporting the code to a .py file. So for now testing in multiple revit/python versions is pretty easy, all is one dyn file. But what if we have much more scripts, from many different users…

Any ideas on that?

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