Merge ~kissiel/hwcert-tools:add-beta-snap-build-step into hwcert-tools:mini-ci-legacy

Proposed by Maciej Kisielewski
Status: Needs review
Proposed branch: ~kissiel/hwcert-tools:add-beta-snap-build-step
Merge into: hwcert-tools:mini-ci-legacy
Diff against target: 74 lines (+43/-11)
1 file modified
src/www/snapcraft/run-snapcraft-test.sh (+43/-11)
Reviewer Review Type Date Requested Status
Taihsiang Ho (community) Needs Fixing
Jonathan Cave Approve
Review via email: mp+321148@code.launchpad.net

This proposal supersedes a proposal from 2017-03-22.

Description of the change

Snapcraft Testing: bring testing of beta branch and tidy up the scripts

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Looks good to me.

Thanks for adding the --devmode and also the testing of beta. As both edge and beta are essentially rolling builds I think it is good to test these.

review: Approve
Revision history for this message
Taihsiang Ho (tai271828) wrote : Posted in a previous version of this proposal
Revision history for this message
Taihsiang Ho (tai271828) wrote :

Dry-run did not pass on real mini-ci. I did not get the email notification. I tried to manually reproduce again but the flow interrupted. I will check this is caused by this change or the mini-ci framework itself.

I rolled back to another version with --devimode appended only for the current production mini-ci.

Revision history for this message
Jonathan Cave (jocave) wrote :

I think a true negative is better than a false positive

Revision history for this message
Taihsiang Ho (tai271828) wrote :

Agree.

My previous comment meant that dry-run did not run through the test because something crashed. That is, mini-ci for checkbox-snappy build died. All the emails sent today were not from this MR. I am checking the root cause.

Revision history for this message
Taihsiang Ho (tai271828) wrote :

It seems that smoke-test has warm reboot test now to cause the weird behavior of mini-ci. mini-ci does not expect reboot during the test unit. Reboot confuses mini-ci. I will fix mini-ci to fit this checkbox-snappy test by checking if the systemd file is there for the reboot test job.

I will merge mini-ci fix first and then this test script.

Revision history for this message
Taihsiang Ho (tai271828) wrote :

I realized the reboot test of smoke-test[1] could not trace the this test script as well and not only make the mini-ci itself confused. Please see my line comments.

The first thing came to my mind is to prepare another specific test plan for mini-ci rather than an updated test script and changing the flow of the current mini-ci, because it is easier and won't affect the other components in the mini-ci flow, which is not designated to be able to trace reboot status.

[1]

------------[ Running job 471 / 494. Estimated time left: unknown ]-------------
---------------------------[ Perform warm reboot 1 ]----------------------------
ID: 2013.com.canonical.certification::warm-boot-loop-reboot1
Category: 2013.com.canonical.certification::stress-tests/warm-boot
Waiting for the system to shut down or reboot...
Created symlink from /etc/systemd/system/multi-user.target.wants/plainbox-autostart.service to /etc/systemd/system/plainbox-autostart.service.
... 8< -------------------------------------------------------------------------
Connection to 10.101.48.116 closed by remote host.
Connection to 10.101.48.116 closed.

review: Needs Fixing

Unmerged commits

7391692... by Maciej Kisielewski

add checking of the beta branch of checkbox-snappy

Also:
  use lp:checkbox-snappy instead of the packaging branch from ~checkbox-dev
  make failing one branch not stop the whole script
  invoke checkbox-snappy from ~/ to avoid problems with calling from tmps

Signed-off-by: Maciej Kisielewski <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/www/snapcraft/run-snapcraft-test.sh b/src/www/snapcraft/run-snapcraft-test.sh
2index 0c192ad..c54522c 100755
3--- a/src/www/snapcraft/run-snapcraft-test.sh
4+++ b/src/www/snapcraft/run-snapcraft-test.sh
5@@ -1,7 +1,7 @@
6 #!/usr/bin/env bash
7 # This file is part of Checkbox.
8 #
9-# Copyright 2016 Canonical Ltd.
10+# Copyright 2016-2017 Canonical Ltd.
11 # Written by:
12 # Maciej Kisielewski <maciej.kisielewski@canonical.com>
13 #
14@@ -50,18 +50,50 @@ function run_step {
15 echo -n elapsed: ; cat $LOG_DIR/timing.dat
16 if [ $outcome -ne 0 ]; then
17 pastebin_logs
18- clean_up
19- echo "STOPPING EXECUTION"
20- exit 1
21+ return 1
22 fi
23 }
24
25-run_step "git-clone" "git clone -b master https://git.launchpad.net/~checkbox-dev/plainbox-provider-snappy/+git/packaging"
26-run_step "update-snapcraft" "snapcraft update"
27-(cd packaging && run_step "run-snapcraft" "snapcraft snap -o ../checkbox-snappy.snap")
28-run_step "verify-build" "ls -al checkbox-snappy.snap"
29-run_step "install-checkbox-snappy" "sudo snap install ./checkbox-snappy.snap"
30-run_step "run smoke-test" "checkbox-snappy.smoke-test"
31+# master branch test
32+function test_master {
33+ run_step "git-clone" "git clone -b master https://git.launchpad.net/checkbox-snappy packaging" || return 1
34+ run_step "update-snapcraft" "snapcraft update" || return 1
35+ (cd packaging && run_step "run-snapcraft" "snapcraft snap -o ../checkbox-snappy.snap") || return 1
36+ run_step "verify-build" "ls -al checkbox-snappy.snap" || return 1
37+ run_step "install-checkbox-snappy" "sudo snap install --devmode ./checkbox-snappy.snap" || return 1
38+ (cd && run_step "run smoke-test" "checkbox-snappy.smoke-test") || return 1
39+ return 0
40+}
41+test_master
42+master_result=$?
43+if [[ $master_result -eq 1 ]]; then
44+ echo "Testing Checkbox snap for branch master failed!"
45+fi
46 pastebin_logs
47+
48+# beta branch test
49+function test_beta {
50+ run_step "git-clone" "git clone -b beta https://git.launchpad.net/checkbox-snappy packaging-beta" || return 1
51+ run_step "update-snapcraft" "snapcraft update" || return 1
52+ (cd packaging-beta && run_step "run-snapcraft" "snapcraft snap -o ../checkbox-snappy-beta.snap") || return 1
53+ run_step "verify-build" "ls -al checkbox-snappy-beta.snap" || return 1
54+ run_step "install-checkbox-snappy" "sudo snap install --devmode ./checkbox-snappy-beta.snap" || return 1
55+ (cd && run_step "run smoke-test" "checkbox-snappy.smoke-test") || return 1
56+ return 0
57+}
58+test_beta
59+beta_result=$?
60+if [[ $beta_result -eq 1 ]]; then
61+ echo "Testing Checkbox snap for branch beta failed!"
62+fi
63+pastebin_logs
64+
65 clean_up
66-echo "ALL STEPS PASSED"
67+echo "$master_result"
68+echo "$beta_result"
69+if [[ $master_result -eq 0 && $beta_result -eq 0 ]]; then
70+ echo "ALL STEPS PASSED"
71+ exit 0
72+else
73+ exit 1
74+fi

Subscribers

People subscribed via source and target branches