svanoort / pyresttest

Python Rest Testing
Apache License 2.0
1.15k stars 326 forks source link

Refactor: move execution logic out of resttest.py to allow for xUnit Output Callbacks #170

Open svanoort opened 8 years ago

svanoort commented 8 years ago

Per https://github.com/svanoort/pyresttest/issues/163 this is in support of the xUnit changes

We are moving the test/benchmark execution logic into the macros themself:

Macro Execution Signature:

execute_macro(self, context=None, test_config=None, cmdline_args=None, callbacks=DefaultLogging, *args, *kwargs)

Lets you later first look for variables in self, then testConfig, then cmdlineArgs (which are a dictionary).

svanoort commented 8 years ago

@spradeepv - this is the precursor to #43 (xUnit output), which you were eagerly anticipating I believe. It's in scope for the next release assuming I can arrive at a reasonable implementation without completely hacking up the core code (and perhaps get some volunteers to play with it).

Once it's complete, generating the xUnit output should be fairly straightforward (fingers crossed). We just register a separate set of optional callbacks and use them instead (or in addition to) the normal logging. It also lays the groundwork for parallel test/testset execution, hopefully.

CC @jeanCarloMachado and @nirsegev and @parametrization and @nitrocode - I know you all are waiting for this too and might be interested in playing with alpha versions of JUnit output once available.

Worth mentioning that this represents a huge under-the-hood change to the core logic in PyRestTest (outwardly it will look similar, inwardly it will be much more straightforward and easy to add custom handling).