tools/mpremote: Fix test_mount.sh - #19604
Conversation
8e439bb to
60d69e5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19604 +/- ##
==========================================
+ Coverage 98.55% 98.58% +0.03%
==========================================
Files 182 182
Lines 23320 23322 +2
Branches 5 5
==========================================
+ Hits 22984 22993 +9
+ Misses 335 328 -7
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code size report: |
948d9ea to
5b62dfc
Compare
|
test_resume.sh fails for ports/samd ADA_ITSYBITSY_M0:
This seems to be the cause: https://github.com/micropython/micropython/blob/master/py/runtime.c#L255-L259 #if MICROPY_ERROR_REPORTING <= MICROPY_ERROR_REPORTING_TERSE
mp_raise_msg(&mp_type_NameError, MP_ERROR_TEXT("name not defined"));
#else
mp_raise_msg_varg(&mp_type_NameError, MP_ERROR_TEXT("name '%q' isn't defined"), qst);
#endif |
I suggest fixing that issue like this: --- a/tools/mpremote/tests/test_resume.sh
+++ b/tools/mpremote/tests/test_resume.sh
@@ -7,7 +7,7 @@ $MPREMOTE exec "a = 'hello'" eval "a"
# Automatic soft reset. `a` will trigger NameError.
echo -----
-$MPREMOTE eval "a" || true
+$MPREMOTE eval "'a' in globals()" || true
# Resume will skip soft reset.
echo -----
@@ -16,7 +16,7 @@ $MPREMOTE resume eval "a"
# The eval command will continue the state of the exec.
echo -----
-$MPREMOTE exec "a = 'soft-reset'" eval "a" soft-reset eval "1+1" eval "a" || true
+$MPREMOTE exec "a = 'soft-reset'" eval "a" soft-reset eval "1+1" eval "'a' in globals()" || true
# A disconnect will trigger auto-reconnect.
echo -----The expected output of that new expression is |
f4ef9ad to
9a658fc
Compare
Signed-off-by: Hans Maerki <buhtig.hans.maerki@ergoinfo.ch>
9a658fc to
4fd118f
Compare
|
I was running two jobs against this branch:
All tests now correctly pass or skip. However:
@Josverl: You can review this PR now! |
Summary
This fixes a failure in mpremote/test_mount.sh.
Obverved error
Somehow the line order in
test_mount.sh.expwas out of ordner.Erroronous
test_mount.sh.exp:x y Local directory ${TMP} is mounted at /remoteFixed
test_mount.sh.exp:Local directory ${TMP} is mounted at /remote x yRationale
I assume, this happend in
Where
mountoutputsLocal directory ${TMP} is mounted at /remoteand exec ouputsx y.mpremotewrite tosys.stdout.bufferwhich caused the false reordering of lines. In this PR, we fix this by flushing the buffer.Testing
Tested on linux in Octoprobe.
Trade-offs and Alternatives
Generative AI
I did not use generative AI tools when creating this PR.