Return-Path: X-Original-To: apmail-stratos-dev-archive@minotaur.apache.org Delivered-To: apmail-stratos-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A4531036A for ; Tue, 18 Aug 2015 16:04:58 +0000 (UTC) Received: (qmail 90708 invoked by uid 500); 18 Aug 2015 16:04:58 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 90660 invoked by uid 500); 18 Aug 2015 16:04:58 -0000 Mailing-List: contact dev-help@stratos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.apache.org Delivered-To: mailing list dev@stratos.apache.org Received: (qmail 90645 invoked by uid 99); 18 Aug 2015 16:04:58 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2015 16:04:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A79DBC1392 for ; Tue, 18 Aug 2015 16:04:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id BTfnwl0oCjyU for ; Tue, 18 Aug 2015 16:04:41 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id E8B5A20757 for ; Tue, 18 Aug 2015 16:04:40 +0000 (UTC) Received: by iodb91 with SMTP id b91so194072359iod.1 for ; Tue, 18 Aug 2015 09:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=XekgF84oaKn4lsOV0P0VbfqKfPrDDttuGpZdycQqW0w=; b=hf2spH0Lhbd5q2ziMv5IexlVwOWbpdtCZicKRICSAO+zQ2DfQhvxt4CaSFltUqY/xS wZoWpt0hgjqxbA+n9m4uOUFxz/FG+6HmDuqNF5ZyrfFZ8aS0zylsn0XvWw6Nx4GYxVrl 000hZTsezAqDRRWaMLIxU1vL1HV3uIJkxIEje3IYC7v/0M+89E03pYxHvk7ijNTBByPS u0ABNmWcWH0NJWEExR7bo8XjBFI7opKpcolPcAYashHJbPc/NdGED9wkfznNSmw2t1tw UQ2FCKkKYNCeKqzB1YiSU6aAtm/IHtVHJdKZT2HfODIdBgQGBBHy8sAFlmy9tlptdmQr BIBw== X-Received: by 10.107.154.67 with SMTP id c64mr9476823ioe.0.1439913880335; Tue, 18 Aug 2015 09:04:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.145.85 with HTTP; Tue, 18 Aug 2015 09:04:20 -0700 (PDT) In-Reply-To: References: From: Milindu Sanoj Kumarage Date: Tue, 18 Aug 2015 21:34:20 +0530 Message-ID: Subject: Re: [GSoC 2015] Python CLI for Stratos : Weekly Update To: Chamila De Alwis Cc: dev , Imesh Gunaratne Content-Type: multipart/alternative; boundary=001a1140fa08583d17051d98139a --001a1140fa08583d17051d98139a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, extremely sorry, the date is 19th, we are having the Hangout on Air for Stratos Python CLI on 19th Au from 9:30p.m IST onward. Is this time and date convenient? https://plus.google.com/u/0/events/c8d9682n9bris9at4ucppot9jbo On Tue, Aug 18, 2015 at 9:02 PM, Milindu Sanoj Kumarage < agentmilindu@gmail.com> wrote: > Hi, > > We are having a Hangout on Air for Stratos Python CLI on 9:30p.m. IST :) > > https://plus.google.com/u/0/events/c8d9682n9bris9at4ucppot9jbo > > > > > On Sun, Aug 16, 2015 at 4:14 PM, Milindu Sanoj Kumarage < > agentmilindu@gmail.com> wrote: > >> Hi, >> >> I have finished the documentation except for some few commands that I >> still have issues. >> >> >> https://docs.google.com/document/d/1GEdrOyIGF-zdwVry7t6-WYFMeEC0Y_Ki3Exy= ZFYCXdw/edit?usp=3Dsharing >> >> I did two small demonstration videos on how to use and how to config :) >> >> https://www.youtube.com/playlist?list=3DPL2zdjxqMDj71dlnYitq59PzEoOAG21U= hq >> >> >> I'm working on testings and those issues I mentioned earlier. >> >> >> On Wed, Aug 12, 2015 at 12:37 AM, Milindu Sanoj Kumarage < >> agentmilindu@gmail.com> wrote: >> >>> Hi, >>> >>> I want to know which commands should output that tree-like view of JSON >>> data. >>> >>> in list-deployment-policies what 'Accessibility' means? How i should >>> retrieve it from the JSON response? >>> >>> +---------------------+---------------+ >>> >>> | Id | Accessibility | >>> >>> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ >>> >>> | deployment-policy-2 | 1 | >>> >>> | deployment-policy-1 | 1 | >>> >>> +---------------------+---------------+ >>> >>> There are couple of commands that gives me errors when I send the >>> request, I have to check that too. >>> >>> I'd do the demo as soon as I finished the document, because I want to >>> know everything is working as expected :) Few more commands to go. >>> >>> Hi Milindu, >>> >>> Great work so far! Could you mention what commands and outputs are less >>> clear? >>> >>> >>> Regards, >>> Chamila de Alwis >>> Committer and PMC Member - Apache Stratos >>> Software Engineer | WSO2 | +94772207163 >>> Blog: code.chamiladealwis.com >>> >>> >>> >>> On Sun, Aug 9, 2015 at 1:59 PM, Milindu Sanoj Kumarage < >>> agentmilindu@gmail.com> wrote: >>> >>>> Hi, >>>> >>>> I have finished implementing all the CLI commands, except very few >>>> which I have some doubts ( like, how the output should be presented ) = :) >>>> >>>> I started writing a document explaining each and every command with >>>> their expected outputs ( when correct params are given, when no params= are >>>> given and when wrong params are given ) I will continue writing the te= st >>>> cases based on them. >>>> >>>> As discussed on Hangout, I will do a demo, record it and share soon := ) >>>> >>>> On Wed, Jul 29, 2015 at 10:34 AM, Milindu Sanoj Kumarage < >>>> agentmilindu@gmail.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> I could finish most of the listing command and now working with the >>>>> create and update commands. I'm running Java CLI to get an idea how t= he >>>>> output should be presented. Had to fix some issues related to that "-= " >>>>> issue also, regarding auto-completion. I started writing test cases f= or >>>>> utility methods, and will start writing test cases for Stratos specif= ic >>>>> ones this week. I'm using Tox to run my tests on different Python ver= sions, >>>>> 2.x ones and 3.z ones. >>>>> >>>>> On Thu, Jul 9, 2015 at 2:52 PM, Milindu Sanoj Kumarage < >>>>> agentmilindu@gmail.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I invested last 2 week on some research on Testing frameworks and >>>>>> Security Certificates. CA Bundles and Pem files were something I ha= d no >>>>>> experience, therefor I studied on that. Studied Java security API an= d >>>>>> Stratos's Java CLI's Certificate handling codes ( Keystores, etc ). >>>>>> >>>>>> *Testing frameworks* >>>>>> >>>>>> 1. Unittest ( docs.python.org/2/library/unittest.html ) [ PSF( >>>>>> GPL-compatible ) ] >>>>>> >>>>>> Python's unit testing module since 2.7. Very similar to JUnit for >>>>>> Java. Gives very descriptive outputs when found assertion errors. >>>>>> >>>>>> 2. Unittest2 ( pypi.python.org/pypi/unittest2 ) [ BSD ] >>>>>> >>>>>> unittest2 is a backport of the new features added to the unittest >>>>>> testing framework in Python 2.7 and onwards. Supports back to Python= 2.4+. >>>>>> >>>>>> 3. PyTest ( pytest.org/ ) [ MIT ] >>>>>> >>>>>> Very popular unit testing tool which is an alternative to Python=E2= =80=99s >>>>>> standard unittest module. Gives very descriptive outputs when found >>>>>> assertion errors. Integrates nicely with setup.py. Python 2 and 3 >>>>>> compatible. >>>>>> >>>>>> 4. Nose ( nose.readthedocs.org/en/latest ) [ LGPL ] >>>>>> >>>>>> Nose extends unittest to make testing easier. Same as PyTest. >>>>>> Python 2 and 3 compatible. >>>>>> >>>>>> 5. Tox ( tox.readthedocs.org/en/latest/ ) [ MIT ] >>>>>> >>>>>> Tox is a generic virtualenv management and test command line tool. W= e >>>>>> can setup several Python virtual environments and run our tests on t= hose >>>>>> environments. This is a very useful tool to ensure the compatibility= with >>>>>> Python 2 and Python 3 versions. PyTest, nose and unittest modules a= re >>>>>> compatible with tox. Able to easily integrate with continuous integr= ation >>>>>> servers like Jenkins. >>>>>> >>>>>> 6. Doctest ( docs.python.org/2/library/doctest.htmlt ) [ PSF( >>>>>> GPL-compatible ) ] >>>>>> >>>>>> Python module that checks for interactive Python sessions in >>>>>> docstrings, and then executes those sessions to verify that they wor= k >>>>>> exactly as shown. >>>>>> >>>>>> 7. Atheist ( arco.esi.uclm.es/~david.villa/atheist/html/ ) [ GFDL ] >>>>>> >>>>>> A great tool for command line testing, it issues the commands to the >>>>>> underlying shell and compares the output with the intended output. N= ow >>>>>> discontinued but bug-maintained. >>>>>> >>>>>> 8. Prego ( bitbucket.org/arco_group/prego ) [ GPLv3+ ] >>>>>> >>>>>> Successor of Atheist, which provides support to run shell commands o= n >>>>>> background, send signal to processes, set assertions on command stdo= ut or >>>>>> stderr, etc. Very suitable in CLI testing tasks. >>>>>> >>>>>> 9. ScriptTest ( pythonpaste.org/scripttest/ ) [ MIT-style >>>>>> permissive license ] >>>>>> >>>>>> Something like Prego, but seems less features. >>>>>> >>>>>> 10. Behave ( jenisys.github.io/behave.example/ ) [ BSD ] >>>>>> >>>>>> A BDD framework and a cucumber-clone for Python. Cucumber is a nice >>>>>> way for feature testing where we define the features in simple Engli= sh and >>>>>> that will become the tests. >>>>>> >>>>>> >>>>>> I definitely will be using Tox because it makes us test the Python >>>>>> CLI on different Python versions. But Tox alone can not test the CLI= . We >>>>>> have to us some other testing framework on Tox. I'm wondering what t= o use >>>>>> where. We can use PyTest for unit test Stratos.py which calls the St= ratos >>>>>> RESTAPI. But we have to test the CLI functionalities also, using som= e kind >>>>>> of CLI testing tool. I think I need some advice here :) >>>>>> >>>>>> Meanwhile, I continued implementing other "list" CMD actions in >>>>>> Python CLI. I see some repetition in error code handling stuffs, I'm >>>>>> thinking of a way to write a general method for error handling and e= rror >>>>>> reporting. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> > --001a1140fa08583d17051d98139a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=C2=A0Hi, extremely sorry, the date is 19th, we are having the=C2= =A0Hangout on Air for S= tratos Python CLI on 19th Au from 9:30p.m IST onward. Is this time and date= convenient?=C2=A0

