tests: enable main suite on fedora #3505

Merged
merged 24 commits into from Jul 24, 2017

Conversation

Projects
None yet
6 participants
Contributor

morphis commented Jun 21, 2017

No description provided.

@sergiocazzolato sergiocazzolato changed the title from PLEASE IGNORE: Enable more tests for suse and fedora to PLEASE IGNORE: Enabling main test suite for fedora Jul 10, 2017

Contributor

niemeyer commented Jul 11, 2017

@morphis @sergiocazzolato I'm taking this one down as it sounds like there's work to do before it can be integrated. Please feel free to reopen or create a new PR once ready.

@niemeyer niemeyer closed this Jul 11, 2017

Contributor

sergiocazzolato commented Jul 11, 2017

@niemeyer I am using this one to add the fixes needed to make all the main test suite work for fedora. It should be integrated after this one #3577 is integrated.
Is there any way to leave this PR alive but tag it to indicate this should not be integrated?

Contributor

sergiocazzolato commented Jul 11, 2017

@niemeyer I'll pushed a change to fix all the fedora tests.

codecov-io commented Jul 11, 2017

Codecov Report

Merging #3505 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3505      +/-   ##
==========================================
- Coverage   74.98%   74.97%   -0.01%     
==========================================
  Files         382      382              
  Lines       33116    33116              
==========================================
- Hits        24831    24830       -1     
- Misses       6485     6486       +1     
  Partials     1800     1800
Impacted Files Coverage Δ
snap/snapenv/snapenv.go 96.87% <100%> (ø) ⬆️
cmd/snap/cmd_aliases.go 93.33% <0%> (-1.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65be1ba...f0f6561. Read the comment docs.

@sergiocazzolato sergiocazzolato changed the title from PLEASE IGNORE: Enabling main test suite for fedora to Enabling main test suite for fedora Jul 12, 2017

spread.yaml
@@ -61,7 +61,7 @@ backends:
kernel: GRUB 2
workers: 4
- fedora-25-64:
- workers: 1
+ workers: 2
@morphis

morphis Jul 13, 2017

Contributor

Please limit this to 1 again. @niemeyer asked me to use just a single machine for both Fedora and openSUSE.

@niemeyer

niemeyer Jul 14, 2017

Contributor

Yes, let's please keep it down to 1 while we have so many disabled tests. We should only increase it further once this becomes the bottleneck (IOW, it finishes last).

@sergiocazzolato

sergiocazzolato Jul 17, 2017

Contributor

It is running 130 tasks, just 1 worker will delay the whole execution, see the log: https://paste.ubuntu.com/25113080/

@niemeyer niemeyer changed the title from Enabling main test suite for fedora to tests: enable main suite on fedora Jul 14, 2017

Some comments, but LGTM assuming you address them.

spread.yaml
@@ -61,7 +61,7 @@ backends:
kernel: GRUB 2
workers: 4
- fedora-25-64:
- workers: 1
+ workers: 2
@morphis

morphis Jul 13, 2017

Contributor

Please limit this to 1 again. @niemeyer asked me to use just a single machine for both Fedora and openSUSE.

@niemeyer

niemeyer Jul 14, 2017

Contributor

Yes, let's please keep it down to 1 while we have so many disabled tests. We should only increase it further once this becomes the bottleneck (IOW, it finishes last).

@sergiocazzolato

sergiocazzolato Jul 17, 2017

Contributor

It is running 130 tasks, just 1 worker will delay the whole execution, see the log: https://paste.ubuntu.com/25113080/

tests/lib/files.sh
+#!/bin/bash
+
+wait_for_file() {
+ the_file="$1"
@niemeyer

niemeyer Jul 14, 2017

Contributor

Across all shell files and all yaml files in this PR, let's please use 4 spaces of indentation consistently.

This one file has three different indentations in 15 lines, for example.

tests/main/postrm-purge/task.yaml
@@ -4,19 +4,28 @@ systems: [-ubuntu-core-16-*]
execute: |
echo "When some snaps are installed"
- . $TESTSLIB/snaps.sh
+ . "$TESTSLIB/snaps.sh"
@niemeyer

niemeyer Jul 14, 2017

Contributor

No need for that I think. It's a good practice in general, but this is our own garden. We'll never have spaces in $TESTSLIB.

@chipaca

chipaca Jul 24, 2017

Member

right, but as you say it's good practice, and shellcheck will complain about these, so why not do it?

@niemeyer

niemeyer Jul 24, 2017

Contributor

Mainly because it's more noise, increasing both the cost of reading and the cost of reviewing as we have dozens of lines in this PR which don't really change any logic.

tests/main/postrm-purge/task.yaml
- . $TESTSLIB/dirs.sh
+ # For now we use the Fedora specific snap-mgmt script but as soon
+ # as we have a generic one we can use cross-distro we need to
+ # change this.
@niemeyer

niemeyer Jul 14, 2017

Contributor

👍

tests/main/postrm-purge/task.yaml
+ --snap-mount-dir=$SNAPMOUNTDIR \
+ --purge
+ else
+ echo "And snapd is purged"
@niemeyer

niemeyer Jul 14, 2017

Contributor

The comment should go outside the if branch.

tests/main/refresh-all-undo/task.yaml
@@ -29,7 +29,7 @@ restore: |
exit
fi
- . $TESTSLIB/store.sh
+ . "$TESTSLIB/store.sh"
@niemeyer

niemeyer Jul 14, 2017

Contributor

Again, no need for those replacements. This increases the size of the overall diff to be reviewed and touches the git history without adding any value into the actual logic.

tests/main/refresh-all/task.yaml
+ . "$TESTSLIB/files.sh"
+ . "$TESTSLIB/store.sh"
+ init_fake_refreshes test-snapd-tools "$BLOB_DIR"
+ wait_for_file "$BLOB_DIR"/test-snapd-tools*fake1*.snap 4 .5
@niemeyer

niemeyer Jul 14, 2017

Contributor

Similarly, there's no need to quote every single instance of our own variables.

+ mkdir -p "$SNAP_INSTALL_DIR"
+ cp -ra "$TESTSLIB"/snaps/test-snapd-tools/* "$SNAP_INSTALL_DIR"
+ sed -i 's/test-snapd-tools/not-test-snapd-tools/g' "$SNAP_INSTALL_DIR/meta/snap.yaml"
+ snapbuild "$SNAP_INSTALL_DIR" .
@niemeyer

niemeyer Jul 14, 2017

Contributor

Same! Sorry for bothering, but this is a pretty large diff, and those quotings are a significant part of it, without any real advantages for us.

echo "When a temporary file is created by one snap"
- expect -d -f tmp-create.exp
+ expect -d -f tmp-create.exp "$SNAPMOUNTDIR"
@niemeyer

niemeyer Jul 14, 2017

Contributor

Why $SNAPMOUNTDIR but $SNAP_INSTALL_DIR?

@sergiocazzolato

sergiocazzolato Jul 17, 2017

Contributor

The snap is leaving in $SNAPMOUNTDIR the .sh, and in $SNAP_INSTALL_DIR the commands.

@sergiocazzolato

sergiocazzolato Jul 24, 2017

Contributor

As we discussed in irc, i'll work after this branch to unify the "_" convention for variables

- /snap/bin/snapctl-from-snap.snapctl-set foo=123
- /snap/bin/snapctl-from-snap.snapctl-get foo | MATCH 123
+ $SNAPMOUNTDIR/bin/snapctl-from-snap.snapctl-set foo=123
+ $SNAPMOUNTDIR/bin/snapctl-from-snap.snapctl-get foo | MATCH 123
@niemeyer

niemeyer Jul 14, 2017

Contributor

... and no quotings here, which is fine. Just raising here to say that a lot of our content isn't quoted, and this isn't a real problem we have today.

Simon Fels and others added some commits Jun 8, 2017

sergiocazzolato added some commits Jul 19, 2017

LGTM

sergiocazzolato added some commits Jul 24, 2017

@niemeyer niemeyer merged commit 4ee0003 into snapcore:master Jul 24, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment