Skip to content

Commit

Permalink
Update to master and switch to using the schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-gould committed Nov 6, 2015
2 parents 48cf9ff + 95e4d65 commit 341e395
Show file tree
Hide file tree
Showing 40 changed files with 647 additions and 283 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ install:
# PPA for snappy.
- sudo apt-add-repository -y ppa:snappy-dev/tools-proposed
- sudo apt-get update -qq
- sudo apt-get install -qq build-essential dpkg-dev plainbox pyflakes python3-apt python3-coverage python3-fixtures python3-jsonschema python3-mccabe python3-pep8 python3-requests python3-testscenarios python3-yaml ubuntu-snappy-cli
- sudo apt-get install -qq build-essential dpkg-dev plainbox pyflakes python3-apt python3-coverage python3-fixtures python3-jsonschema python3-mccabe python3-pep8 python3-requests python3-testscenarios python3-yaml ubuntu-snappy-cli python3-lxml
script:
- ./runtests.sh $TEST_SUITE
after_success:
Expand Down
4 changes: 2 additions & 2 deletions bin/snapcraft
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import os
import sys

# make running from bzr snapshot easy
topdir = os.path.abspath(os.path.join(__file__, "..", ".."))
topdir = os.path.abspath(os.path.join(__file__, '..', '..'))
if os.path.exists(os.path.join(topdir, 'setup.py')):
sys.path = [topdir] + sys.path

Expand All @@ -28,6 +28,6 @@ import snapcraft.main
import snapcraft.dirs


if __name__ == "__main__":
if __name__ == '__main__':
snapcraft.dirs.setup_dirs()
snapcraft.main.main()
4 changes: 2 additions & 2 deletions bin/snapcraft-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import sys
import coverage

# make running from bzr snapshot easy
topdir = os.path.abspath(os.path.join(__file__, "..", ".."))
topdir = os.path.abspath(os.path.join(__file__, '..', '..'))
if os.path.exists(os.path.join(topdir, 'setup.py')):
sys.path = [topdir] + sys.path

Expand All @@ -30,7 +30,7 @@ import snapcraft.main
import snapcraft.dirs


if __name__ == "__main__":
if __name__ == '__main__':
cov = coverage.coverage(
data_file=os.path.join(topdir, '.coverage'), data_suffix=True,
branch=True, source=['snapcraft'])
Expand Down
4 changes: 2 additions & 2 deletions examples/py2-project/sha3sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import spongeshaker.sha3


if __name__ == "__main__":
if __name__ == '__main__':
# 224 is the default from sha3sum
h = spongeshaker.sha3.sha3_224()
with open(sys.argv[1], "rb") as fp:
with open(sys.argv[1], 'rb') as fp:
data = fp.read()
h.update(data)
print(h.hexdigest())
4 changes: 2 additions & 2 deletions examples/py3-project/sha3sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import spongeshaker.sha3


if __name__ == "__main__":
if __name__ == '__main__':
# 224 is the default from sha3sum
h = spongeshaker.sha3.sha3_224()
with open(sys.argv[1], "rb") as fp:
with open(sys.argv[1], 'rb') as fp:
data = fp.read()
h.update(data)
print(h.hexdigest())
1 change: 1 addition & 0 deletions integration-tests/data/simple-circle/circle/icon.svg
56 changes: 56 additions & 0 deletions integration-tests/data/simple-circle/circle/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: real-circle
summary: A big bad circle
description: |
A snapcraft.yaml that lists a set of parts that are
in a circular dependency chain. Snapcraft should NOT
accept this snapcraft.yaml.
version: 1.0
vendor: round@circle.square.com
icon: icon.svg

parts:
a:
plugin: copy
files:
icon.svg: icon.svg
after: [last]
b:
plugin: copy
files:
icon.svg: icon.svg
after: [a]
c:
plugin: copy
files:
icon.svg: icon.svg
after: [b]
d:
plugin: copy
files:
icon.svg: icon.svg
after: [c]
e:
plugin: copy
files:
icon.svg: icon.svg
after: [d]
f:
plugin: copy
files:
icon.svg: icon.svg
after: [e]
g:
plugin: copy
files:
icon.svg: icon.svg
after: [f]
h:
plugin: copy
files:
icon.svg: icon.svg
after: [g]
last:
plugin: copy
files:
icon.svg: icon.svg
after: [h]
1 change: 1 addition & 0 deletions integration-tests/data/simple-circle/icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions integration-tests/data/simple-circle/tree/icon.svg
95 changes: 95 additions & 0 deletions integration-tests/data/simple-circle/tree/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: dep-tree
summary: A tree of things to make sure work
description: |
A snapcraft.yaml that has a relatively complex tree of
dependencies that can stress test the depedency resolution
code in Snapcraft.
version: 1.0
vendor: deps@tree.com
icon: icon.svg

