Bug 8479 - Single Test case can be self-executed without test runner
Summary: Single Test case can be self-executed without test runner
Status: VERIFIED OBSOLETE
Alias: None
Product: Runtime Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 2.1
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 2.1 M2
Assignee: Cathy Shen
QA Contact: Bogdan Alexandru Voiculescu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-10-11 13:35 UTC by Cathy Shen
Modified: 2016-02-19 09:04 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cathy Shen 2015-10-11 13:35:20 UTC
When we try to run a single case, we'd like to execute it easily without test runner. This is very useful for developer to analyze and debug a fail case. It's not user friendly to create the manifest file for one case and trigger the test with runner.
Comment 1 Costin 2015-10-12 13:05:45 UTC
Hy Cathy,

I'm not sure if something created to inherit oeRuntimeTest class functionality can be completely extracted and behave as a stand alone thing. 
However, for consistency, i think a good approach is to make runexported.py consider one test only like e.g: ./runexported.py --run_test mytest.test_something

I think this is the best and safest approach and also dev. friendly.

Please share your thoughts on  this

Thank you,

Costin
Comment 2 Cathy Shen 2015-10-13 05:33:23 UTC
Hi Costin,
For python test cases, we'd like to run like this: 
$python ./mytest.test_something.py

That means runner and controller are separated, single python test case can run directly by above command, of course, controller should be invoked by test cases.
Comment 3 Lucian Musat 2015-11-10 11:59:50 UTC
Hi Cathy,

There might be a way to do this. I am thinking of gathering the reusable code from the test runner into a class, and adding a __main__ part into the test suites' code, so it will become runnable by itself, that will call the class from the runner when executed directly. Of course all the data that is available for bitbake should be available for the tests so we'll still need the testdata.json to be exported and present in the runtime folder. 
I have made a proof of concept with one of our suites and it works fine without having to modify the existing tests, just append some lines at the beginning.

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=lucian/selfexecution&id=7028e451e92a5ddd8f45178d4736548a20ab88ff
Comment 4 Alexandru Georgescu 2016-01-15 09:01:58 UTC
(In reply to comment #3)
> Hi Cathy,
> 
> There might be a way to do this. I am thinking of gathering the reusable
> code from the test runner into a class, and adding a __main__ part into the
> test suites' code, so it will become runnable by itself, that will call the
> class from the runner when executed directly. Of course all the data that is
> available for bitbake should be available for the tests so we'll still need
> the testdata.json to be exported and present in the runtime folder. 
> I have made a proof of concept with one of our suites and it works fine
> without having to modify the existing tests, just append some lines at the
> beginning.
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=lucian/
> selfexecution&id=7028e451e92a5ddd8f45178d4736548a20ab88ff

Hi Cathy,
Please let us know if the solution proposed by Lucian suffices your needs.
Comment 5 Cathy Shen 2016-02-14 05:20:46 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Hi Cathy,
> > 
> > There might be a way to do this. I am thinking of gathering the reusable
> > code from the test runner into a class, and adding a __main__ part into the
> > test suites' code, so it will become runnable by itself, that will call the
> > class from the runner when executed directly. Of course all the data that is
> > available for bitbake should be available for the tests so we'll still need
> > the testdata.json to be exported and present in the runtime folder. 
> > I have made a proof of concept with one of our suites and it works fine
> > without having to modify the existing tests, just append some lines at the
> > beginning.
> > 
> > http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=lucian/
> > selfexecution&id=7028e451e92a5ddd8f45178d4736548a20ab88ff
> 
> Hi Cathy,
> Please let us know if the solution proposed by Lucian suffices your needs.

Sorry for late response. Jing is working with Richard on the redesign of oeRuntime runner. The general concept is to split it to base runner and project specific parts. We can provide this feature based on the new design. I'd like to close this requirement.
Comment 6 Bogdan Alexandru Voiculescu 2016-02-19 09:04:54 UTC
Verified; obsolete: design change in progress.