]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/s3tests: run with tox instead of bootstrap+nose 49826/head
authorCasey Bodley <cbodley@redhat.com>
Sun, 22 Jan 2023 16:37:56 +0000 (11:37 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 23 Jan 2023 04:27:24 +0000 (23:27 -0500)
Fixes: https://tracker.ceph.com/issues/58512
Signed-off-by: Casey Bodley <cbodley@redhat.com>
qa/suites/rgw/dbstore/tasks/rgw_s3tests.yaml
qa/tasks/s3tests.py

index b749def2f9a741a4f653d33ccd59410d67337174..daab5581df83b5a6c4e68b8215f0b1b13576fe56 100644 (file)
@@ -12,5 +12,5 @@ tasks:
     client.0:
       dbstore_tests: True
       rgw_server: client.0
-      extra_attrs: ["!fails_on_rgw,!fails_on_dbstore"]
+      extra_attrs: ["not fails_on_rgw","not fails_on_dbstore"]
 
index 5461cb82e1ebe63f691afdb3a980b6232aab88aa..3856f8fadcd4f83b341e6505711e639ec311edb8 100644 (file)
@@ -211,8 +211,7 @@ def create_users(ctx, config):
 @contextlib.contextmanager
 def configure(ctx, config):
     """
-    Configure the s3-tests.  This includes the running of the
-    bootstrap code and the updating of local conf files.
+    Create the config files for s3tests an boto.
     """
     assert isinstance(config, dict)
     log.info('Configuring s3-tests...')
@@ -315,14 +314,6 @@ def configure(ctx, config):
                     s3tests_conf['s3 cloud']['target_storage_class'] = cloud_target_storage_class
 
         (remote,) = ctx.cluster.only(client).remotes.keys()
-        remote.run(
-            args=[
-                'cd',
-                '{tdir}/s3-tests-{client}'.format(tdir=testdir, client=client),
-                run.Raw('&&'),
-                './bootstrap',
-                ],
-            )
         conf_fp = BytesIO()
         s3tests_conf.write(conf_fp)
         remote.write_file(
@@ -354,6 +345,13 @@ def configure(ctx, config):
                     ],
                 )
 
+def get_toxvenv_dir(ctx):
+    return ctx.tox.venv_path
+
+def toxvenv_sh(ctx, remote, args, **kwargs):
+    activate = get_toxvenv_dir(ctx) + '/bin/activate'
+    return remote.sh(['source', activate, run.Raw('&&')] + args, **kwargs)
+
 @contextlib.contextmanager
 def run_tests(ctx, config):
     """
@@ -368,6 +366,7 @@ def run_tests(ctx, config):
         client_config = client_config or {}
         (remote,) = ctx.cluster.only(client).remotes.keys()
         args = [
+            'cd', '{tdir}/s3-tests-{client}'.format(tdir=testdir, client=client), run.Raw('&&'),
             'S3TEST_CONF={tdir}/archive/s3-tests.{client}.conf'.format(tdir=testdir, client=client),
             'BOTO_CONFIG={tdir}/boto-{client}.cfg'.format(tdir=testdir, client=client)
             ]
@@ -379,29 +378,19 @@ def run_tests(ctx, config):
         else:
             args += ['REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt']
         # civetweb > 1.8 && beast parsers are strict on rfc2616
-        attrs = ["!fails_on_rgw", "!lifecycle_expiration", "!fails_strict_rfc2616","!test_of_sts","!webidentity_test"]
+        attrs = ["not fails_on_rgw", "not lifecycle_expiration", "not test_of_sts", "not webidentity_test"]
         if client_config.get('calling-format') != 'ordinary':
-            attrs += ['!fails_with_subdomain']
+            attrs += ['not fails_with_subdomain']
         if not client_config.get('with-sse-s3'):
-            attrs += ['!sse-s3']
+            attrs += ['not sse_s3']
        
         if 'extra_attrs' in client_config:
             attrs = client_config.get('extra_attrs') 
-        args += [
-            '{tdir}/s3-tests-{client}/virtualenv/bin/python'.format(tdir=testdir, client=client),
-            '-m', 'nose',
-            '-w',
-            '{tdir}/s3-tests-{client}'.format(tdir=testdir, client=client),
-            '-v',
-            '-a', ','.join(attrs),
-            ]
+        args += ['tox', '--', '-v', '-m', ' and '.join(attrs)]
         if 'extra_args' in client_config:
             args.append(client_config['extra_args'])
 
-        remote.run(
-            args=args,
-            label="s3 tests against rgw"
-            )
+        toxvenv_sh(ctx, remote, args, label="s3 tests against rgw")
     yield
 
 @contextlib.contextmanager
@@ -477,7 +466,7 @@ def task(ctx, config):
               rgw_server: client.1
               idle_timeout: 600
 
-    To pass extra arguments to nose (e.g. to run a certain test)::
+    To pass extra arguments to pytest (e.g. to run a certain test)::
 
         tasks:
         - ceph:
@@ -510,6 +499,7 @@ def task(ctx, config):
 
     """
     assert hasattr(ctx, 'rgw'), 's3tests must run after the rgw task'
+    assert hasattr(ctx, 'tox'), 's3tests must run after the tox task'
     assert config is None or isinstance(config, list) \
         or isinstance(config, dict), \
         "task s3tests only supports a list or dictionary for configuration"