Skip to content

Commit

Permalink
spread tests: unset SNAPCRAFT_BUILD_ENVIRONMENT=host for lxd tests
Browse files Browse the repository at this point in the history
New sanity checks detect the mismatch of --use-lxd and
SNAPCRAFT_BUILD_ENVIRONMENT=host set by the top tree.

The LXD tests which use `sudo` already lose the environment,
so we do not need to unset those.

Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
  • Loading branch information
Chris Patterson authored and sergiusens committed Nov 11, 2019
1 parent b1bee8d commit 9116c57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/spread/build-providers/lxd-basic/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ prepare: |
restore: |
cd "$SNAP_DIR"
# Unset SNAPCRAFT_BUILD_ENVIRONMENT=host.
unset SNAPCRAFT_BUILD_ENVIRONMENT
snapcraft clean --use-lxd
rm -f ./*.snap
Expand All @@ -20,6 +24,9 @@ restore: |
execute: |
cd "$SNAP_DIR"
# Unset SNAPCRAFT_BUILD_ENVIRONMENT=host.
unset SNAPCRAFT_BUILD_ENVIRONMENT
snapcraft --use-lxd
sudo snap install make-hello_*.snap --dangerous
[ "$(make-hello)" = "hello world" ]
6 changes: 6 additions & 0 deletions tests/spread/build-providers/lxd-type-base/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ environment:
restore: |
cd "$SNAP_DIR"
# Unset SNAPCRAFT_BUILD_ENVIRONMENT=host.
unset SNAPCRAFT_BUILD_ENVIRONMENT
snapcraft clean --use-lxd
rm -f ./*.snap
execute: |
cd "$SNAP_DIR"
# Unset SNAPCRAFT_BUILD_ENVIRONMENT=host.
unset SNAPCRAFT_BUILD_ENVIRONMENT
snapcraft pull --use-lxd
/snap/bin/lxc start snapcraft-core18
Expand Down

0 comments on commit 9116c57

Please sign in to comment.