Skip to content

Basic test#62

Merged
ruaridhg merged 68 commits intomainfrom
smg/basic-test
Sep 21, 2023
Merged

Basic test#62
ruaridhg merged 68 commits intomainfrom
smg/basic-test

Conversation

@sfmig
Copy link
Copy Markdown
Collaborator

@sfmig sfmig commented Jun 5, 2023

A first attempt at testing with Blender's Python interpreter.

I used this pytest-blender plugin, which seems to have very useful fixtures and also provides some steps towards CI.

To use the plugin, we need to install pytest and all other dependencies used in testing (pytest-cov mainly) in the site-packages of Blender's Python. The repo provides some guidance for this here. It is important to make sure you use the correct Python interpreter and pip (Blender's ones) when installing pytest and pytest-cov.

I think an alternative approach would be to use Blender as a python module, but this seems easier.

sfmig added 30 commits May 12, 2023 16:11
…ude relevant socket types to randomise geometry nodes
…aterial sockets if subpanel not extended by default
…ier linked to it, it creates it in order to visualise the graph
… the currently active object. add view graph for nodes nested 1 level
@ruaridhg
Copy link
Copy Markdown
Collaborator

ruaridhg commented Sep 14, 2023

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting pytest
  Using cached pytest-7.4.2-py3-none-any.whl (324 kB)
Collecting iniconfig
  Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting exceptiongroup>=1.0.0rc8
  Using cached exceptiongroup-1.1.3-py3-none-any.whl (14 kB)
Collecting pluggy<2.0,>=0.12
  Using cached pluggy-1.3.0-py3-none-any.whl (18 kB)
Collecting tomli>=1.0.0
  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting packaging
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Installing collected packages: tomli, pluggy, packaging, iniconfig, exceptiongroup, pytest
  WARNING: The scripts py.test and pytest are installed in '/Users/ruaridhgollifer/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed exceptiongroup-1.1.3 iniconfig-2.0.0 packaging-23.1 pluggy-1.3.0 pytest-7.4.2 tomli-2.0.1

[notice] A new release of pip available: 22.2.2 -> 23.2.1
[notice] To update, run: /Applications/Blender.app/Contents/Resources/3.4/python/bin/python3.10 -m pip install --upgrade pip
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting pytest-cov
  Using cached pytest_cov-4.1.0-py3-none-any.whl (21 kB)
Collecting pytest>=4.6
  Using cached pytest-7.4.2-py3-none-any.whl (324 kB)
Collecting coverage[toml]>=5.2.1
  Using cached coverage-7.3.1-cp310-cp310-macosx_11_0_arm64.whl (201 kB)
Collecting tomli
  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting iniconfig
  Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting exceptiongroup>=1.0.0rc8
  Using cached exceptiongroup-1.1.3-py3-none-any.whl (14 kB)
Collecting pluggy<2.0,>=0.12
  Using cached pluggy-1.3.0-py3-none-any.whl (18 kB)
Collecting packaging
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Installing collected packages: tomli, pluggy, packaging, iniconfig, exceptiongroup, coverage, pytest, pytest-cov
  WARNING: The scripts coverage, coverage-3.10 and coverage3 are installed in '/Users/ruaridhgollifer/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts py.test and pytest are installed in '/Users/ruaridhgollifer/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed coverage-7.3.1 exceptiongroup-1.1.3 iniconfig-2.0.0 packaging-23.1 pluggy-1.3.0 pytest-7.4.2 pytest-cov-4.1.0 tomli-2.0.1

[notice] A new release of pip available: 22.2.2 -> 23.2.1
[notice] To update, run: /Applications/Blender.app/Contents/Resources/3.4/python/bin/python3.10 -m pip install --upgrade pip
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting pytest-blender
  Using cached pytest_blender-3.0.5-py3-none-any.whl (16 kB)
Installing collected packages: pytest-blender
  WARNING: The script pytest-blender is installed in '/Users/ruaridhgollifer/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pytest-blender-3.0.5

[notice] A new release of pip available: 22.2.2 -> 23.2.1
[notice] To update, run: /Applications/Blender.app/Contents/Resources/3.4/python/bin/python3.10 -m pip install --upgrade pip

Also, kept getting this error when running sh install_randomiser.sh so maybe it's worth having a separate bash script for testing so this doesn't happen every time we run Blender with our add-on

@ruaridhg ruaridhg marked this pull request as ready for review September 14, 2023 15:54
@ruaridhg ruaridhg merged commit 9316e1a into main Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants