- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.2k
 
twister: Allow sharing hardware platform between variants #81465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
twister: Allow sharing hardware platform between variants #81465
Conversation
d0d0536    to
    c6253a9      
    Compare
  
            
          
                doc/develop/test/twister.rst
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this instead be a list with type: any in the schema so it does support one single entry and a list if variants if needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered using:
type: seq
sequence:
    - type str
but that would break backward compatibility, so I didn't apply it.
Good idea with type: any, I will try to update it.
I was looking into testsuite-schema and there are a few fields that can be either a string or a list. There is also a logic in config_parser.py to properly cast those fields.  I need to look into it more closely.
Thanks for the advice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with  type: any. Now user can use a list of platforms:
in line, separated by spaces:
platform: nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns
or as a list:
platform:
- nrf5340dk/nrf5340/cpuapp
- nrf5340dk/nrf5340/cpuapp/ns
| 
           @gchwier this would be a problem, if we add pre_script/post_scripts, we need know the platform, so we need pass the platform name to the scripts as well?  | 
    
e390690    to
    9edf959      
    Compare
  
    
          
 It will work with PR #81389  | 
    
        
          
                doc/develop/test/twister.rst
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title is not clear IMO. Maybe Using Single Board For Multiple Variants? Or Boards Supporting Multiple Variants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to Using Single Board For Multiple Variants, thanks!
        
          
                doc/develop/test/twister.rst
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The ``platform`` attribute can be a list of names or can be extended | |
| with names separated by spaces. This allows you to run tests for | |
| different variants on the same board without re-configuring | |
| the hardware map file for each variant. For example: | |
| The ``platform`` attribute can be a list of names or a string | |
| with names separated by spaces. This allows to run tests for | |
| different platform variants on the same physical board, without re-configuring | |
| the hardware map file for each variant. For example: | 
Extended hardware map to share a single board between variants. To run tests for different variants on the same board without re-configuring the hardware map file for each variant, one can use a `platform` atribute as a list of names. Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
9edf959    to
    65b34ed      
    Compare
  
    | dut = DUT() | ||
| dut.available = 0 | ||
| dut.failures = 0 | ||
| handler.duts = [dut] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have some tests added for the changed behavior with several DUTs in the list
Extended hardware map to share a single board between variants. To run tests for different variants on the same board without re-configuring the hardware map file for each variant, one can extend the
platformattribute with board names separated by spaces or useplatformas a list.Generate hardware map:
${ZEPHYR_BASE}/scripts/twister --generate-hardware-map hardware_map.ymlUpdate platform with two variants you want to use:
Run tests:
./scripts/twister -T samples/hello_world --device-testing --hardware-map hardware_map.yml --west-flash=--recover -vv --no-clean -ll debugWhen test is run on a selected board, then all DUTs with same
idare locked.