Skip to content

tools/compile_and_test_for_board: fix lint [backport 2021.01]#16123

Merged
aabadie merged 1 commit intoRIOT-OS:2021.01-branchfrom
leandrolanzieri:backport/2021.01/pr/tools/compile_and_for_board_fix_lint
Mar 2, 2021
Merged

tools/compile_and_test_for_board: fix lint [backport 2021.01]#16123
aabadie merged 1 commit intoRIOT-OS:2021.01-branchfrom
leandrolanzieri:backport/2021.01/pr/tools/compile_and_for_board_fix_lint

Conversation

@leandrolanzieri
Copy link
Contributor

@leandrolanzieri leandrolanzieri commented Mar 2, 2021

Backport of #16058

It seems this needs to be backported, in order to continue backporting other PRs to the latest release (see #16120 (comment)).

Contribution description

A new version of Pylint was released today and this breaks the tools-test github action because of a small inconsistency in the compile_and_test_for_board script.

The raised issue is perfectly valid and this PR is fixing it by cleaning up a bit the make_with_outfile function. The return value of this function is never used so a bare return or no return is ok.

self.make_with_outfile('compilation', compilation_cmd)

self.make_with_outfile('test', self.TEST_TARGETS,
save_output=True, setuptasks=setuptasks)

Testing procedure

compile_and_test_for_board.py works as expected:

Details
$ ./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications="tests/shell"
INFO:native:Saving toolchain
INFO:native.tests/shell:Board supported: True
INFO:native.tests/shell:Board has enough memory: True
INFO:native.tests/shell:Application has test: True
INFO:native.tests/shell:Run compilation
INFO:native.tests/shell:Run test
INFO:native.tests/shell:Run test.flash
INFO:native.tests/shell:Success
INFO:native:Tests successful
$ cat results/native/tests/shell/test.success 


/work/riot/RIOT/tests/shell/bin/native/tests_shell.elf /dev/ttyACM0 
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: buildtest)
test_shell.
> 
> 
> bufsize
bufsize
128
> ________________________________________________________________________________________________________________________________verylong
________________________________________________________________________________________________________________________________verylong
shell: maximum line length exceeded
> garbage1234
garbage1234
> 
> echo____________________________________________________________________________________________________________________________verylong
_________echo                                                                                                                           
"echo"
> 
shell exited
> 
> start_test
start_test
[TEST_START]
> 


> 
> echo a string
echo a string
"echo""a""string"
> echo   multiple   spaces   between   argv
echo   multiple   spaces   between   argv
"echo""multiple""spaces""between""argv"
> echo 	 tabs		 processed 		like	 		spaces
echo 	 tabs		 processed 		like	 		spaces
"echo""tabs""processed""like""spaces"
> unknown_command
unknown_command
shell: command not found: unknown_command
>      echo leading spaces
     echo leading spaces
"echo""leading""spaces"
> 					echo leading tabs
					echo leading tabs
"echo""leading""tabs"
> echo trailing spaces     
echo trailing spaces     
"echo""trailing""spaces"
> echo trailing tabs					
echo trailing tabs					
"echo""trailing""tabs"
> hello-world
hello-world
shell: command not found: hello-world
echo
echo
"echo"
> echo \'
echo \'
"echo""'"
> echo \"
echo \"
"echo""""
> echo escaped\ space
echo escaped\ space
"echo""escaped space"
> echo escape within '\s\i\n\g\l\e\q\u\o\t\e'
echo escape within '\s\i\n\g\l\e\q\u\o\t\e'
"echo""escape""within""singlequote"
> echo escape within "\d\o\u\b\l\e\q\u\o\t\e"
echo escape within "\d\o\u\b\l\e\q\u\o\t\e"
"echo""escape""within""doublequote"
> echo "t\e st" "\"" '\'' a\ b
echo "t\e st" "\"" '\'' a\ b
"echo""te st"""""'""a b"
> echo "hello"world
echo "hello"world
"echo""helloworld"
> echo hel"lowo"rld
echo hel"lowo"rld
"echo""helloworld"
> echo hello"world"
echo hello"world"
"echo""helloworld"
> echo quoted space " "
echo quoted space " "
"echo""quoted""space"" "
> echo abc"def'ghijk"lmn
echo abc"def'ghijk"lmn
"echo""abcdef'ghijklmn"
> echo abc'def"ghijk'lmn
echo abc'def"ghijk'lmn
"echo""abcdef"ghijklmn"
> echo "'" '"'
echo "'" '"'
"echo""'""""
> echo a\
echo a\
shell: incorrect quoting
> echo "
echo "
shell: incorrect quoting
> echo '
echo '
shell: incorrect quoting
> echo abcdef"ghijklmn
echo abcdef"ghijklmn
shell: incorrect quoting
> echo abcdef'ghijklmn
echo abcdef'ghijklmn
shell: incorrect quoting
> ps
ps
	pid | state    Q | pri 
	  1 | pending  Q |  15
	  2 | running  Q |   7
> help
help
Command              Description
---------------------------------------
bufsize              Get the shell's buffer size
start_test           starts a test
end_test             ends a test
echo                 prints the input command
empty                print nothing on command
reboot               Reboot the node
version              Prints current RIOT_VERSION
pm                   interact with layered PM subsystem
ps                   Prints information about running threads.
app_metadata         Returns application metadata
> reboot
reboot


		!! REBOOT !!

RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: buildtest)
test_shell.
> end_test
end_test
[TEST_END]
> 

Issues/PRs references

The CI is failing on several PRs because of this problem.

@leandrolanzieri leandrolanzieri added Area: CI Area: Continuous Integration of RIOT components Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Mar 2, 2021
Pylint raises an error because of inconsistent return statements in the make_with_outfile function. The return value of this function is never used, so a bare return or no return is ok

(cherry picked from commit dd88ead)
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

ACK. This is caused by an external change and the change is the same as on master.

@aabadie aabadie merged commit 7aec652 into RIOT-OS:2021.01-branch Mar 2, 2021
@leandrolanzieri leandrolanzieri deleted the backport/2021.01/pr/tools/compile_and_for_board_fix_lint branch March 2, 2021 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CI Area: Continuous Integration of RIOT components Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants