Skip to content

Commit

Permalink
.travis.yml: remove travis matrix and do a single sequential run (sna…
Browse files Browse the repository at this point in the history
…pcore#3085)

With these changes each build will only require one travis slot. Also, if the static tests fail we won't allocate linode resources. The main goal is to only use one travis slot on each PR instead of 3 as we do now, this hopefully will reduce the initial wait time before the jobs start to execute.

During the discussion it was proposed a sequential execution so that we don't allocate linode resources if static or unit test fails, but this would impose an upfront delay in all the PR builds because of the unit test duration (currently about 6min, but this will increase over time). With the approach in this changeset we use a single travis slot and the unit tests are executed as a spread task in parallel with others.
  • Loading branch information
fgimenez authored and niemeyer committed Apr 4, 2017
1 parent 1eee2e7 commit 98d20e7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Expand Up @@ -9,14 +9,11 @@ env:
# SPREAD_LINODE_KEY
- secure: "bzALrfNSLwM0bjceal1PU5rFErvqVhi00Sygx8jruo6htpZay3hrC2sHCKCQKPn1kvCfHidrHX1vnomg5N+B9o25GZEYSjKSGxuvdNDfCZYqPNjMbz5y7xXYfKWgyo+xtrKRM85Nqy121SfRz3KLDvrOLwwreb+pZv8DG1WraFTd7D6rK7nLnnYNUyw665XBMFVnM8ue3Zu9496Ih/TfQXhnNpsZY8xFWte4+cH7JvVCVTs8snjoGVZi3972PzinNkfBgJa24cUzxFMfiN/AwSBXJQKdVv+FsbB4uRgXAqTNwuus7PptiPNxpWWojuhm1Qgbk0XhGIdJxyUYkmNA4UrZ3C29nIRWbuAiHJ6ZWd1ur3dqphqOcgFInltSHkpfEdlL3YK4dCa2SmJESzotUGnyowCUUCXkWdDaZmFTwyK0Y6He9oyXDK5f+/U7SFlPvok0caJCvB9HbTQR1kYdh048I/R+Ht5QrFOZPk21DYWDOYhn7SzthBDZLsaL6n5gX7Y547SsL4B35YVbpaeHzccG6Mox8rI4bqlGFvP1U5i8uXD4uQjJChlVxpmozUEMok9T5RVediJs540p5uc8DQl48Nke02tXzC/XpGAvpnXT7eiiRNW67zOj2QcIV+ni3lBj3HvZeB9cgjzLNrZSl/t9vseqnNwQWpl3V6nd/bU="

matrix:
- RUN=static
- RUN=unit
- RUN=spread

install:
- sudo apt-get update -qq
- sudo apt-get install -qq squashfs-tools xdelta3
- sudo apt-get install -qq gnupg1 || sudo apt-get install -qq gnupg

script: ./run-checks --$RUN
script:
- ./run-checks --static
- ./run-checks --spread
17 changes: 5 additions & 12 deletions spread.yaml
Expand Up @@ -299,25 +299,18 @@ suites:
$TESTSLIB/reset.sh
tests/unit/:
summary: Suite to run non-go unit tests and go unit tests for other runtimes
summary: Suite to run unit tests (non-go and different go runtimes)
systems: [-ubuntu-core-16-*]
prepare: |
. $TESTSLIB/prepare.sh
if [[ "$SPREAD_SYSTEM" == ubuntu-core-16-* ]]; then
prepare_all_snap
else
prepare_classic
fi
prepare_classic
prepare-each: |
$TESTSLIB/reset.sh --reuse-core
. $TESTSLIB/prepare.sh
if [[ "$SPREAD_SYSTEM" != ubuntu-core-16-* ]]; then
prepare_each_classic
fi
prepare_each_classic
restore: |
$TESTSLIB/reset.sh --store
if [[ "$SPREAD_SYSTEM" != ubuntu-core-16-* ]]; then
apt-get purge -y snapd snap-confine ubuntu-core-launcher
fi
apt-get purge -y snapd snap-confine ubuntu-core-launcher
tests/nightly/:
summary: Suite for nightly, expensive, tests
Expand Down
1 change: 0 additions & 1 deletion tests/unit/c-unit-tests/task.yaml
@@ -1,5 +1,4 @@
summary: Run the test suite for C code
systems: [-ubuntu-core-16-*]
environment:
EXTRA_PKGS: autoconf automake autotools-dev indent libapparmor-dev libglib2.0-dev libseccomp-dev libudev-dev pkg-config python3-docutils udev
prepare: |
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/gccgo/task.yaml
@@ -1,5 +1,5 @@
summary: Check that snapd builds with gccgo
systems: [-ubuntu-core-16-*, -ubuntu-14.04-64]
systems: [-ubuntu-14.04-64]
prepare: |
echo Installing gccgo-6 and pretending it is the default go
apt install -y gccgo-6
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/go/task.yaml
@@ -0,0 +1,12 @@
summary: Run project unit tests

systems: [ubuntu-16.04-64]

restore: |
rm -rf /tmp/unit-tests
execute: |
mkdir -p /tmp/unit-tests/src/github.com/snapcore
cp -ar $PROJECT_PATH /tmp/unit-tests/src/github.com/snapcore
chown -R test:12345 /tmp/unit-tests
su -l -c "cd /tmp/unit-tests/src/github.com/snapcore/snapd && GOPATH=/tmp/unit-tests ./run-checks --unit" test

0 comments on commit 98d20e7

Please sign in to comment.