feat(hicn.yaml): add functional tests jobs 67/36867/2
authorMauro Sardara <msardara@cisco.com>
Thu, 11 Aug 2022 11:11:37 +0000 (13:11 +0200)
committerMauro Sardara <msardara@cisco.com>
Thu, 11 Aug 2022 11:15:06 +0000 (13:15 +0200)
The approach to trigger the functional test job is the same
adopted for triggering the build after the checkstyle.

A comment "build_successful" will be added in gerrit by the
build job, and this comment will in turn trigger the functional
test job.

Change-Id: I140160dfdd6fe80fdbe64848b9dc2c7a2b75cac4
Signed-off-by: Mauro Sardara <msardara@cisco.com>
jjb/global-macros.yaml
jjb/hicn/hicn.yaml
jjb/scripts/hicn/functest.sh [new file with mode: 0644]

index 5043b86..4468b03 100644 (file)
 
 #### TRIGGERS
 # Keep 'trigger' entries ordered alphabetically, please.
+- trigger:
+    name: gerrit-trigger-build
+    # Comes from hicn, some verify jobs wait for build to pass.
+    triggers:
+      - gerrit:
+          server-name: 'Primary'
+          trigger-on:
+            - comment-added-contains-event:
+                comment-contains-value: 'build_success'
+          projects:
+            - project-compare-type: 'ANT'
+              project-pattern: '{name}'
+              branches:
+                - branch-compare-type: 'ANT'
+                  branch-pattern: '**/{branch}'
+
 - trigger:
     name: gerrit-trigger-checkstyle
     # Comes from VPP, some verify jobs wait for checkstyle to pass.
index 2667a8a..f824c02 100644 (file)
@@ -15,7 +15,8 @@
 - project:
     name: hicn-x86_64
     jobs:
-      - "hicn-verify-{stream}-{os}-{executor-arch}"
+      - "hicn-verify-build-{stream}-{os}-{executor-arch}"
+      - "hicn-verify-functest-{stream}-{os}-{executor-arch}"
       - "hicn-merge-{stream}-{os}-{executor-arch}"
     project: "hicn"
     os: ubuntu2004
@@ -27,7 +28,7 @@
 - project:
     name: hicn-aarch64
     jobs:
-      - "hicn-verify-{stream}-{os}-{executor-arch}"
+      - "hicn-verify-build-{stream}-{os}-{executor-arch}"
       - "hicn-merge-{stream}-{os}-{executor-arch}"
     project: "hicn"
     os: ubuntu2004
           fixed-delay: 90
 
 - job-template:
-    name: "hicn-verify-{stream}-{os}-{executor-arch}"
+    name: "hicn-verify-build-{stream}-{os}-{executor-arch}"
 
     project-type: freestyle
     node: "builder-{os}-prod-{executor-arch}"
       - gerrit-trigger-checkstyle:
           name: "{project}"
           branch: "{branch}"
+      - gerrit:
+          override-votes: true
+          gerrit-build-notbuilt-verified-value: 0
+          gerrit-build-successful-verified-value: 1
+          # yamllint disable-line rule:line-length
+          notbuilt-message: "Automatic retry of failed jobs may be in process. A proper vote should be set when retry completes."
+          # yamllint disable-line rule:line-length
+          failed-message: "Build failed. No further verify jobs will be started."
+          successful-message: "build_success"
+          skip-vote:
+            successful: true
+            failed: false
+            unstable: false
+            notbuilt: false
+
+
+    builders:
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
+      - shell: !include-raw-escape:
+          - ../scripts/hicn/build.sh
+
+    publishers:
+      - fdio-infra-publish
+
+- job-template:
+    name: "hicn-verify-functest-{stream}-{os}-{executor-arch}"
+
+    project-type: freestyle
+    node: "{os}-builder-4c-4g"
+    concurrent: true
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: "{build-days-to-keep}"
+
+    parameters:
+      - project-parameter:
+          project: "{project}"
+      - gerrit-parameter:
+          branch: "{branch}"
+      - os-parameter:
+          os: "{os}"
+      - stream-parameter:
+          stream: "{stream}"
+
+    scm:
+      - gerrit-trigger-scm:
+          credentials-id: "jenkins-gerrit-credentials"
+          refspec: "$GERRIT_REFSPEC"
+          choosing-strategy: "gerrit"
+
+    wrappers:
+      - fdio-infra-wrappers:
+          build-timeout: 120
+
+    triggers:
+      - gerrit-trigger-build:
+          name: "{project}"
+          branch: "{branch}"
 
     builders:
       - shell: !include-raw-escape:
diff --git a/jjb/scripts/hicn/functest.sh b/jjb/scripts/hicn/functest.sh
new file mode 100644 (file)
index 0000000..e520c78
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+# basic build script example
+set -euxo pipefail
+
+echo "---> jjb/scripts/hicn/functest.sh"
+
+pushd scripts
+bash ./functional-tests.sh
+popd