diff --git a/.efrocachemap b/.efrocachemap index c680453c..10b7b69c 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4080,18 +4080,18 @@ "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/5b/c6/92d0ba8ca612e475b72260a19e98", "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b7/bd/b8ac02a5e68a1069e8f95e694878", "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/7d/79/e42dfe45c7b2c1a50d10b4e09efe", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/ed/03/e0b417ce56a85c7975669d3e8b8b", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/c4/61/751004a93730969c0db2dfb3af78", "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/ad/ce/473c60a90b856145b0cf587cda4c", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3c/98/5111efecd865a47f9a3de8e02387", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/72/ab/8989c81e50c77eaa2beb509ca862", "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/6a/8a/b5db085b0e7c302592339e71bb7e", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/b9/43/b58ab949e8096dc5bae6a109aec9", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/d1/50/54e3e478047c2ff2af05989afb32", "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/ca/80/8f44943b05b5fb9cb4e1c1c5763d", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a4/92/6be951095042e1005d147be3cd58", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/51/7e/bb43ebba603a9ec64ddfb7fd9543", "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/48/e9/cbc79d892e48a419fb06201b664b", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/b1/77/d2218fb36652c6925becdfa337b4", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/6b/dd/6c19ca17aa060e11c4d95c4a9087", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/2b/67/23ceb35d65c944919040a21f2b0b", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/60/27/193bb6c86f557aa3846b967e84b9", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/88/47/bfd87fc3bd48d1da2fb32e3c70ee", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/f6/d6/4cba97ea982b68ccca077f3da940", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/83/e1/da3c4daaf0161eb9f4f90695faf3", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/c0/7c/b3e1038df89ad796bf48112292a3", "build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/29/dc/e5b08aae2dbe3222082aaa1e90e7", "build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ce/bb/5796a83ce9d1c9cf58e08f3ff351", "build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/31/65/014221e46f7974f40aa84c8922dc", @@ -4108,14 +4108,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/14/4b/68a0ece3c1f191183b695cf45a4d", "build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/1f/3f/d899a46cc0dc8bc4f1b38f9318a5", "build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/de/99/95fdcb3f614a7b83ada148bca38d", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/7a/5f/b922c97b829f5de5e3261f6d8de9", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/e9/48/262cc207da408d08a14524ccf736", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/70/55/62ed906a1d81978d9b0b4d32869d", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/2a/c7/1bc68e765058fe9322fe85c16cf9", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/4b/26/19e9a195b08f7b66052ff17a8b87", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/0f/e3/fe48cb08d1736d1316af65363614", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/fd/bd/09275e9bc0237b6806f7bab36360", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/4d/30/94c21cd426979e7e6e323f2f7dae", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/12/2b/3688e05860461e26714da59d7cb0", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/16/7f/fbca5f52a5c7a2d30cff06edc6ac", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/0e/e6/b1f8b6cad401ebe410b201bb1520", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/c9/17/d230ae94c0c4fcd2f4d37f65e303", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/81/43/c98ad0db3e97698a8f9bd0b9bb4f", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/2b/02/601e10b59d453dd6caf42779be2a", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/a5/8c/54ecc3d3ffee609cbb5099462b76", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/5a/94/333dd02759d5f8f3319b68c0cf39", "src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa", "src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1", "src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/ea/6a/6a4721b144e5e297b542d2a0eea2", diff --git a/Makefile b/Makefile index 6bd490ba..f81e248d 100644 --- a/Makefile +++ b/Makefile @@ -837,10 +837,12 @@ TEST_TARGET ?= tests # Run all tests. (live execution verification) test: py_check_prereqs @tools/pcommand echo BLU Running all tests... + @tools/pcommand tests_warm_start @tools/pcommand pytest -v $(TEST_TARGET) test-verbose: py_check_prereqs @tools/pcommand echo BLU Running all tests... + @tools/pcommand tests_warm_start @tools/pcommand pytest -o log_cli=true -o log_cli_level=debug \ -s -vv $(TEST_TARGET) diff --git a/tools/batools/apprun.py b/tools/batools/apprun.py index 032f7459..b249933e 100755 --- a/tools/batools/apprun.py +++ b/tools/batools/apprun.py @@ -35,10 +35,15 @@ def test_runs_disabled_reason() -> str: return 'App test runs disabled here.' +def acquire_binary_for_python_command(purpose: str) -> str: + """Run acquire_binary as used for python_command call.""" + return acquire_binary(assets=True, purpose=purpose) + + def python_command(cmd: str, purpose: str) -> None: """Run a cmd with a built bin and PYTHONPATH set to its scripts dir.""" - binpath = acquire_binary(assets=True, purpose=purpose) + binpath = acquire_binary_for_python_command(purpose=purpose) bindir = os.path.dirname(binpath) cmdargs = [binpath, '--command', cmd] @@ -51,19 +56,23 @@ def python_command(cmd: str, purpose: str) -> None: def acquire_binary(assets: bool, purpose: str) -> str: - """Return a path to a runnable binary, building or downloading as needed. + """Return path to a runnable binary, building/downloading as needed. If 'assets' is False, only the binary itself will be fetched or assembled; no scripts or assets. This generally saves some time, but must only be used for very simple '-c' command cases where no assets will be needed. - By default, binaries used here will be downloaded prefab builds. - This allows people without full compiler setups to still perform app - runs for things like dummy-module generation. However, someone who - *is* able to compile their own binaries might prefer to use their - own binaries here so that changes to their local repo are properly - reflected in app runs and whatnot. Set environment variable + Be aware that it is up to the particular environment whether a gui + or headless binary will be provided. Commands should be designed to + work with either. + + By default, downloaded prefab builds will be used here. This allows + people without full compiler setups to still perform app runs for + things like dummy-module generation. However, someone who *is* able + to compile their own binaries might prefer to use their own binaries + here so that changes to their local repo are properly reflected in + app runs and whatnot. Set environment variable BA_APP_RUN_ENABLE_BUILDS=1 to enable that. When local builds are enabled, we use the same gui build targets as diff --git a/tools/batools/pcommand2.py b/tools/batools/pcommand2.py index ff14327f..4abbf51f 100644 --- a/tools/batools/pcommand2.py +++ b/tools/batools/pcommand2.py @@ -349,3 +349,18 @@ def gen_python_init_module() -> None: ' See LICENSE for details.\n' '#\n' ) + + +def tests_warm_start() -> None: + """Warm-start some stuff needed by tests. + + This keeps logs clearer by showing any binary builds/downloads we + need to do instead of having those silently happen as part of + tests. + """ + from batools import apprun + + # We do lots of apprun.python_command() within test. Pre-build the + # binary that they need to do their thing. + if not apprun.test_runs_disabled(): + apprun.acquire_binary_for_python_command(purpose='running tests') diff --git a/tools/pcommand b/tools/pcommand index 6e70221f..1b19bf60 100755 --- a/tools/pcommand +++ b/tools/pcommand @@ -125,6 +125,7 @@ from batools.pcommand2 import ( android_archive_unstripped_libs, spinoff_test, spinoff_check_submodule_parent, + tests_warm_start, ) # pylint: enable=unused-import