nangtani / blender-addon-tester

The blender addon tester is a test harness to enable pytest hook to allow addons to be tested inside a defined version of blender.
MIT License
64 stars 13 forks source link

WIP: Test App templates #31

Closed Tilix4 closed 3 years ago

Tilix4 commented 3 years ago

Hi!

I'm working on creating tests for Application templates. This is a first step and it works.
The idea is: You can test an addon with an app template at the same time.

I renamed addon to module to use a name which includes both addon and application templates.

I also did some refactor, using less global variables and more functions attributes, which is more reliable and pythonic. (It's a freedom I took, it's up to you to tell me if it's consistent with your design).

I'm proposing you this code to make your work more global and valuable (it helped me a lot), and to keep everything in the same place instead of forking all the time.

Hope this first contribution of mine will foster you ;)

Closes #28

douglaskastle commented 3 years ago

Thanks for this. I'll need to review.

But first up is that none of the travis tests pass any more:

https://travis-ci.org/github/nangtani/blender-addon-tester/builds/746090718

Typically the branch needs to at least be passing in of itself to push a merge through.

Tilix4 commented 3 years ago

Okay, I'll have a look to it!

douglaskastle commented 3 years ago

The testing is failing because these commands are no longer working.

- cd ${TRAVIS_BUILD_DIR}
- export PYTHONPATH=${TRAVIS_BUILD_DIR}
- cd examples/testing-fake-addon/
- python test_addon_blender.py ${BL_ADDON} ${BLENDER_VERSION}

Trying to debug further

douglaskastle commented 3 years ago

In the test script this is what is being called:

    exit_val = BAT.test_blender_addon(addon_path=addon, blender_revision=blender_rev)

which is calling this:

from .run_blender import run_blender_version_for_addon_with_pytest_suite as test_blender_addon

which is this:

def run_blender_version_for_addon_with_pytest_suite(addon_path="", app_template_path="", blender_exec_path="", blender_revision=None, config={}, dir_to_ignore=set()):

so the app_template is not being set explictly, so it is being set implicitly to '', which is this complaint:

[Errno 2] No such file or directory: ''

@line 125 of addon_helper.py

I still don't understand all you have done to fix this yet.

Tilix4 commented 3 years ago

Don't bother, I'll make it work, it's up to me :)

Tilix4 commented 3 years ago

Closed as it is too dirty. Will make a new one when it'll be ready.