red-hat-storage / ocs-ci

https://ocs-ci.readthedocs.io/en/latest/
MIT License
108 stars 166 forks source link

catalogsource and cluster-name checks trip up testing against existing cluster #2705

Closed mmgaggle closed 2 years ago

mmgaggle commented 4 years ago

I needed to comment out the catalogsource + version collection logic to get the test suites to run against a cluster I had provisioned outside of ocs-ci via good old openshift-install. Ultimately, I'm using the following to run tests -

run-ci --deploy \
       --cluster-name foobarbaz \
       --cluster-path ~/openshift-install-dir \
       --log-level INFO \
       tests/libtest/test_pod_exec.py 

Changes required to remove the catalogsource + version collection logic

index e5abf4d8..d76e52bf 100644
--- a/ocs_ci/framework/pytest_customization/ocscilib.py
+++ b/ocs_ci/framework/pytest_customization/ocscilib.py
@@ -221,13 +221,13 @@ def pytest_configure(config):
         del config._metadata['Platform']

         config._metadata['Test Run Name'] = get_testrun_name()
-        gather_version_info_for_report(config)
+        # gather_version_info_for_report(config)

-        ocs_csv = get_ocs_csv()
-        ocs_csv_version = ocs_csv.data['spec']['version']
-        config.addinivalue_line(
-            "rp_launch_tags", f"ocs_csv_version:{ocs_csv_version}"
-        )
+        # ocs_csv = get_ocs_csv()
+        # ocs_csv_version = ocs_csv.data['spec']['version']
+        #config.addinivalue_line(
+        #    "rp_launch_tags", f"ocs_csv_version:{ocs_csv_version}"
+        #)

The cluster name was actually kb, but that generated an error, so I used foobarbaz.

INTERNALERROR> ocs_ci.framework.exceptions.ClusterNameLengthError: Cluster Name 'kb' is 2 characters long while it should be 5-17 characters long

If I drop --cluster-name foobarbaz completely, I get another error:

INTERNALERROR> ocs_ci.framework.exceptions.ClusterNameNotProvidedError: Please provide a valid --cluster-name.

Probably should grab the name of the cluster using oc instead.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs.

github-actions[bot] commented 2 years ago

This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.