https://plus.google.com/u/0/events/c8d9682n9bris9at4ucppot9jbo<= span style=3D"font-size:12.8000001907349px">

On Tue, Aug 18, 2015 at 9= :02 PM, Milindu Sanoj Kumarage <agentmilindu@gmail.com>= wrote:
Hi,=C2=A0
We are having a Hangout on Air for Stratos Python CLI on 9:30p= .m. IST :)=C2=A0





On Sun, Aug 16,= 2015 at 4:14 PM, Milindu Sanoj Kumarage <agentmilindu@gmail.com&= gt; wrote:
Hi,
I have finished the =C2=A0documentation except for some fe= w commands that I still have issues.=C2=A0


I did two small demonstration videos on how to= use and how to config :)


= I'm working on testings and those issues I mentioned earlier.=C2=A0


On Wed, Aug 12, 2015 at 12:37 AM, Milindu Sanoj Kumarage <a= gentmilindu@gmail.com> wrote:

Hi,=C2=A0

I want to know which commands should output that tree-like v= iew of JSON data.=C2=A0

in list-deployment-policies what &= #39;Accessibility' means? How i shoul= d retrieve it from the JSON response?

+---------------------+---------------+

| =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Id= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0| Accessibility |

+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+

| deployment-policy-2 | 1 =C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0|

| deployment-policy-1 | 1 =C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0|

+---------------------+---------------+

There are couple of commands that gives me errors when I sen= d the request, I have to check that too.

I'd do the demo as soon as I finished the document, beca= use I want to know everything is working as expected :) Few more commands t= o go.

Hi Milindu,

Great work so far! Could = you mention what commands and outputs are less clear?=C2=A0


Regards,
Chamila de A= lwis
Committer and PMC Mem= ber - Apache Stratos
Software Engineer | WSO2 | +94772207163
Blog: code.chamiladealwis.com
=


On Sun, Aug 9, 2015 at 1:59 PM, Milindu Sano= j Kumarage <agentmilindu@gmail.com> wrote:
Hi,=C2=A0

I have = finished implementing all the CLI commands, except very few which I have so= me doubts ( like, how the output should be presented ) :)

=C2=A0I started writing a document explaining each and every comman= d with their expected outputs ( when correct params are given, when no para= ms are given and when wrong params are given ) I will continue writing the = test cases based on them.=C2=A0

As discussed on Ha= ngout, I will do a demo, =C2=A0record it and share soon :)=C2=A0

On Wed= , Jul 29, 2015 at 10:34 AM, Milindu Sanoj Kumarage <agentmilindu@gmai= l.com> wrote:
Hi,=C2=A0

