ods-core icon indicating copy to clipboard operation
ods-core copied to clipboard

Quickstarter tests: Verifying Jenkins run attachments fails

Open cschweikert opened this issue 3 years ago • 0 comments

Decription

When running the quickstarter tests the verification of the Jenkins run attachments fails. This issue has to do with a failed calculation of the build url (see below for more details).

Steps to reproduce the behavior:

  1. Go to a local checkout of ods-core.
  2. Switch to subfolder ./tests
  3. Run make test-quickstarter QS=fe-angular
  4. QS provisioning and first build was successful, the verification of the build artifiacts of this first build might fail.

Expected behavior:

The verification script detects existance of an artifact file called /artifact/artifacts/SCRR-UNITT-fe-angular-test.docx.

Affected version:

  • OpenShift: 4.8
  • OpenDevStack: 4.x

Log Output (ensure to remove any confidential information like tokens, project names, etc.

...
Pipeline: run-unitt-fe-angular-test-unitt, build name from response: run-unitt-fe-angular-test-unitt-master-9
Verifying Jenkins run attachments of run-unitt-fe-angular-test-unitt-master-9 ...
Getting artifact: SCRR-unitt-fe-angular-test.docx from project: unitt-cd for build run-unitt-fe-angular-test-unitt-master-9
    TestQuickstarter/fe-angular: quickstarter_test.go:324: Could not execute tests/scripts/get-artifact-from-jenkins-run.sh
         - err:exit status 3
        out:
        grabbing artifact from /artifact/artifacts/SCRR-unitt-fe-angular-test.docx - and storing in /tmp
        
        stderr:curl: (3) URL using bad/illegal format or missing URL
        
--- FAIL: TestQuickstarter (0.00s)
    --- FAIL: TestQuickstarter/fe-angular (104.72s)
FAIL
FAIL	github.com/opendevstack/ods-core/tests/quickstarter	105.173s
FAIL
make: *** [test-quickstarter] Error 1

Additional context:

The calculation of the build url works via an oc command from this line: https://github.com/opendevstack/ods-core/blob/fda5048f63e4702a486a28c8824bdaef2827e921/tests/scripts/get-artifact-from-jenkins-run.sh#L7 An example call of this line looks like this:

oc get -n unitt-cd build run-unitt-fe-angular-test-unitt-master-1 -o jsonpath='{.metadata.annotations.openshift\.io/jenkins-build-uri}'

When calling this exmaple command directly the response looks like this:

I0328 13:44:49.206993   63116 request.go:621] Throttling request took 1.142624135s, request: GET:https://api.MYCLUSTER.openshiftapps.com:6443/apis/kafka.strimzi.io/v1beta1?timeout=32s
https://jenkins-unitt-cd.apps.MYCLUSTER.openshiftapps.com/job/unitt-cd/job/unitt-cd-run-unitt-fe-angular-test-unitt-master/1/%

I'd rather expect an output with just the URL and without the % sign at the end.

cschweikert avatar Mar 28 '22 14:03 cschweikert