This sounds great, Stefan,
questions:
1. what about automate this as a commit-triggered CI build on AeroGear
CloudBees jenkins?
2. are we able to automate more platforms such as iOS?
It would be huge time-saver if this build could actually test that UPS
pushes successfully to Android (and potentially iOS) and report that as a
comment to each Pull Request. No matter how long it would take, half an
hour is my ideal here considering the use case ;-)
~ Lukas
st 25. 3. 2015 v 16:37 odesílatel Stefan Miklosovic <smikloso(a)redhat.com>
napsal:
Hi,
I think few days ago there was some information from Karel Piwko that we
developed fully automatic functional tests when it comes to Cordova
quickstarts (1) (hello world and shoot and share)
We think that it could be useful for developers as well. This tests the
whole life cycle of the push from creation of UPS cartridge through
building of the example to the functional test in a fully automatic manner
from zero setup to push notification receive at mobile device you have
connected to your notebook and it could be useful for developers in order
to not execute it manually every time and set it up all over again.
By what I mean "fully automatic" is the following scenario:
1) Automatic creation of UPS cartridge on OpenShift right from our test,
patched with this extension * (2), (3)
2) Because of the deployed extension to UPS in 1), we can login via REST
and we do not need to change passwords so we can create application with
some variant directly from our test script (4)
3) After this is done, quickstart example is downloaded from GH, Android
SDK is installed locally at your PC, quickstart is filled with application
and google credentials automatically and after that it is built
4) APK built in 3) is then used in functional test by Arquillian Droidium
(5) which deploys that APK to physical device and in that test, we send
push notification request to UPS
5) Once push notification comes to UPS, it sends it to GCM which in turn
sends it to physical device and Droidium test asserts that the message
really came and appeared on the mobile device.
It takes about 10 minutes, you have to have Android device attached to
your PC since test will communicate with it. Time could be massively
decreased when you do not expect new OS UPS instance to be created every
time.
You execute it like this in
https://github.com/aerogear/aerogear-unifiedpush-server-integration-tests
repository
./gradlew test -Pprofile=helloWorldCordovaQuickstart \
-PgoogleProjectNumber=<your project number> \
-PgoogleKey=<your google key> \
-PopenShiftUsername=<email of your openshift account>
-PopenShiftPassword=<password for your openshift account> \
-PopenShiftCartridge=
https://cartreflect-claytondev.rhcloud.com/reflect?github=aerogear/opensh...
\
-PopenShiftAppDirectory=aerogear-push
Similar process is executed with Shoot & Share demo where we send image to
Facebook. All triggered by one shell command from integration tests and
after that the above magic happens.
I case you want to use it and you struggle with it, feel free to ask me
for guidance.
* unified-test-extension adds custom functionality to UPS cartridge, it
adds fancy performance test endpoints where you can feed UPS instance with
custom number of generated installations / categories / variants and so on.
More to it, it can put proxy behind sender API so push notifications goes
nowhere in the end but it seems like they were indeed sent from UPS point
of view. This is particularly handy in test environment where you really do
not want to send anything to APNS or GCM.
(1)
https://github.com/jboss-mobile/unified-push-helloworld
(2)
https://github.com/aerogear/aerogear-testing-tools/tree/master/unifiedpus...
(3)
https://github.com/aerogear/aerogear-unifiedpush-server-integration-tests...
(4)
https://github.com/aerogear/aerogear-unifiedpush-server-integration-tests...
(5)
https://github.com/aerogear/aerogear-unifiedpush-server-integration-tests...
--
Stefan Miklosovic
Red Hat Brno - JBoss Mobile Platform
e-mail: smikloso(a)redhat.com
irc: smikloso
_______________________________________________
aerogear-dev mailing list
aerogear-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev