• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Unit testing in python

Explorer ,
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

246

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.

 

 

Votes

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
Explorer ,
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. 

Votes

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
Explorer ,
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.

Votes

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

Votes

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
Explorer ,
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?

Votes

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