Skip to content

Commit 8028b80

Browse files
committed
fix: run java data generation tests via surefire overrides
1 parent b6f2b08 commit 8028b80

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

tools/generate_serialization_test_data.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import argparse
2525
from pathlib import Path
2626

27+
2728
def check_command_installed(command):
2829
"""Checks if a command is available in the system path."""
2930
if shutil.which(command) is None:
@@ -73,8 +74,24 @@ def generate_java_files(workspace_dir, project_dir):
7374
repo_url = "https://github.com/apache/datasketches-java.git"
7475
run_command(["git", "clone", repo_url, str(temp_dir)])
7576

77+
# Upstream surefire excludes the generate_java_files group by default; drop that exclusion in the temp clone.
78+
pom_path = temp_dir / "pom.xml"
79+
pom_text = pom_path.read_text()
80+
pom_text = pom_text.replace(
81+
"${testng.generate-java-files},${testng.check-cpp-files},${testng.check-go-files},\n${testng.check-cpp-historical-files}",
82+
"${testng.check-cpp-files},${testng.check-go-files},${testng.check-cpp-historical-files}",
83+
)
84+
pom_path.write_text(pom_text)
85+
7686
# 5. Run Maven to generate files
77-
mvn_cmd = ["mvn", "test", "-P", "generate-java-files"]
87+
mvn_cmd = [
88+
"mvn",
89+
"test",
90+
"-P",
91+
"generate-java-files",
92+
"-Dsurefire.groups=generate_java_files",
93+
"-Dsurefire.excludedGroups=",
94+
]
7895
use_shell = False
7996
if os.name == 'nt': # Windows
8097
mvn_cmd[0] = "mvn.cmd"

0 commit comments

Comments
 (0)