Add project-specific CSIT job template 92/114792/3
authorLasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>
Wed, 11 Nov 2020 17:27:57 +0000 (19:27 +0200)
committerLasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>
Thu, 12 Nov 2020 11:22:14 +0000 (13:22 +0200)
 - add template for project-specific CSIT
 - apply the template in music component (note that this requires
   https://gerrit.onap.org/r/c/music/distributed-kv-store/+/114637
   to be merged to find the proper plans)
 - pass selected infra parameters to triggered docker build and
   CSIT jobs to have them use appropriate branch

Issue-ID: INT-1760
Signed-off-by: Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>
Change-Id: Id83e54548243e9d5dc7d932acae469a8b295c48f

jjb/integration/integration-macros.yaml
jjb/integration/integration-templates-csit.yaml
jjb/music/music-distributed-kv-store-csit.yaml

index d485b8e..b472846 100644 (file)
     builders:
       - shell: "${WORKSPACE}/run-csit.sh ${TESTPLAN} ${TESTOPTIONS}"
 
+- builder:
+    name: integration-run-project-test
+    builders:
+      - shell: "${WORKSPACE}/csit/run-project-csit.sh ${TESTPLAN} ${TESTOPTIONS}"
+
 - builder:
     name: integration-autorelease-fix-relativepaths
     builders:
           pass-threshold: '{pass-if}'
           only-critical: false
 
+- publisher:
+    name: integration-project-robot
+    publishers:
+      - robot:
+          output-path: 'csit/archives'
+          other-files: ''
+          unstable-threshold: '{unstable-if}'
+          pass-threshold: '{pass-if}'
+          only-critical: false
+
 - publisher:
     name: integration-docker-compose-logs
     publishers:
index c978753..3ae98a2 100644 (file)
           notify-every-unstable-build: false
           send-to-individuals: true
 
+- job-template:
+    name: '{project-name}-{stream}-project-csit-{functionality}'
+    disabled: '{disabled}'
+
+    project-type: freestyle
+    build-node: 'ubuntu1804-docker-8c-8g'
+    node: '{build-node}'
+    recipients: ''
+    java-version: 'openjdk11'
+    python-version: python3
+
+    properties:
+      - lf-infra-properties:
+          project: '{project}'
+          build-days-to-keep: '{build-days-to-keep}'
+
+    parameters:
+      - infra-parameters:
+          project: '{project}'
+          branch: '{branch}'
+          refspec: 'refs/heads/{branch}'
+          artifacts: '{archive-artifacts}'
+      - integration-test-plan:
+          test-plan: 'plans/{functionality}'
+      - integration-test-options:
+          test-options: '{robot-options}'
+
+    scm:
+      - gerrit-trigger-scm:
+          refspec: '$GERRIT_REFSPEC'
+          choosing-strategy: 'gerrit'
+          submodule-recursive: '{submodule-recursive}'
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    builders:
+      - lf-infra-pre-build
+      - lf-update-java-alternatives:
+          java-version: '{java-version}'
+      - integration-install-robotframework
+      - inject:
+          properties-file: 'env.properties'
+      - integration-run-project-test
+
+    publishers:
+      - integration-project-robot:
+          unstable-if: 0.0
+          pass-if: 100.0
+      - lf-infra-publish
+      - email:
+          recipients: '{recipients}'
+          notify-every-unstable-build: false
+          send-to-individuals: true
+
 - job-template:
     name: '{project-name}-unified-review-{stream}-test'
     disabled: '{disabled}'
             condition: UNSTABLE_OR_BETTER
             predefined-parameters: |
               UNIQUE_DOCKER_TAG=$BUILD_TAG
+              PROJECT=$PROJECT
+              BRANCH=$BRANCH
+              GERRIT_REFSPEC=$GERRIT_REFSPEC
             block: true
       - trigger-builds:
-         -  project: "{project-name}-{stream}-csit-{review-functionality}"
+         -  project: '{project-name}-{stream}-project-csit-{review-functionality}'
             condition: UNSTABLE_OR_BETTER
             predefined-parameters: |
               UNIQUE_DOCKER_TAG=$BUILD_TAG
+              PROJECT=$PROJECT
+              BRANCH=$BRANCH
+              GERRIT_REFSPEC=$GERRIT_REFSPEC
             block: true
     triggers:
       - gerrit-trigger-patch-submitted:
index 0b9834a..9551267 100644 (file)
@@ -2,7 +2,7 @@
 - project:
     name: music-distributed-kv-store-csit
     jobs:
-      - '{project-name}-{stream}-csit-{functionality}'
+      - '{project-name}-{stream}-project-csit-{functionality}'
       - '{project-name}-unified-review-{stream}-test'
     project-name: 'music-distributed-kv-store'
     project: 'music/distributed-kv-store'
@@ -12,8 +12,7 @@
     mvn-settings: 'music-distributed-kv-store-settings'
     mvn-global-settings: global-settings
     functionality:
-      - 'music-distributed-kv-store-test-plan':
-          trigger_jobs:
+      - 'music-distributed-kv-store-test-plan'
     review-functionality: 'music-distributed-kv-store-test-plan'
     robot-options: ''
     branch: 'master'