How to do automation test for Maya plugin development? Python's unittest module? PyMel's test module? or anything else?

375 views
Skip to first unread message

yaoyansibase

unread,
Mar 28, 2015, 12:58:32 AM3/28/15
to python_inside_maya
How to do automation test for Maya plugin development? Python's unittest module? PyMel's test module? or anything else?

Hi all,
I'm going to create an automation test process for my Maya plugin development. And here is my basic ideas:
- create a root directory which includes test cases, e.g.
    test_root\
      |___testcase_0001\
      |     |____test.ma
      |     |____reference.png
      |___testcase_0002\
            |____test_anim.ma (this is an animation file)
            |____reference.001.png
            |____reference.002.png
            |____reference.003.png

- visit each test case directory, render the *.ma file and output the rendered image to test_tmp\testcase_*\
    test_tmp\
      |___testcase_0001\
      |     |____output.png
      |___testcase_0002\
            |____output.001.png
            |____output.002.png
            |____output.003.png

- compare the output image(s) with the reference image(s). And generate the difference image if they are different, it means this test case fails.
    test_diff\
      |___testcase_0001\
      |     |____diff.png (if any)
      |___testcase_0002\
            |____diff.001.png (if any)
            |____diff.002.png (if any)
            |____diff.003.png (if any)




Now I'm looking for any available tools to create my automation test process.
I'm going to write my automation test scripts based on python's unittest module.
But I also find that PyMel has some scripts on test, and I'm not sure what it does. These test scripts locate at <MayaRoot>\devkit\other\pymel\tests.

My questions are:
1. What pymel's test script does? Is it suitable for create my automation test process? Is there any guid or tutorial?
2. Python's unittest module v.s. PyMel's test module. Could you give me any pros and cons on each of them?
3. Is there any other tools available for creating the automation test process for Maya plugin development?
4. How those big CG companies do the automation test for their Maya plugin development?
Any other suggestions are appreciated, and thank you in advance.

Cheers
yao

Chad Dombrova

unread,
Mar 29, 2015, 2:18:30 AM3/29/15
to python_in...@googlegroups.com, python_inside_maya
The pymel tests you are referring to are not testing utils, they are pymel's own unit test suite.  That said, reading the code may give you some ideas on how to write your own tests. The standard unittest module received some nice new features with python 2.7, so I tend to use that. If you want more advanced features like test generators and execution of doctests, like we do in the PyMEL tests, then you can use nose as a test runner. 


Sent from Mailbox


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c92c03a5-8b9a-4836-ad16-7420012595fd%40aliyun.com.
For more options, visit https://groups.google.com/d/optout.

yaoys

unread,
Mar 29, 2015, 10:43:38 PM3/29/15
to python_in...@googlegroups.com
Thanks for your reply, Chadrik. Could I ask one more question?

What about this file?
      <MayaRoot>\devkit\other\pymel\extras\completion\py\pymel\util\testing.py
Is it usefull for me to build my automation tests process?

Cesar Saez

unread,
Mar 29, 2015, 11:32:37 PM3/29/15
to python_in...@googlegroups.com

Chad Dombrova

unread,
Apr 1, 2015, 9:15:56 PM4/1/15
to Maya Python Group
What about this file?
      <MayaRoot>\devkit\other\pymel\extras\completion\py\pymel\util\testing.py
Is it usefull for me to build my automation tests process?

There are some useful things in there for running tests within the Maya GUI, which pymel has to do, but like I said before, I would keep it simple to start with and as you run into problems consult examples like pymel's tests to get ideas on how to solve them.  No reason to pull in all that code if you don't need it.

-chad

Reply all
Reply to author
Forward
0 new messages