Add ability to create a test data archive with make_source_archive

This makes it so that we ship the test data for every major release
in its own separate archive. (In case someone wants to easily run the
tests for a specific older release without using git)

Pull Request: https://projects.blender.org/blender/blender/pulls/135293
This commit is contained in:
Sebastian Parborg
2025-02-28 17:53:36 +01:00
parent 7913237d33
commit 277add8fc9
2 changed files with 18 additions and 2 deletions

View File

@@ -572,6 +572,8 @@ source_archive_complete: .FORCE
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) -DPACKAGE_USE_UPSTREAM_SOURCES=OFF
# This assumes CMake is still using a default `PACKAGE_DIR` variable:
@$(PYTHON) ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
# We assume that the tests will not change for minor releases so only package them for major versions
@$(PYTHON) ./build_files/utils/make_source_archive.py --package-test-data
icons_geom: .FORCE
@BLENDER_BIN=$(BLENDER_BIN) \

View File

@@ -51,7 +51,8 @@ def main() -> None:
description="Create a tarball of the Blender sources, optionally including sources of dependencies.",
epilog="This script is intended to be run by `make source_archive_complete`.",
)
cli_parser.add_argument(
group = cli_parser.add_mutually_exclusive_group()
group.add_argument(
"-p",
"--include-packages",
type=Path,
@@ -59,6 +60,12 @@ def main() -> None:
metavar="PACKAGE_PATH",
help="Include all source files from the given package directory as well.",
)
group.add_argument(
"-t",
"--package-test-data",
action='store_true',
help="Package all test data into its own archive",
)
cli_args = cli_parser.parse_args()
@@ -79,7 +86,12 @@ def main() -> None:
manifest = manifest_path(tarball)
packages_dir = packages_path(curdir, cli_args)
create_manifest(version, manifest, blender_srcdir, packages_dir)
if cli_args.package_test_data:
print("Creating an archive of all test data.")
create_manifest(version, manifest, blender_srcdir / "tests/data", packages_dir)
else:
create_manifest(version, manifest, blender_srcdir, packages_dir)
create_tarball(version, tarball, manifest, blender_srcdir, packages_dir)
create_checksum_file(tarball)
cleanup(manifest)
@@ -90,6 +102,8 @@ def tarball_path(output_dir: Path, version: make_utils.BlenderVersion, cli_args:
extra = ""
if cli_args.include_packages:
extra = "-with-libraries"
elif cli_args.package_test_data:
extra = "-test-data"
return output_dir / f"blender{extra}-{version}.tar.xz"