Skip to content

tools/compile_and_test_for_board: allow setting the flash targets#12413

Merged
fjmolinas merged 1 commit intoRIOT-OS:masterfrom
cladmi:pr/compile_and_test_for_board/flash_targets
Oct 10, 2019
Merged

tools/compile_and_test_for_board: allow setting the flash targets#12413
fjmolinas merged 1 commit intoRIOT-OS:masterfrom
cladmi:pr/compile_and_test_for_board/flash_targets

Conversation

@cladmi
Copy link
Contributor

@cladmi cladmi commented Oct 10, 2019

Contribution description

This allow configuring the flash targets in the same way as the
compilation and test targets.

This is part of trying to flash with docker using a different flash target.

Testing procedure

The flash targets can be overwritten from command line:
See 'flash', 'reset' in the output.

./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py --loglevel debug . native --applications=tests/bloom_bytes --flash-targets="flash reset"
INFO:native:Saving toolchain
DEBUG:native:board: native
DEBUG:native:app_dirs: ['tests/bloom_bytes']
DEBUG:native:resultdir: results
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-boards-supported'] ENV {'BOARDS': 'native', 'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board supported: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-debug-variable-BOARD_INSUFFICIENT_MEMORY'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board has enough memory: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test/available'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Application has test: True
INFO:native.tests/bloom_bytes:Run compilation
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'clean', 'all'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Run test
INFO:native.tests/bloom_bytes:Run test.flash
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'flash', 'reset'] ENV {'BOARD': 'native'}
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Success
INFO:native:Tests successful

The previous behavior is kept to use 'flash-only' by default:

See 'flash-only' in the output.

./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py --loglevel debug . native --applications=tests/bloom_bytes 
INFO:native:Saving toolchain
DEBUG:native:board: native
DEBUG:native:app_dirs: ['tests/bloom_bytes']
DEBUG:native:resultdir: results
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-boards-supported'] ENV {'BOARDS': 'native', 'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board supported: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-debug-variable-BOARD_INSUFFICIENT_MEMORY'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board has enough memory: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test/available'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Application has test: True
INFO:native.tests/bloom_bytes:Run compilation
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'clean', 'all'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Run test
INFO:native.tests/bloom_bytes:Run test.flash
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'flash-only'] ENV {'BOARD': 'native'}
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Success
INFO:native:Tests successful

Running tox in dist/tools/compile_and_test_for_board/ works without error

cd dist/tools/compile_and_test_for_board/; tox
...
  test: commands succeeded
  lint: commands succeeded
  flake8: commands succeeded
  congratulations :)

Issues/PRs references

Part of trying to do:

This allow configuring the flash targets in the same way as the
compilation and test targets.

This is part of trying to flash with docker using a different flash target.
@fjmolinas fjmolinas added Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Oct 10, 2019
@fjmolinas
Copy link
Contributor

Testing is good.

