tests: add out-of-the-box test suite #3635

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
Contributor

zyga commented Jul 31, 2017

This patch adds out-of-the-box test suite that tests how snapd behaves
out-of-the box, for regular users. There is no elaborate setup, no
package building involved. The test is juts installing snapd from the
repository (enabling a 3rd party repository in case of openSUSE) and
installs a simple snap.

The point of this test is to catch errors out in the wild, such as the
recently discovered hang (still) affecting Debian 9. For that purpose
the tests are specificall as close to what people would really do as
possible.

The suite is marked as manual and should be invoked nightly as a canary
test, to ensure we're doing okay.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

tests: add out-of-the-box test suite
This patch adds out-of-the-box test suite that tests how snapd behaves
out-of-the box, for regular users. There is no elaborate setup, no
package building involved. The test is juts installing snapd from the
repository (enabling a 3rd party repository in case of openSUSE) and
installs a simple snap.

The point of this test is to catch errors out in the wild, such as the
recently discovered hang (still) affecting Debian 9. For that purpose
the tests are specificall as close to what people would really do as
possible.

The suite is marked as manual and should be invoked nightly as a canary
test, to ensure we're doing okay.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Contributor

zyga commented Aug 3, 2017

Note that this inadvertently breaks other tests. I'll keep this open for a few days and try to fix it. I think the test is very valuable in itself. If it doesn't work here perhaps we want to add it to a set of nightly tests that run from another repo.

+summary: Install first snap and core in one go
+# This test is disabled on Debian for now because it uncovers a bug.
+# https://forum.snapcraft.io/t/snapd-out-of-the-box-experience-debian-9
+systems: [-debian-*]
@mvo5

mvo5 Aug 9, 2017

Collaborator

Once 2.27 hits stable this can be removed. Lets remove it now and merge the PR once 2.27 is available in stable and the PR turns green because of this. WDYT?

@zyga

zyga Aug 10, 2017

Contributor

Yes, I'd like to also make sure it can co-exist with regular spread.yaml

minor comments inline

- # Force a log rotation with small size
- sed -i.bak s/#SystemMaxUse=/SystemMaxUse=1K/g /etc/systemd/journald.conf
- systemctl kill --kill-who=main --signal=SIGUSR2 systemd-journald.service
+ if [ ${SKIP_SETUP:-} != "yes" ]; then
@sergiocazzolato

sergiocazzolato Aug 18, 2017

Contributor

why "yes" and not "true"?

@sergiocazzolato

sergiocazzolato Aug 18, 2017

Contributor

This part of the setup is good to have it in the test, so you don't mix information of diferent tests in the same test error
report.

@zyga

zyga Aug 30, 2017

Contributor

I can switch to true. Can you expand on your remark about this part is good to have?

- # Restore the initial configuration and rotate logs
- mv /etc/systemd/journald.conf.bak /etc/systemd/journald.conf
- systemctl kill --kill-who=main --signal=SIGUSR2 systemd-journald.service
+ # Restore the initial configuration and rotate logs
@sergiocazzolato

sergiocazzolato Aug 18, 2017

Contributor

are those tabs instead of spaces?

@zyga

zyga Aug 30, 2017

Contributor

Indeed, sorry about that. I'll fix this.

+ prepare-each: |
+ case "$SPREAD_SYSTEM" in
+ debian-*|ubuntu-*)
+ apt-get update
@sergiocazzolato

sergiocazzolato Aug 18, 2017

Contributor

perhaps this could be in teh pkgdb.sh script, and use the distro_* functions

@zyga

zyga Aug 24, 2017

Contributor

I wanted to mirror instructions from snapcraft.io and not convolute this with any layers of indirection.

+ restore-each: |
+ case "$SPREAD_SYSTEM" in
+ debian-*|ubuntu-*)
+ apt-get remove --purge -y snapd
@sergiocazzolato

sergiocazzolato Aug 18, 2017

Contributor

asme about the pkgdb.sh

@chipaca chipaca added the Decaying label Aug 24, 2017

Right now this feels very hackish, and unlikely to improve the situation in any way if it's just a manual test sitting on the suite unattended. We won't run it, and we won't pay attention to its results.

We run hundreds of tests multiple times a day on multiple distributions. I cannot see why it would be challenging to have one of those tests being a realistic install.

Contributor

niemeyer commented Aug 30, 2017

@sergiocazzolato Can you take this over and see the best way to preserve the intent while integrating this in our usual suite?

I'm closing this meanwhile.

@niemeyer niemeyer closed this Aug 30, 2017

@zyga zyga deleted the zyga:feature/ootb-debian branch Aug 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment