[openqa-tests/sam/ci] CI: add job to test s3-image




commit 2be12b8e289cef568f7f894afed1867fe6bd7cc9
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Tue Nov 9 11:56:48 2021 +0100

    CI: add job to test s3-image
    
    We need some way to gate merge requests for this repo now
    the tests are separate from gnome-build-meta. Running the
    tests against the prebuilt s3-image seems a good way.
    
    See also: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/404

 .gitlab-ci.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..4f8c0be
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,67 @@
+variables:
+  OPENQA_HOST: https://openqa.gnome.org
+  OPENQA_TESTS_GIT: https://gitlab.gnome.org/gnome/openqa-tests
+  OPENQA_TESTS_BRANCH: master
+  OPENQA_NEEDLES_GIT: https://gitlab.gnome.org/gnome/openqa-needles
+  OPENQA_NEEDLES_BRANCH: master
+
+
+stages:
+- test
+
+test-s3-image-x86_64:
+  stage: test
+  image:
+    name: registry.opensuse.org/devel/openqa/containers15.2/openqa_worker:latest
+    entrypoint: ["/bin/bash", "-c"]
+  when: manual
+  variables:
+    IMAGE: gnome_os_installer.iso
+    # CI needs to be set so OPENQA_TEST_TIMEOUT_SCALE_CI has an effect.
+    CI: 1
+    OPENQA_TEST_TIMEOUT_SCALE_CI: 4
+  needs:
+  - job: 'iso-installer-x86_64'
+    artifacts: true
+  script:
+  - |
+    wget https://os.gnome.org/download/latest/gnome_os_installer.iso
+  - |
+    mkdir -p /data/factory/iso/
+    ln -s $(pwd)/image/installer.iso /data/factory/iso/installer.iso
+  - |
+    rm /etc/openqa/*
+    cat >/etc/openqa/client.conf <<EOF
+    [openqa.gnome.org]
+    key = $OPENQA_API_KEY
+    secret = $OPENQA_API_SECRET
+    EOF
+  - |
+    worker_class=qemu_x86_64-${CI_JOB_ID}
+    openqa/utils/setup_worker.sh ${worker_class} > /tmp/machine_id
+    /run_openqa_worker.sh &> worker.log &
+  - |
+    openqa/utils/start_job.sh ${worker_class} master > /tmp/job_id
+    echo "Test job has been started, visit $OPENQA_HOST/tests/$(cat /tmp/job_id) to see the progress"
+  - openqa/utils/wait_for_job.sh $(cat /tmp/job_id) > /tmp/exit_code
+  - exit $(cat /tmp/exit_code)
+  after_script:
+  - |
+    if [ -e /tmp/machine_id ]; then
+        echo "Cleaning up worker"
+        openqa/utils/teardown_worker.sh $(cat /tmp/machine_id)
+        rm /tmp/machine_id
+    fi
+  - if [ ! -e /tmp/exit_code ]; then
+        echo "Job creation failed, log below."
+        cat openqa.log
+  - fi
+  artifacts:
+    when: always
+    paths:
+    - openqa.log
+    - worker.log
+    expire_in: '1 week'
+  tags:
+  - x86_64
+  - gnome-build-meta


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]