Skip to content

Commit f265e86

Browse files
committed
Switch to running integration-test phase for 4.x versions
Previously the matrix would run integration testing through surefire plugin during the `test` phase instead of `integration-test`. Surefire plugin is generally considered to be made for unit testing and not integration testing. Such setup makes it skip configuration included in pom.xml for integration testing that is tied to the failsafe plugin. In order to return to proper setup this change switches to running `integration-test` phase which is handled by maven-failsafe-plugin. This includes a few adjustments which are: The reports directory is now `failsafe-reports` and not `surefire-reports` (4.x), the test report pattern now includes the `TEST-` prefix which skips unexpected summary files for the groups of tests, `-Dtest='<ignore list>'` was replaced with failsafe plugin appropriate `-Dit.test='<ignores list>'` with default initial list being empty string rather than `'*'`.
1 parent 4c34edd commit f265e86

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ def extract_n_latest_repo_tags(repo_directory: str, major_versions: List[str], l
8989
nargs='?', default='')
9090
parser.add_argument('--versions', default=[],
9191
help='java-driver versions to test')
92-
parser.add_argument('--tests', default='*',
93-
help='tests to pass to nosetests tool, default=tests.integration.standard')
92+
parser.add_argument('--tests', default='',
93+
help='Initial tests list to pass along. Runner will modify it according to ignore.yaml from version patch. default=\'\'')
9494
parser.add_argument('--scylla-version', help="relocatable scylla version to use", default=os.environ.get('SCYLLA_VERSION', None))
9595
parser.add_argument('--recipients', help="whom to send mail at the end of the run", nargs='+', default=None)
96-
parser.add_argument('--driver-type', help='Type of python-driver ("scylla", "cassandra" or "datastax")',
96+
parser.add_argument('--driver-type', help='Type of java-driver ("scylla", "cassandra" or "datastax")',
9797
dest='driver_type', default='datastax')
9898
parser.add_argument('--version-size', help='The number of the latest versions that will test.'
9999
'The version is filtered by the major and minor values.'

processjunit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _create_report(self):
2121

2222
new_tree = ElementTree.Element("testsuite")
2323
is_first_run = True
24-
for file_path in self.tests_result_path.glob("*.xml"):
24+
for file_path in self.tests_result_path.glob("TEST-*.xml"):
2525
tree = ElementTree.parse(file_path)
2626
testsuite_element = next(tree.iter("testsuite"))
2727
for key in self._summary:

run.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, java_driver_git, scylla_install_dir, tag, tests, driver_type,
2525
self._scylla_version = scylla_version
2626
self._scylla_install_dir = scylla_install_dir
2727
self._tests = tests
28-
self._report_path = self._java_driver_git / "integration-tests" / "target" / "surefire-reports"
28+
self._report_path = self._java_driver_git / "integration-tests" / "target" / "failsafe-reports"
2929
if self._tag.startswith('3'):
3030
self._report_path = self._java_driver_git / "driver-core" / "target" / "surefire-reports"
3131
self._root_path = Path(__file__).parent
@@ -141,7 +141,7 @@ def run(self) -> ProcessJUnit:
141141

142142
tests_string = self._tests
143143
if exclude_str := ','.join(f"!{ignore_element}" for ignore_element in self.ignore_tests):
144-
tests_string = f"{exclude_str},{tests_string}"
144+
tests_string = f"{exclude_str},{tests_string}".rstrip(',')
145145

146146
no_tty = '' if sys.stdout.isatty() else '-B'
147147

@@ -152,7 +152,12 @@ def run(self) -> ProcessJUnit:
152152
logging.info("Starting build the version")
153153
self._run_command_in_shell(f"mvn {no_tty} install -DskipTests=true -Dmaven.javadoc.skip=true -V")
154154

155-
cmd = f"mvn {no_tty} -pl integration-tests -Dtest='{tests_string}' test"
155+
156+
cmd = f"mvn {no_tty} -pl integration-tests integration-test"
157+
158+
if tests_string:
159+
cmd += f" -Dit.test='{tests_string}'"
160+
156161
if self._tag.startswith('3'):
157162
cmd = f"mvn {no_tty} -pl driver-core -Dtest.groups='short,long' -Dtest='{tests_string}' test"
158163

0 commit comments

Comments
 (0)