parts:
root:
plugin: copy
files:
icon.svg: icon.svg
a:
plugin: copy
files:
icon.svg: icon.svg
after: [root]
b:
plugin: copy
files:
icon.svg: icon.svg
after: [root]
c:
plugin: copy
files:
icon.svg: icon.svg
after: [root]
aa:
plugin: copy
files:
icon.svg: icon.svg
after: [a]
ab:
plugin: copy
files:
icon.svg: icon.svg
after: [a]
ac:
plugin: copy
files:
icon.svg: icon.svg
after: [a]
ba:
plugin: copy
files:
icon.svg: icon.svg
after: [b]
bb:
plugin: copy
files:
icon.svg: icon.svg
after: [b]
bc:
plugin: copy
files:
icon.svg: icon.svg
after: [b]
ca:
plugin: copy
files:
icon.svg: icon.svg
after: [c]
cb:
plugin: copy
files:
icon.svg: icon.svg
after: [c]
cc:
plugin: copy
files:
icon.svg: icon.svg
after: [c]
x:
plugin: copy
files:
icon.svg: icon.svg
after: [aa, ba, ca]
y:
plugin: copy
files:
icon.svg: icon.svg
after: [ab, bb, cb]
z:
plugin: copy
files:
icon.svg: icon.svg
after: [ac, bc, cc]
last:
plugin: copy
files:
icon.svg: icon.svg
after: [x, y, z]
4 changes: 2 additions & 2 deletions integration-tests/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

setup(
name='2015.com.canonical.snapcraft:tests',
version="1.0",
description=N_("Plainbox test provider for Snapcraft")
version='1.0',
description=N_('Plainbox test provider for Snapcraft')
)
95 changes: 87 additions & 8 deletions integration-tests/units/examples.pxu
Original file line number Diff line number Diff line change
@@ -1,10 +1,89 @@
id: snapcraft/examples/build
id: snapcraft/examples/downloader-with-wiki-parts
plugin: shell
command:
set -e
for example in ${PLAINBOX_PROVIDER_DATA}/examples/*
do
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*
done
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/downloader-with-wiki-parts
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/godd
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/godd
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/gopaste
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/gopaste
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/java-hello-world
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/java-hello-world
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/libpipeline
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/libpipeline
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/py2project
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/py2project
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/py3project
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/py3project
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/ros
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/ros
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/tomcat-maven-webapp
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/tomcat-maven-webapp
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*

id: snapcraft/examples/webcam-webui
plugin: shell
command:
set -e
example=${PLAINBOX_PROVIDER_DATA}/examples/webcam-webui
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*
19 changes: 16 additions & 3 deletions integration-tests/units/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ command:
set -ex
cp -rT $PLAINBOX_PROVIDER_DATA/local-source .
${SNAPCRAFT} build
test -e stamp-all
test "$(readlink parts/make-project/build)" = "$(pwd)"
test -e parts/make-project/build/stamp-all
${SNAPCRAFT} stage
test -e stamp-install
test -e parts/make-project/build/stamp-install
flags: simple has-leftovers

id: snapcraft/normal/local-plugin
Expand Down Expand Up @@ -401,3 +400,17 @@ command:
${SNAPCRAFT} shell xml2-config --cflags | grep -q `pwd`
${SNAPCRAFT} shell xslt-config --cflags | grep -q `pwd`
flags: simple has-leftovers

id: snapcraft/circle/tree-dependencies
command:
set -ex
cp -rTL $PLAINBOX_PROVIDER_DATA/simple-circle/tree .
${SNAPCRAFT} pull
flags: simple has-leftovers

id: snapcraft/circle/circle-dependencies
command:
set -ex
cp -rTL $PLAINBOX_PROVIDER_DATA/simple-circle/circle .
! ${SNAPCRAFT} pull
flags: simple has-leftovers

0 comments on commit 341e395

Please sign in to comment.