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

richard.purdie at linuxfoundation.org richard.purdie at linuxfoundation.org
Mon Oct 22 09:34:27 UTC 2018


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