Permalink
Browse files

My first attempt at following zyga's instructions.

  • Loading branch information...
1 parent 272c2d6 commit a091059324765cb48807f237a9acccb8ab23fa72 @elopio committed Nov 9, 2015
Showing with 16 additions and 82 deletions.
  1. +9 −82 integration-tests/units/examples.pxu
  2. +7 −0 integration-tests/units/testplans.pxu
@@ -1,90 +1,17 @@
-id: snapcraft/examples/downloader-with-wiki-parts
-plugin: shell
-command:
- 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/gopaste
-plugin: shell
+id: snapcraft/examples/template
@zyga

zyga Nov 9, 2015

Wait, this seems to clash with the same resource job below? Is that just github diff formatting?

+plugin: resource
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/py2-project
- 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/py3-project
- cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
- cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
- rm -rf ${PLAINBOX_SESSION_SHARE}/*
-
-id: snapcraft/examples/qmldemo
-plugin: shell
-command:
- set -e
- test ! "$(lsb_release -cs)" = "trusty" || exit 0
- example=${PLAINBOX_PROVIDER_DATA}/examples/qmldemo
- 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}/*
+ for example in $(ls ${PLAINBOX_PROVIDER_DATA}/examples); do
+ echo "name: $example\n\n"
-id: snapcraft/examples/webcam-webui
+id: snapcraft/examples/{name}
+unit: template
+template-unit: job
+template-resource: snapcraft/examples/template
@zyga

zyga Nov 9, 2015

template-resource: examples_resource
plugin: shell
command:
set -e
- example=${PLAINBOX_PROVIDER_DATA}/examples/webcam-webui
+ example=${PLAINBOX_PROVIDER_DATA}/examples/{name}
cp -rT ${example//:} ${PLAINBOX_SESSION_SHARE}
cd ${PLAINBOX_SESSION_SHARE} && ${SNAPCRAFT}
rm -rf ${PLAINBOX_SESSION_SHARE}/*
@@ -3,7 +3,14 @@ id: normal
_name: Tests for Snapcraft
include: snapcraft/normal/.*
+id: snapcraft/examples/template
@zyga

zyga Nov 9, 2015

I'd call it something that's not clashing with any examples and that is easier to reference from the template

id: examples_resource
+plugin: resource
+command:
+ for example in $(ls ${PLAINBOX_PROVIDER_DATA}/examples); do
+ echo "name: $example\n\n"
+
unit: test plan
id: examples
name: Test for building Snapcraft examples
include: snapcraft/examples/.*
@zyga

zyga Nov 9, 2015

Try this instead:

boostrap_include: examples_resource
include:
  examples_resource
  snapcraft/examples/.*
+bootstrap_jobs: snapcraft/examples/template

0 comments on commit a091059

Please sign in to comment.