Details
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py --loglevel debug . native --applications=tests/bloom_bytes --flash-targets="flash reset"
INFO:native:Saving toolchain
DEBUG:native:board: native
DEBUG:native:app_dirs: ['tests/bloom_bytes']
DEBUG:native:resultdir: results
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-boards-supported'] ENV {'BOARDS': 'native', 'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board supported: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-debug-variable-BOARD_INSUFFICIENT_MEMORY'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board has enough memory: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test/available'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Application has test: True
INFO:native.tests/bloom_bytes:Run compilation
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'clean', 'all'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Run test
INFO:native.tests/bloom_bytes:Run test.flash
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'flash', 'reset'] ENV {'BOARD': 'native'}
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Success
INFO:native:Tests successful
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py --loglevel debug . native --applications=tests/bloom_bytes 
INFO:native:Saving toolchain
DEBUG:native:board: native
DEBUG:native:app_dirs: ['tests/bloom_bytes']
DEBUG:native:resultdir: results
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-boards-supported'] ENV {'BOARDS': 'native', 'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board supported: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'info-debug-variable-BOARD_INSUFFICIENT_MEMORY'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Board has enough memory: True
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test/available'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Application has test: True
INFO:native.tests/bloom_bytes:Run compilation
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'clean', 'all'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Run test
INFO:native.tests/bloom_bytes:Run test.flash
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'flash-only'] ENV {'BOARD': 'native'}
DEBUG:native.tests/bloom_bytes:['make', 'RIOT_CI_BUILD=1', 'CC_NOCOLOR=1', '--no-print-directory', '-C', './tests/bloom_bytes', 'test'] ENV {'BOARD': 'native'}
INFO:native.tests/bloom_bytes:Success
INFO:native:Tests successful
test create: /home/francisco/workspace/RIOT-test/dist/tools/compile_and_test_for_board/.tox/test
test installdeps: pytest
test installed: atomicwrites==1.3.0,attrs==19.2.0,importlib-metadata==0.23,more-itertools==7.2.0,packaging==19.2,pluggy==0.13.0,py==1.8.0,pyparsing==2.4.2,pytest==5.2.1,six==1.12.0,wcwidth==0.1.7,zipp==0.6.0
test run-test-pre: PYTHONHASHSEED='3583477387'
test run-test: commands[0] | pytest -v --doctest-modules
================================================================================================== test session starts ===================================================================================================
platform linux -- Python 3.6.7, pytest-5.2.1, py-1.8.0, pluggy-0.13.0 -- /home/francisco/workspace/RIOT-test/dist/tools/compile_and_test_for_board/.tox/test/bin/python
cachedir: .tox/test/.pytest_cache
rootdir: /home/francisco/workspace/RIOT-test/dist/tools/compile_and_test_for_board
collected 3 items                                                                                                                                                                                                        

compile_and_test_for_board.py::compile_and_test_for_board.is_in_directory PASSED                                                                                                                                   [ 33%]
compile_and_test_for_board.py::compile_and_test_for_board.list_from_string PASSED                                                                                                                                  [ 66%]
tests/test_compile_and_test_for_board.py::test_help_message PASSED                                                                                                                                                 [100%]

=================================================================================================== 3 passed in 0.11s ====================================================================================================
lint create: /home/francisco/workspace/RIOT-test/dist/tools/compile_and_test_for_board/.tox/lint
lint installdeps: pylint
lint installed: astroid==2.3.1,isort==4.3.21,lazy-object-proxy==1.4.2,mccabe==0.6.1,pylint==2.4.2,six==1.12.0,typed-ast==1.4.0,wrapt==1.11.2
lint run-test-pre: PYTHONHASHSEED='3583477387'
lint run-test: commands[0] | pylint compile_and_test_for_board.py tests

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

flake8 create: /home/francisco/workspace/RIOT-test/dist/tools/compile_and_test_for_board/.tox/flake8
flake8 installdeps: flake8
flake8 installed: entrypoints==0.3,flake8==3.7.8,mccabe==0.6.1,pycodestyle==2.5.0,pyflakes==2.1.1
flake8 run-test-pre: PYTHONHASHSEED='3583477387'
flake8 run-test: commands[0] | flake8 compile_and_test_for_board.py tests
________________________________________________________________________________________________________ summary _________________________________________________________________________________________________________
  test: commands succeeded
  lint: commands succeeded
  flake8: commands succeeded
  congratulations :)

@fjmolinas fjmolinas added the Reviewed: 3-testing The PR was tested according to the maintainer guidelines label Oct 10, 2019
Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is an enhancement that does not affect the default behavior. I agree with the changes which will allow using custom flash targets. ACK.

@fjmolinas fjmolinas added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels Oct 10, 2019
@fjmolinas
Copy link
Contributor

GO!

@fjmolinas fjmolinas merged commit 315e455 into RIOT-OS:master Oct 10, 2019
@cladmi
Copy link
Contributor Author

cladmi commented Oct 10, 2019

Thank you for the review.

@cladmi cladmi deleted the pr/compile_and_test_for_board/flash_targets branch October 10, 2019 15:54
@kb2ma kb2ma added this to the Release 2019.10 milestone Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants