From f7274f6f71437f67c67874ad17b4d0303fd11b4d Mon Sep 17 00:00:00 2001 From: Michael Berlin Date: Tue, 19 Sep 2017 21:23:56 -0700 Subject: [PATCH] test: Remove e2e tests for old, obsolete resharding automation. This is superseeded by the new workflows now e.g. see test/horizontal_resharding_workflow.py. BUG=64890442 --- test/automation_horizontal_resharding.py | 127 ----------------------- test/automation_vertical_split.py | 85 --------------- test/config.json | 18 ---- 3 files changed, 230 deletions(-) delete mode 100755 test/automation_horizontal_resharding.py delete mode 100755 test/automation_vertical_split.py diff --git a/test/automation_horizontal_resharding.py b/test/automation_horizontal_resharding.py deleted file mode 100755 index bfb46171a34..00000000000 --- a/test/automation_horizontal_resharding.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2017 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""End-to-end test for horizontal resharding automation.""" - -# "unittest" is used indirectly by importing "worker", but pylint does -# not grasp this. -# Import it explicitly to make pylint happy and stop it complaining about -# setUpModule, tearDownModule and the missing module docstring. -import unittest # pylint: disable=unused-import - -import environment -import utils -import worker - - -def setUpModule(): - worker.setUpModule() - utils.Vtctld().start() - - -def tearDownModule(): - worker.tearDownModule() - - -class TestAutomationHorizontalResharding(worker.TestBaseSplitClone): - """End-to-end test for horizontal resharding automation. - - This test reuses worker.py because worker.py also covers the happy path - of the horizontal resharding code. Instead of running the different resharding - steps "manually" as part of the test, they will be run by the automation - cluster operation. - """ - - KEYSPACE = 'test_keyspace' - - def test_regular_operation(self): - # Use a dedicated worker to run all vtworker commands. - worker_proc, _, worker_rpc_port = utils.run_vtworker_bg( - ['--cell', 'test_nj'], - auto_log=True) - vtworker_endpoint = 'localhost:' + str(worker_rpc_port) - - automation_server_proc, automation_server_port = ( - utils.run_automation_server()) - - source_shard_list = '0' - dest_shard_list = '-80,80-' - _, vtctld_endpoint = utils.vtctld.rpc_endpoint() - utils.run( - environment.binary_argstr('automation_client') + - ' --server localhost:' + str(automation_server_port) + - ' --task HorizontalReshardingTask' + - ' --param keyspace=' + self.KEYSPACE + - ' --param source_shard_list=' + source_shard_list + - ' --param dest_shard_list=' + dest_shard_list + - ' --param vtctld_endpoint=' + vtctld_endpoint + - ' --param vtworker_endpoint=' + vtworker_endpoint + - ' --param min_healthy_rdonly_tablets=1') - - self.verify() - - utils.kill_sub_process(automation_server_proc, soft=True) - utils.kill_sub_process(worker_proc, soft=True) - - def verify(self): - self.assert_shard_data_equal(0, worker.shard_master, - worker.shard_0_tablets.replica) - self.assert_shard_data_equal(1, worker.shard_master, - worker.shard_1_tablets.replica) - - # Verify effect of MigrateServedTypes. Dest shards are serving now. - utils.check_srv_keyspace( - 'test_nj', self.KEYSPACE, - 'Partitions(master): -80 80-\n' - 'Partitions(rdonly): -80 80-\n' - 'Partitions(replica): -80 80-\n') - - # Check that query service is disabled (source shard) or enabled (dest). - - # source shard: query service must be disabled after MigrateServedTypes. - utils.check_tablet_query_service( - self, worker.shard_rdonly1, - serving=False, tablet_control_disabled=True) - utils.check_tablet_query_service( - self, worker.shard_replica, - serving=False, tablet_control_disabled=True) - utils.check_tablet_query_service( - self, worker.shard_master, - serving=False, tablet_control_disabled=True) - - # dest shard -80: query service must be enabled after MigrateServedTypes. - utils.check_tablet_query_service( - self, worker.shard_0_rdonly1, - serving=True, tablet_control_disabled=False) - utils.check_tablet_query_service( - self, worker.shard_0_replica, - serving=True, tablet_control_disabled=False) - utils.check_tablet_query_service( - self, worker.shard_0_master, - serving=True, tablet_control_disabled=False) - - # dest shard 80-: query service must be enabled after MigrateServedTypes. - utils.check_tablet_query_service( - self, worker.shard_1_rdonly1, - serving=True, tablet_control_disabled=False) - utils.check_tablet_query_service( - self, worker.shard_1_replica, - serving=True, tablet_control_disabled=False) - utils.check_tablet_query_service( - self, worker.shard_1_master, - serving=True, tablet_control_disabled=False) - -if __name__ == '__main__': - utils.main(test_options=worker.add_test_options) diff --git a/test/automation_vertical_split.py b/test/automation_vertical_split.py deleted file mode 100755 index def59de31da..00000000000 --- a/test/automation_vertical_split.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2017 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# "unittest" is used indirectly by importing "vertical_split", but pylint does -# not grasp this. -# Import it explicitly to make pylint happy and stop it complaining about -# setUpModule, tearDownModule and the missing module docstring. -import unittest # pylint: disable=unused-import - -import environment -import utils -import vertical_split - - -def setUpModule(): - vertical_split.setUpModule() - - -def tearDownModule(): - vertical_split.tearDownModule() - - -class TestAutomationVerticalSplit(vertical_split.TestVerticalSplit): - """End-to-end test for running a vertical split via the automation framework. - - This test is a subset of vertical_split.py. The "VerticalSplitTask" automation - operation runs the major commands for a vertical split instead of calling them - "manually" from the test. - """ - - def test_vertical_split(self): - # Use a dedicated worker to run all vtworker commands. - worker_proc, _, worker_rpc_port = utils.run_vtworker_bg( - ['--cell', 'test_nj'], - auto_log=True) - vtworker_endpoint = 'localhost:' + str(worker_rpc_port) - - automation_server_proc, automation_server_port = ( - utils.run_automation_server()) - - _, vtctld_endpoint = utils.vtctld.rpc_endpoint() - params = {'source_keyspace': 'source_keyspace', - 'dest_keyspace': 'destination_keyspace', - 'shard_list': '0', - 'tables': '/moving/,view1', - 'vtctld_endpoint': vtctld_endpoint, - 'vtworker_endpoint': vtworker_endpoint, - } - args = ['--server', 'localhost:' + str(automation_server_port), - '--task', 'VerticalSplitTask'] - args.extend(['--param=' + k + '=' + v for k, v in params.items()]) - utils.run(environment.binary_args('automation_client') + args) - - self._check_srv_keyspace('') - self._check_blacklisted_tables(vertical_split.source_master, - ['/moving/', 'view1']) - self._check_blacklisted_tables(vertical_split.source_replica, - ['/moving/', 'view1']) - self._check_blacklisted_tables(vertical_split.source_rdonly1, - ['/moving/', 'view1']) - self._check_blacklisted_tables(vertical_split.source_rdonly2, - ['/moving/', 'view1']) - - # check the binlog player is gone now - vertical_split.destination_master.wait_for_binlog_player_count(0) - - utils.kill_sub_process(automation_server_proc, soft=True) - utils.kill_sub_process(worker_proc, soft=True) - - -if __name__ == '__main__': - utils.main() diff --git a/test/config.json b/test/config.json index 6615aba3e14..33a1d4af941 100644 --- a/test/config.json +++ b/test/config.json @@ -1,24 +1,6 @@ { "Tests": { - "automation_horizontal_resharding": { - "File": "automation_horizontal_resharding.py", - "Args": [], - "Command": [], - "Manual": false, - "Shard": 4, - "RetryMax": 0, - "Tags": [] - }, - "automation_vertical_split": { - "File": "automation_vertical_split.py", - "Args": [], - "Command": [], - "Manual": false, - "Shard": 3, - "RetryMax": 0, - "Tags": [] - }, "backup": { "File": "backup.py", "Args": [],