From 9bb68a55cabc8c3909cdb2af34716fe33424e4e3 Mon Sep 17 00:00:00 2001 From: Kalpesh Pandya Date: Fri, 25 Jun 2021 00:16:53 +0530 Subject: [PATCH] rgw: Modification in the usage of force-branch Signed-off-by: Kalpesh Pandya --- .../rgw/notifications/tasks/test_amqp.yaml | 1 - .../rgw/notifications/tasks/test_kafka.yaml | 1 - .../rgw/notifications/tasks/test_others.yaml | 1 - qa/tasks/kafka.py | 1 + qa/tasks/notification_tests.py | 41 +++++++++---------- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/qa/suites/rgw/notifications/tasks/test_amqp.yaml b/qa/suites/rgw/notifications/tasks/test_amqp.yaml index e02cc8fc17bd7..6807cfb65877e 100644 --- a/qa/suites/rgw/notifications/tasks/test_amqp.yaml +++ b/qa/suites/rgw/notifications/tasks/test_amqp.yaml @@ -3,6 +3,5 @@ tasks: client.0: - notification-tests: client.0: - force-branch: master extra_attr: ["amqp_test"] rgw_server: client.0 diff --git a/qa/suites/rgw/notifications/tasks/test_kafka.yaml b/qa/suites/rgw/notifications/tasks/test_kafka.yaml index 4fa0791e03218..ae647df386532 100644 --- a/qa/suites/rgw/notifications/tasks/test_kafka.yaml +++ b/qa/suites/rgw/notifications/tasks/test_kafka.yaml @@ -4,6 +4,5 @@ tasks: kafka_version: 2.6.0 - notification-tests: client.0: - force-branch: master extra_attr: ["kafka_test"] rgw_server: client.0 diff --git a/qa/suites/rgw/notifications/tasks/test_others.yaml b/qa/suites/rgw/notifications/tasks/test_others.yaml index f13cac68f812f..793f6f430247a 100644 --- a/qa/suites/rgw/notifications/tasks/test_others.yaml +++ b/qa/suites/rgw/notifications/tasks/test_others.yaml @@ -1,5 +1,4 @@ tasks: - notification-tests: client.0: - force-branch: master rgw_server: client.0 diff --git a/qa/tasks/kafka.py b/qa/tasks/kafka.py index 5c121cc622619..5d185bba75070 100644 --- a/qa/tasks/kafka.py +++ b/qa/tasks/kafka.py @@ -173,6 +173,7 @@ def task(ctx,config): tasks: - kafka: client.0: + kafka_version: 2.6.0 """ assert config is None or isinstance(config, list) \ or isinstance(config, dict), \ diff --git a/qa/tasks/notification_tests.py b/qa/tasks/notification_tests.py index 5f63edac20376..39297b42977b0 100644 --- a/qa/tasks/notification_tests.py +++ b/qa/tasks/notification_tests.py @@ -12,39 +12,26 @@ import string from teuthology import misc as teuthology from teuthology import contextutil -from teuthology.config import config as teuth_config from teuthology.orchestra import run log = logging.getLogger(__name__) + @contextlib.contextmanager def download(ctx, config): - """ - Download the bucket notification tests from the git builder. - Remove downloaded test file upon exit. - The context passed in should be identical to the context - passed in to the main task. - """ assert isinstance(config, dict) - log.info('Downloading bucket-notification-tests...') + log.info('Downloading bucket-notifications-tests...') testdir = teuthology.get_testdir(ctx) + branch = ctx.config.get('suite_branch') + repo = ctx.config.get('suite_repo') + log.info('Using branch %s from %s for bucket notifications tests', branch, repo) for (client, client_config) in config.items(): - bntests_branch = client_config.get('force-branch', None) - if not bntests_branch: - raise ValueError( - "Could not determine what branch to use for bn-tests. Please add 'force-branch: {bn-tests branch name}' to the .yaml config for this bucket notifications tests task.") - - log.info("Using branch '%s' for bucket notifications tests", bntests_branch) - sha1 = client_config.get('sha1') - git_remote = client_config.get('git_remote', teuth_config.ceph_git_base_url) ctx.cluster.only(client).run( - args=[ - 'git', 'clone', - '-b', bntests_branch, - git_remote + 'ceph.git', - '{tdir}/ceph'.format(tdir=testdir), - ], + args=['git', 'clone', '-b', branch, repo, '{tdir}/ceph'.format(tdir=testdir)], ) + + sha1 = client_config.get('sha1') + if sha1 is not None: ctx.cluster.only(client).run( args=[ @@ -53,6 +40,7 @@ def download(ctx, config): 'git', 'reset', '--hard', sha1, ], ) + try: yield finally: @@ -258,21 +246,30 @@ def task(ctx,config): """ To run bucket notification tests under Kafka endpoint the prerequisite is to run the kafka server. Also you need to pass the 'extra_attr' to the notification tests. Following is the way how to run kafka and finally bucket notification tests:: + tasks: - kafka: client.0: + kafka_version: 2.6.0 - notification_tests: client.0: extra_attr: ["kafka_test"] To run bucket notification tests under AMQP endpoint the prerequisite is to run the rabbitmq server. Also you need to pass the 'extra_attr' to the notification tests. Following is the way how to run rabbitmq and finally bucket notification tests:: + tasks: - rabbitmq: client.0: - notification_tests: client.0: extra_attr: ["amqp_test"] + + If you want to run the tests against your changes pushed to your remote repo you can provide 'suite_branch' and 'suite_repo' + parameters in your teuthology-suite command. Example command for this is as follows:: + + teuthology-suite --ceph-repo https://github.com/ceph/ceph-ci.git -s rgw:notifications --ceph your_ceph_branch_name -m smithi --suite-repo https://github.com/your_name/ceph.git --suite-branch your_branch_name + """ assert config is None or isinstance(config, list) \ or isinstance(config, dict), \ -- 2.39.5