Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-3966

Unit test failing with "Unable to retrieve current OCP version: Malformed version:"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None
    • 3
    • False
    • None
    • False

      Description of problem:

      I am working on adding a GitHub Workflow for tracking Codecov in the gitops-operator repo (respective ticket link: https://issues.redhat.com/browse/GITOPS-3278), but the job run is failing due to some OpenShift CI execution, please see this job run: https://github.com/redhat-developer/gitops-operator/actions/runs/7638249211/job/20808735327?pr=590

      It failed with:

      2024/01/24 09:40:13 Unable to retrieve current OCP version: Malformed version:
      FAIL 
      coverage: 69.8% of statements
      FAIL github.com/redhat-developer/gitops-operator/controllers 0.088s
      ok github.com/redhat-developer/gitops-operator/controllers/argocd 0.022s coverage: 92.9% of statements
      ok github.com/redhat-developer/gitops-operator/controllers/argocd/openshift 0.015s coverage: 69.6% of statements
      ? github.com/redhat-developer/gitops-operator/version [no test files]
      ok github.com/redhat-developer/gitops-operator/controllers/util 0.012s coverage: 16.7% of statements
      FAIL
      make: *** [Makefile:113: test] Error 1
      Error: Process completed with exit code 2.
      

      I see the actual error is (line 214 in the link of the job run):

      2024-01-25T05:46:17Z ERROR controller_argocd_metrics Error retrieving operator's running namespace {"Request.Namespace": "openshift-gitops", "Request.Name": "openshift-gitops", "error": "open /var/run/secrets/kubernetes.io/serviceaccount/namespace: no such file or directory"}

      The unit test script used is github.com/redhat-developer/gitops-operator/blob/master/scripts/openshiftci-presubmit-unittests.sh.

      Prerequisites (if any, like setup, operators/versions):

      Ability to run OpenShift CI unit tests in gitops-operator repo.

      Steps to Reproduce

       Try to execute GH Action as per the linked job run above.

      Actual results:

      Expected results:

      Reproducibility (Always/Intermittent/Only Once):

      Acceptance criteria: 

       

      Definition of Done:

      CodeCov Report should be generated.

      Additional info (Such as Logs, Screenshots, etc):

      Logs can be found in the job run link shared above.

            mbhalodi@redhat.com Meha Bhalodiya
            mbhalodi@redhat.com Meha Bhalodiya
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: