[tbot] [Discussion] Calling tbot from within the source directory

Stefano Babic sbabic at denx.de
Wed Nov 28 16:47:59 UTC 2018


On 28/11/18 16:26, Harald Seiler wrote:
> On Wed, 2018-11-28 at 16:20 +0100, Stefano Babic wrote:
>> On 28/11/18 16:00, Harald Seiler wrote:
>>> Hi Stefano, Claudius,
>>>
>>> On Wed, 2018-11-28 at 15:39 +0100, Stefano Babic wrote:
>>>> Hi,
>>>>
>>>> On 28/11/18 15:22, Claudius Heine wrote:
>>>>> Hi,
>>>>>
>>>>> currently calling tbot from some directory that is not the directory
>>>>> containing the testcases is a bit inconvenient.
>>>>>
>>>>> For example the product specific testcase directory has the following
>>>>> structure:
>>>>>
>>>>>     tbot-privat
>>>>>     ├── boards
>>>>>     │   └── my-board.py
>>>>>     ├── labs
>>>>>     │   └── my-lab.py
>>>>>     └── tc
>>>>>         └── my-testcases.py
>>>>>
>>>>> Then I would have to call tbot from another directory like this:
>>>>>
>>>>>     $ tbot -T /path/to/tbot-privat \
>>>>>       -l /path/to/tbot-privat/labs/my-lab.py \
>>>>>       -b /path/to/tbot-privat/boards/my-board my_test_case
>>>>>
>>>>
>>>> Right.
>>>>
>>>>> That is a bit tiresome. A `-C` parameter like git(1) has, would solve
>>>>> it, but I think accessing the source code via the cwd in the testcases
>>>>> as a fallback would be nice.
>>>>
>>>> Because this is like a user setup (a usr has a set of boards + a set of
>>>> testcases), I would suggest as option to have a configuration file (like
>>>> buildman), something like
>>>>
>>>> [boarddir]
>>>> /path/to/tbot-privat/boards
>>>>
>>>> [lab]
>>>> /path/to/tbot-privat/labs/my-lab.py
>>>>
>>>> [tcdirs]
>>>> /path/tc1
>>>> /path/tc2
>>>> /path/tc3
>>>>
>>>> and we can call tbot simply with "tbot -b my-board my_test_case"
>>>
>>> I prefer the `-C /path/to/tbot-privat` approach over adding a configuration
>>> file to tbot.  Back in my first rewrite, I had a config-file system and it
>>> got convoluted and hard to reason about quickly.  Personally I prefer keeping
>>> tbot stupid and doing configuration via the commandline, similar to other
>>> unix tools.  Additionally to a -C parameter I suggest we add support for
>>> environment variables.  One that I think would be useful is `TBOTPATH`, which
>>> should allow specifying additional testcase directories.
>>
>> That is fine, too.
>>
>> Stefano
> 
> Two more things:
> 
> 1. Right now, tbot checks -T paths recursively.

And this is very nice !

>  Do you think this should also
>    be the case for TBOTPATH paths?  Or should only python files inside the specified
>    directory be considered?

I think it is enough to check the directory.

> 
> 2. An easy way around having to use a long tbot commandline all the time is setting
>    an alias or - what I currently use - add a script ./tbot which just calls tbot
>    with the configuration added. Eg:
> 
>    	#!/bin/sh
>    	tbot -l labs/pollux.py -vv $*

Right, this is what I do.

Stefano

> 
> Harald
> 
>>
>>>
>>>>>
>>>>> I might just be my different understanding of things. I like to be in
>>>>> the directory of the stuff that should be tested, not where the
>>>>> testcases are located.
>>>>
>>>> Agree. Now we have to go into tbot-privat to avoid to pass always the
>>>> full path.
>>>>
>>>>> It also makes sense for me if multiple source
>>>>> directories need to be "tested" on the same hw.
>>>>
>>>> Agree.
>>>>
>>>>>
>>>>> What do you think about this?
>>>>
>>>> Regards,
>>>> Stefano
>>>>
>>>>>
>>>>> Cheers,
>>>>> Claudius
>>>>>
>>>>
>>>>
>>
>>


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the tbot mailing list