← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] qa-jenkins-jobs:prompting-client-001 into qa-jenkins-jobs:master

 

Tim Andersson has proposed merging qa-jenkins-jobs:prompting-client-001 into qa-jenkins-jobs:master.

Requested reviews:
  Canonical Platform QA Team (canonical-platform-qa)

For more details, see:
https://code.launchpad.net/~canonical-platform-qa/qa-jenkins-jobs/+git/qa-jenkins-jobs/+merge/494280

add prompting client testing to urm jenkins
-- 
Your team Canonical Platform QA Team is requested to review the proposed merge of qa-jenkins-jobs:prompting-client-001 into qa-jenkins-jobs:master.
diff --git a/jobs/macros.yaml b/jobs/macros.yaml
index a8a1f2d..61be8d5 100644
--- a/jobs/macros.yaml
+++ b/jobs/macros.yaml
@@ -15,6 +15,40 @@
 # You should have received a copy of the GNU General Public License along
 # with this program.  If not, see <http://www.gnu.org/licenses/>.
 ---
+- builder:
+    name: dl-iso-to-cache
+    builders:
+        - shell:
+            command: |
+                #!/bin/bash
+                set -ex
+                development_release=$(distro-info --devel || echo UNKNOWN)
+                if [ {release} = $development_release ]; then
+                    iso_base_url="https://cdimage.ubuntu.com/daily-live/pending/";
+                else
+                    iso_base_url="https://cdimage.ubuntu.com/{release}/daily-live/pending/";
+                fi
+                iso_name="{release}-desktop-amd64.iso"
+                iso_url="${{iso_base_url}}${{iso_name}}"
+                shasum_url="${{iso_base_url}}SHA256SUMS"
+                cache_dir="/srv/data/.rf_image_cache/{release}/"
+                if test -f "${{cache_dir}}${{iso_name}}" && test -f "${{cache_dir}}SHA256SUMS"; then
+                    shasum_tmp=$(mktemp)
+                    retry -t 20 -d 30 -- wget -q -O "${{shasum_tmp}}" "${{shasum_url}}"
+                    tmpdir_shasum=$(grep "${{iso_name}}" < "${{shasum_tmp}}" | cut -d" " -f1)
+                    rm "${{shasum_tmp}}"
+                    cache_shasum=$(grep "${{iso_name}}" < "${{cache_dir}}SHA256SUMS" | cut -d' ' -f1)
+                    if [[ "${{tmpdir_shasum}}" == "${{cache_shasum}}" ]]; then
+                        exit 0
+                    fi
+                fi
+                rm -r "${{cache_dir}}"
+                mkdir -p "${{cache_dir}}"
+                retry -t 3 -d 180 -- wget -q "${{iso_url}}" -P "${{cache_dir}}" || exit 88
+                retry -t 3 -d 180 -- wget -q "${{shasum_url}}" -P "${{cache_dir}}" || exit 88
+            unstable-return: 88
+
+
 - builder:  # This step removes artifacts from previous builds
     name: clear-artifacts
     builders:
diff --git a/jobs/prompting-client/jobs.yaml b/jobs/prompting-client/jobs.yaml
new file mode 100644
index 0000000..c622c5a
--- /dev/null
+++ b/jobs/prompting-client/jobs.yaml
@@ -0,0 +1,108 @@
+---
+# vim: sw=4 ts=4 et
+
+# QA Jenkins Jobs
+# Copyright 2016 Canonical Ltd.
+
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
+# by the Free Software Foundation.
+
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+# PURPOSE.  See the GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The project stanza describes all jobs and parameters
+
+- project:
+    name: 'prompting-client-testing'
+    release:
+        - 'questing'
+        - 'resolute'
+    test_case:
+        - 'Prompting-Client-Basic'
+    jobs:
+        - 'prompting-{release}-desktop-{test_case}'
+
+- job-template:
+    name: 'prompting-{release}-desktop-{test_case}'
+    description: |
+        Runs a test case on a VM
+    parameters:
+      - string:
+          name: HIT_BRANCH
+          default: 'main'
+          description: branch of HIT to run tests from
+      - string:
+          name: RF_BRANCH
+          default: 'main'
+          description: branch of RF to run tests from
+    node: 'rf-iso-testing'
+    triggers:
+        - pollurl:
+            cron: '@hourly'
+            polling-node: 'rf-iso-testing'
+            urls:
+              - url: 'http://cdimage.ubuntu.com/daily-live/pending/.publish_info#rf-{release}-desktop-{test_case}'
+                check-content:
+                  - text:
+                      - '^{release}-.*.iso .+$'
+              - url: 'http://cdimage.ubuntu.com/{release}/daily-live/pending/.publish_info#rf-{release}-desktop-{test_case}'
+                check-content:
+                  - text:
+                      - '^{release}-.*.iso .+$'
+    wrappers:
+      - timeout:
+          timeout: 60
+          fail: true
+          type: no-activity
+      - workspace-cleanup
+      - timestamps
+      - credentials-binding:
+          - text:
+              credential-id: GH_PAT
+              variable: GH_PAT
+    builders:
+        - clear-artifacts
+        - dl-iso-to-cache
+        - shell:
+            command: |
+                #!/bin/bash
+                set -ex
+                # clone HIT and yarf
+                cache_dir="/srv/data/.rf_image_cache/{release}/"
+                retry -t 3 -d 180 -- git clone -b "$HIT_BRANCH" https://oauth2:"$GH_PAT"@github.com/canonical/hardware-installer-testing.git
+                retry -t 3 -d 180 -- git clone -b "$RF_BRANCH" https://oauth2:"$GH_PAT"@github.com/canonical/yarf.git
+                retry -t 3 -d 180 -- git clone -b "$RF_BRANCH" https://oauth2:"$GH_PAT"@github.com/canonical/ubuntu-gui-testing.git
+                DEBIAN_FRONTEND=noninteractive sudo apt-get install -y clang libxkbcommon-dev tesseract-ocr golang-go
+                ISO_PATH="${{cache_dir}}{release}-desktop-amd64.iso"
+                cd yarf/
+                sudo snap install astral-uv --classic
+                # set up venv
+                uv sync
+                . .venv/bin/activate
+                uv pip install .[develop] -r ../hardware-installer-testing/requirements.txt
+                cd ../hardware-installer-testing
+                SHASUM=$(sha256sum "$ISO_PATH" | cut -d" " -f1)
+                # if the DISK_PATH exists, we don't need to create it
+                # i.e. we don't even need to run the installer test
+                DISK_PATH="/srv/data/$SHASUM-preinst.qcow2"
+                if [ ! -f "$DISK_PATH" ]; then
+                    rm /srv/data/*-preinst.qcow2 || true
+                    ./runner/spawn_and_run_test_suite.py --test-suite robot/test-cases/{release}/entire-disk --iso "$ISO_PATH" --qemu-args-json ./runner/qemu-args.json --disk-path "$DISK_PATH"
+                fi
+                OVERLAY_IMG="/tmp/{test_case}-overlay.qcow2"
+                qemu-img create -o backing_file="$DISK_PATH",backing_fmt=qcow2 -f qcow2 "$OVERLAY_IMG"
+                cd runner/go
+                go build -o main
+                ./main -disk-path "$OVERLAY_IMG" -script-path ../../../ubuntu-gui-testing/tests/prompting-client/ -suite {test_case}
+            unstable-return: 88
+    publishers:
+        - archive:
+            artifacts: 'hardware-installer-testing/artifacts/*'
+            allow-empty: 'true'
+
diff --git a/jobs/robot-framework-iso-testing/jobs.yaml b/jobs/robot-framework-iso-testing/jobs.yaml
index ae69387..d76f37e 100644
--- a/jobs/robot-framework-iso-testing/jobs.yaml
+++ b/jobs/robot-framework-iso-testing/jobs.yaml
@@ -76,35 +76,7 @@
               variable: GH_PAT
     builders:
         - clear-artifacts
-        - shell:
-            command: |
-                #!/bin/bash
-                set -ex
-                development_release=$(distro-info --devel || echo UNKNOWN)
-                if [ {release} = $development_release ]; then
-                    iso_base_url="https://cdimage.ubuntu.com/daily-live/pending/";
-                else
-                    iso_base_url="https://cdimage.ubuntu.com/{release}/daily-live/pending/";
-                fi
-                iso_name="{release}-desktop-amd64.iso"
-                iso_url="${{iso_base_url}}${{iso_name}}"
-                shasum_url="${{iso_base_url}}SHA256SUMS"
-                cache_dir="/srv/data/.rf_image_cache/{release}/"
-                if test -f "${{cache_dir}}${{iso_name}}" && test -f "${{cache_dir}}SHA256SUMS"; then
-                    shasum_tmp=$(mktemp)
-                    retry -t 20 -d 30 -- wget -q -O "${{shasum_tmp}}" "${{shasum_url}}"
-                    tmpdir_shasum=$(grep "${{iso_name}}" < "${{shasum_tmp}}" | cut -d" " -f1)
-                    rm "${{shasum_tmp}}"
-                    cache_shasum=$(grep "${{iso_name}}" < "${{cache_dir}}SHA256SUMS" | cut -d' ' -f1)
-                    if [[ "${{tmpdir_shasum}}" == "${{cache_shasum}}" ]]; then
-                        exit 0
-                    fi
-                fi
-                rm -r "${{cache_dir}}"
-                mkdir -p "${{cache_dir}}"
-                retry -t 3 -d 180 -- wget -q "${{iso_url}}" -P "${{cache_dir}}" || exit 88
-                retry -t 3 -d 180 -- wget -q "${{shasum_url}}" -P "${{cache_dir}}" || exit 88
-            unstable-return: 88
+        - dl-iso-to-cache
         - shell:
             command: |
                 #!/bin/bash

Follow ups