← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] ~andersson123/qa-jenkins-jobs:hardware-testing-jobs-amendments into qa-jenkins-jobs:master

 

Tim Andersson has proposed merging ~andersson123/qa-jenkins-jobs:hardware-testing-jobs-amendments into qa-jenkins-jobs:master.

Commit message:
Commit 1:
add git-clone macro as alternative to git-shallow-clone

git-shallow-clone interferes with checking out branches, and thus wasn't
appropriate to use for the new hardware testing jobs.

This commit adds a new macro, `git-clone` which does a git clone without
any --depth argument.

Commit 2:
fix hardware-iso-testing jobs.yaml

This commit amends the artifacts definition as well as utilising the
previously implemented git-clone macro, and also amends the way the
pip requirements for the hardware-installer-testing script are
installed.

These changes were tested via a cowboy on the jenkins instance (aside
from the git-clone macro).

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

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

The job failed on jenkins, so I hacked about with the configuration and came to these changes being required.
-- 
Your team Canonical Platform QA Team is requested to review the proposed merge of ~andersson123/qa-jenkins-jobs:hardware-testing-jobs-amendments into qa-jenkins-jobs:master.
diff --git a/jobs/hardware-iso-testing/jobs.yaml b/jobs/hardware-iso-testing/jobs.yaml
index 2f68257..adb93f7 100644
--- a/jobs/hardware-iso-testing/jobs.yaml
+++ b/jobs/hardware-iso-testing/jobs.yaml
@@ -40,8 +40,8 @@
             cd hardware-installer-testing/
             git checkout "${{HW_INSTALLER_TESTING_BRANCH}}"
             python3 -m venv venv
-            source venv/bin/activate
-            pip3 install rpyc==5.3.1
+            . venv/bin/activate
+            pip3 install -r requirements.txt
             python3 ./scripts/call_job.py --job-config test-definitions/{release}/{test-case}.json --client-id {client-id} --c3-client-id "${{C3_CLIENT_ID}}" --c3-secret "${{C3_SECRET}}"
 
 # job templates
@@ -69,7 +69,7 @@
               variable: C3_SECRET
     builders:
       - clear-artifacts:
-      - git-shallow-clone:
+      - git-clone:
           project-url: 'https://github.com/canonical/hardware-installer-testing.git'
           project-name: 'hardware-installer-testing'
       - run-hardware-installer-test:
@@ -78,4 +78,4 @@
           client-id: '{client-id}'
     publishers:
       - archive:
-          artifacts: '*.html'
+          artifacts: 'hardware-installer-testing/*.html'
diff --git a/jobs/macros.yaml b/jobs/macros.yaml
index 3d3a175..bd2d8c2 100644
--- a/jobs/macros.yaml
+++ b/jobs/macros.yaml
@@ -53,6 +53,15 @@
             retry git clone --depth 1 {project-url} {project-name}
 
 - builder:
+    name: git-clone
+    builders:
+        - shell: |
+            #!/bin/bash
+            retry() (for i in {{0..4}}; do sleep $((8*i**3)) && "${{@:1}}" && break; done)
+            rm -rf {project-name}
+            retry git clone {project-url} {project-name}
+
+- builder:
     name: grafana-setup
     builders:
         - branch-bzr-project: