You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Alan Conway (JIRA)" <ji...@apache.org> on 2013/11/08 16:33:17 UTC

[jira] [Comment Edited] (QPID-5307) Change test scripts to cross-platform language

    [ https://issues.apache.org/jira/browse/QPID-5307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13817347#comment-13817347 ] 

Alan Conway edited comment on QPID-5307 at 11/8/13 3:31 PM:
------------------------------------------------------------

I think there are two overall options for structuring the tests in python:
1) Write python scripts that closely mimic the shell scripts in terms of starting processes etc.
2) Use the python unit-test suite and qpid's brokertest.py to structure the tests in a more pythonesque way.

1. may be easier (initially) as it is more or less just transcribing shell into python
2. may be more work initially but offers some advantages:
  - a more "normal" python test suite that can be handled by various python test runners - e.g. qpid-python-test allows you to specify tests to include/exclude by regexp etc.
  - somewhat more structured, can group tests into sensible suites.
 - brokertest.Popen and brokertest.Broker takes care of some stuff in a central way:
   -- safe broker port allocation.
   -- verify expected exit status of brokers and clients.
   -- create separate directory for each test, at end of test it has:
     --- broker logs
     --- stdout, stderr of clients
     --- core files
 - Simple functions to verify queue contents by browsing, VERY useful
 - assorted other stuff...

To see how all this works check out cpp/src/tests/
- brokertest.py: The framework
- ha_test.py: extended framework for HA cluster tests
- ha_tests.py: The HA test suite.

There are currently a few conveniences in ha_test.py that aren't really ha-only, I can move them into brokertest.py and will be happy to help with any new features that might be needed.

So obviously I'm a fan of 2) as without it my head would have long ago exploded doing the cluster & ha work. I think 1) may look easier in the short term but 2)  may be a better move in the long term.


was (Author: aconway):
I think there are two overall options for structuring the tests in python:
1) Write python scripts that closely mimic the shell scripts in terms of starting processes etc.
2) Use the python unit-test suite and qpid's brokertest.py to structure the tests in a more pythonesque way.

1. may be easier (initially) as it is more or less just transcribing shell into python
2. may be more work initially but offers some advantages:
  - a more "normal" python test suite that can be handled by various python test runners - e.g. qpid-python-test allows you to specify tests to include/exclude by regexp etc.
  - somewhat more structured, can group tests into sensible suites.
 - brokertest.Popen and brokertest.Broker takes care of some stuff in a central way:
   - safe broker port allocation.
   - verify expected exit status of brokers and clients.
   - create separate directory for each test, at end of test it has:
     - broker logs
     - stdout, stderr of clients
     - core files
 - Simple functions to verify queue contents by browsing, VERY useful
 - assorted other stuff...

To see how all this works check out cpp/src/tests/
- brokertest.py: The framework
- ha_test.py: extended framework for HA cluster tests
- ha_tests.py: The HA test suite.

There are currently a few conveniences in ha_test.py that aren't really ha-only, I can move them into brokertest.py and will be happy to help with any new features that might be needed.

So obviously I'm a fan of 2) as without it my head would have long ago exploded doing the cluster & ha work. I think 1) may look easier in the short term but 2)  may be a better move in the long term.

> Change test scripts to cross-platform language
> ----------------------------------------------
>
>                 Key: QPID-5307
>                 URL: https://issues.apache.org/jira/browse/QPID-5307
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client, C++ Clustering
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>              Labels: test
>             Fix For: Future
>
>
> The C++ tree's test suite drivers are primarily shell scripts. Many were duplicated as Windows PowerShell scripts along the way. However, not all scripts were PowerShell-ized, and the dual set of test scripts is not maintained in sync. Someone (Cliff?) suggested a while back that the test driver scripts be written in a common language across Linux and Windows, and for other platforms as well.
> Python, Perl, Ruby are all possible choices - python and ruby need to be on build systems anyway for code generation. What do people think about a) this idea in general, b) language to use?



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org