[OE-core] [PATCH 1/4] oeqa/core/runner: write testresult to json files

Yeoh, Ee Peng ee.peng.yeoh at intel.com
Mon Oct 22 09:47:22 UTC 2018


Hi Richard,

You are right, the current codes and functions does not express clearly what it does, especially on getting existing testresult, let me refactor this to make it clearer. 

Yes, let me use getVar("LOGDIR") + "/oeqa" as default result_dir. Do you think we shall have OEQA_JSON_RESULT_DIR variable for user to define custom result_dir? 

Thanks,
Yeoh Ee Peng 

-----Original Message-----
From: richard.purdie at linuxfoundation.org [mailto:richard.purdie at linuxfoundation.org] 
Sent: Monday, October 22, 2018 5:34 PM
To: Yeoh, Ee Peng <ee.peng.yeoh at intel.com>; openembedded-core at lists.openembedded.org
Subject: Re: [OE-core] [PATCH 1/4] oeqa/core/runner: write testresult to json files

On Mon, 2018-10-22 at 08:59 +0000, Yeoh, Ee Peng wrote:
> Hi Richard
> 
> Current codes does load existing testresult json file if it exist, 
> then it will write the new testresult into it based on the result_id.
> > +    def _get_testresults(self, write_dir):
> > +        testresults = {}
> > +        file = os.path.join(write_dir, self.testresult_filename)
> > +        if os.path.exists(file):
> > +            with open(file, "r") as f:
> > +                testresults = json.load(f)
> > +        return testresults

I managed to miss that function and call, sorry. That should be fine. I think we may want to inline some of these functions to make things clearer.

> I did have the same thinking on if we can have a common function to 
> manage configuration and result_id or let individual test classes to 
> manage it, in the end, the thinking was configuration/result_id were 
> really responsibility of each test classes, where the json helper 
> class inside runner shall not have the knowledge or know-how on 
> configuration/result_id. Thus the decision in the end was to make json 
> helper class responsibility as simple as to consume the configuration, 
> results, result_id information provided by the test classes. Hope this 
> explain the reason behind current design.
> 
> Thank you very much for your attention & knowledge sharing! 

You could just do what amounts to getVar("LOGDIR") + "/oeqa" and have that as the default test result location?

Cheers,

Richard





More information about the Openembedded-core mailing list