I could finish most of the listing command= and now working with the create and update commands. I'm running Java = CLI to get an idea how the output should be presented. Had to fix some issu= es related to that "-" issue also, regarding auto-completion. I s= tarted writing test cases for utility methods, and will start writing test = cases for Stratos specific ones this week. I'm using Tox to run my test= s on different Python versions, 2.x ones and 3.z ones.

On Thu, Jul 9, 2= 015 at 2:52 PM, Milindu Sanoj Kumarage <agentmilindu@gmail.com>= ; wrote:
Hi,= =C2=A0

I invested last 2 week on some research on = Testing frameworks and Security Certificates. CA Bundles and =C2=A0Pem file= s were something I had no experience, therefor I studied on that. Studied J= ava security API and Stratos's Java CLI's Certificate handling code= s ( Keystores, etc ). =C2=A0

Testing frameworks<= div>
1. Unittest ( docs.python.org/2/library/unitte= st.html ) [ PSF( GPL-compatible ) ]

Python's= unit testing module since 2.7. Very similar to JUnit for Java.=C2=A0Gives = very descriptive outputs when found assertion errors.=C2=A0

<= /div>
2. Unittest2 (=C2=A0pypi.python.org/pypi/unittest2=C2=A0) [ BSD ]

unittest2 is a backport of the new features added t= o the unittest testing framework in Python 2.7 and onwards. Supports back t= o Python 2.4+.

3. PyTest ( pytest.org/ ) [ MIT ]

Very popular unit testing tool which is an alternative to Python=E2=80=99= s standard unittest module. Gives very descriptive outputs when found asser= tion errors. Integrates nicely with setup.py. Python 2 and 3 compatible.=C2= =A0

4. Nose ( nose.readthedocs.org/en/latest ) [ LGP= L ]

Nose extends unittest to make testing easier. = Same as PyTest.=C2=A0
Python 2 and 3 compatible.

=
Tox is a generic virtualenv management and test command line= tool. We can setup several Python virtual environments and run our tests o= n those environments. This is a very useful tool to ensure the compatibilit= y with Python 2 and Python 3 versions. PyTest, =C2=A0nose and unittest modu= les are compatible with tox. Able to easily=C2=A0integrate with continuous = integration servers like Jenkins.=C2=A0

6. Doc= test ( docs.python.org/2/library/doctest.htmlt ) [=C2=A0PSF( GPL-c= ompatible )=C2=A0]=C2=A0

=C2=A0Python module= that checks for interactive Python sessions in docstrings, and then execut= es those sessions to verify that they work exactly as shown.=C2=A0

7.=C2=A0Atheist ( arco.esi.uclm.es/~david.villa/= atheist/html/ =C2=A0) [ GFDL ]

A great tool fo= r command line testing, it issues the commands to the underlying shell and = compares the output with the intended output. Now discontinued but bug-main= tained.=C2=A0



9. ScriptTest ( pythonpaste.o= rg/scripttest/ ) [ =C2=A0MIT-style permissive license ]

<= /div>
Something like Prego, but seems less features.=C2=A0
10. Behave (=C2=A0jenisys.github.io/behave.example/=C2=A0= ) [ BSD ]

=C2=A0A BDD framework and a cucumber-clo= ne for Python. Cucumber is a nice way for feature testing where we define t= he features in simple English and that will become the tests.=C2=A0


I definitely will be using Tox becau= se it makes us test the Python CLI on different Python versions. But Tox al= one can not test the CLI. We have to us some other testing framework on Tox= . I'm wondering what to use where. We can use PyTest for unit test Stra= tos.py which calls the Stratos RESTAPI. But we have to test the CLI functio= nalities also, using some kind of CLI testing tool. I think I need some adv= ice here :)

Meanwhile, I continued implementing ot= her "list" CMD actions in Python CLI. I see some repetition in er= ror code handling stuffs, I'm thinking of a way to write a general meth= od for error handling and error reporting. =C2=A0

=








--001a1140fa08583d17051d98139a--