From 33fd302a8eea2fcd44a8e4bef14c82405cc2a951 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sat, 25 Nov 2017 17:36:02 -0800 Subject: [PATCH] deploy-ng: Add files to build application out of the unit tests This will be a good way to make sure everything in the tests work under a frozen environment. NOTE: The application builds and runs, but no tests are collected. We still need to figure out how we want to handle tests. Freeze them all and modify test collection? Add py/test files to the build directory and try to run them? --- tests/main.py | 13 +++++++++++++ tests/requirements.txt | 3 +++ tests/setup.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 tests/main.py create mode 100644 tests/requirements.txt create mode 100644 tests/setup.py diff --git a/tests/main.py b/tests/main.py new file mode 100644 index 0000000000..4bc1849bda --- /dev/null +++ b/tests/main.py @@ -0,0 +1,13 @@ +import _pytest +if not hasattr(_pytest, '__file__'): + import os + import _pytest._pluggy + import py + + _pytest.__file__ = os.getcwd() + _pytest._pluggy.__file__ = os.getcwd() + py.__file__ = os.getcwd() + +import pytest + +pytest.main() diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000000..b5c81dac66 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,3 @@ +pytest +--pre --extra-index-url https://archive.panda3d.org/branches/deploy-ng +panda3d diff --git a/tests/setup.py b/tests/setup.py new file mode 100644 index 0000000000..cdbea42587 --- /dev/null +++ b/tests/setup.py @@ -0,0 +1,33 @@ +from setuptools import setup +import pytest + +setup( + name="panda3d-tester", + options = { + 'build_apps': { + 'gui_apps': { + 'tester': 'main.py', + }, + 'plugins': [ + 'pandagl', + 'p3openal_audio', + ], + 'include_modules': { + '*': [ + 'pkg_resources.*.*', + # TODO why does the above not get these modules too? + 'pkg_resources._vendor.packaging.*', + 'pkg_resources._vendor.packaging.version', + 'pkg_resources._vendor.packaging.specifiers', + 'pkg_resources._vendor.packaging.requirements', + ] + pytest.freeze_includes(), + }, + 'deploy_platforms': [ + 'manylinux1_x86_64', + 'macosx_10_6_x86_64', + 'win32', + 'win_amd64', + ], + } + } +)