-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix device test environment variables #6229
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Device tests were not connecting properly to WiFi because the environment variables were not set when WiFi.connect was called. This would result in tests sometimes working *if* the prior sketch run on the ESP saved WiFi connection information and auto-connect was enabled. But, in most cases, the tests would simply never connect to any WiFi and fail. getenv() works only after BS_RUN is called (because BS_RUN handles the actual parsing of environment variables sent from the host). Add a "pretest" function to all tests which is called by the host test controller only after all environment variables are set. Move all WiFi/etc. operations that were in each separate test's setup() into it. So the order of operations for tests now is: ESP: setup() -> Set serial baud -> Call BS_RUN() HOST: Send environment Send "do pretest" ESP: pretest() -> Set Wifi using env. ariables, etc. return "true" on success HOST: Send "run test 1" ESP: Run 1st test, return result HOST: Send "run test 2" ESP: Run 2nd test, return result <and so forth> If nothing is needed to be set up, just return true from the pretest function. All tests now run and at least connect to WiFi. There still seem to be some actual test errors, but not because of the WiFi/environment variables anymore.
Esptool-ck.exe had an option to be silent, but esptool.py doesn't so the output is very chatty and makes looking a the run logs hard (60 lines of esptool.py output, 3 lines of actual test reports). Redirect esptool.py STDOUT to /dev/null unless V=1 to clear this up.
arduino-builder checks the build.options.json file and then goes off and pegs my CPU at 100% for over a minute on each test compile checking if files have been modified. Simply deleting any pre-existing options.json file causes this step to be skipped and a quick, clean recompile is done in siginificantly less time.
Enable all GCC warnings when building the tests and fix any that came up (mostly signed/unsigned, unused, and deprecated ones).
d-a-v
approved these changes
Jun 25, 2019
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.
Thanks !
Printf can now handle PROGMEM addresses, so simplify and correct the debug printouts in umm_info and elsewhere.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Device tests were not connecting properly to WiFi because the
environment variables were not set when WiFi.connect was called.
This would result in tests sometimes working if the prior sketch run
on the ESP saved WiFi connection information and auto-connect was
enabled. But, in most cases, the tests would simply never connect to
any WiFi and fail.
getenv() works only after BS_RUN is called (because BS_RUN handles the
actual parsing of environment variables sent from the host).
Add a "pretest" function to all tests which is called by the host test
controller only after all environment variables are set. Move all
WiFi/etc. operations that were in each separate test's setup() into it.
So the order of operations for tests now is:
If nothing is needed to be set up, just return true from the pretest
function.
All tests now run and at least connect to WiFi. There still seem to be
some actual test errors, but not because of the WiFi/environment
variables anymore.