opendevstack / opendevstack/ods-core

Quickstarter tests: Verifying Jenkins run attachments fails

Open
#1,124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Shell
Stars
53
Forks
34
Avg merge
3h 26m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/scripts/get-artifact-from-jenkins-run.sh at the oc command referenced in the issue, then run make test-quickstarter QS=fe-angular from tests to reproduce the malformed build URL. Check the command output and curl invocation; done means the artifact verification reaches /artifact/artifacts/SCRR-UNITT-fe-angular-test.docx without the bad trailing character.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
ci-cd, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.