Is there any way to get testResult of the test at the end of test script itself.
We are writing our test using SST and I want to get the result of the test at the end of test script to report it to external test mgmt system. I want to call this external API to record this result by passing test result as an argument to it. I know that we can do this in unittest like this"
Example:
suite = unittest.
suite.addTest(
testResult = unittest.
Is there any way of this in SST?
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- 2012-08-24
- Last reply:
- 2012-08-29
Corey Goldberg (coreygoldberg) said : | #1 |
hi.
have you looked at using xml output reports (-r option)?
you can call sst-run with the -r option to change report output from console to xml or html.
example:
$./sst-run -r xml mytests
this will create `results/
as to how SST calls unittest internally, look at the logic inside `src/sst/
In console mode, it does:
runner = TextTestRunner(
runner.
we could change `runtests` function to return test_result like in your example. would that be helpful?
hth,
-Corey
nirmesh patel (nirmeshptl) said : | #2 |
I am trying to get this test result and send it to SpiraTest by calling spiratest web service to update the test case result in spiratest.
>>we could change `runtests` function to return test_result like in your example. would that be
Yes above solution should work for me if this return value is accessible within test script.
Corey Goldberg (coreygoldberg) said : | #3 |
> Yes above solution should work for me if this return value is accessible within test script.
ah.. I was thinking at the test runner level, not within your scripts.
you might be able to use the existing run_test() function in the actions API:
http://
consider this example...
I have a script named `mytest.py` containing an SST test case:
----------------
from sst.actions import *
# do some test stuff
RESULT = 'hello'
----------------
then I have a script named named `calltests.py` that runs the [sub]test:
----------------
from sst.actions import *
result = run_test('mytest') # this will the be the string "hello"
foo = do_something_
send_to_
----------------
you can then invoke `sst-run calltests` from the command line, which would run `mytest.py` and do something with RESULT.
hth,
-Corey
Can you help with this problem?
Provide an answer of your own, or ask nirmesh patel for more information if necessary.