Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Unit testing in python

Community Beginner ,
Jun 28, 2021 Jun 28, 2021

Copy link to clipboard

Copied

Hi there,

 

Is it possible to run unit tests using the substance designer python API outside of Designer, in headless mode? Does Designer come with an interpreter that can import the sd package?

 

Thank you

TOPICS
Scripting

Views

70

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

Hi,

 

We currently don't have a standalone headless SD Python module.

One possible alternative is the use the --startup-script and --quit command line arguments when launching Designer.

I haven't run unit tests like this, but I believe it will work.

 

Est.

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

Thank you Esteban, we will try that. 

It won't work in a Continuous Integration pipeline, but at least the engineer can run tests as a batch before opening a PR. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

LATEST

I guess we can also mock out the sd package and all the calls to it. Writing such tests can be tedious sometimes, and arguably the value of the tests may be lower, but our code would be covered.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

The only one way to run Designer in Headless mode is through SAT (Substance Automation Toolkit).
More information here: https://substance3d.adobe.com/documentation/sat

 

Nico

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

Thank you Nicolas. Unfortunately the SAT won't help here since it's a different API, and the intent here is to test plugins code using the Designer API.

Is that on your roadmap at all to provide a headless version of Designer, for the purpose of unit testing and continuous integration, like Maya has mayapy for example?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines