Skip to content

Commit f0eece3

Browse files
committed
[android] Allow skipping adb_clean.py
In normal cases, adb_clean.py cleaning the temporal directory is a good idea because all the tests run in a clean state, and previous executions do not influence the current one. However, when iterating and running only one or two tests with utils/run-test, removing all the artifacts and uploading them to the device can turn each iteration into waiting a couple of minutes. Since the changes in between tests should only touch a couple of libraries (or none at all, if the test itself is the modification), avoiding a full clean is beneficial. The commit modifies `adb_clean.py` to allow providing the environment variable `SKIP_ANDROID_CLEAN`, which will simply not execute the script. Since the introduction of #24146, only the modified artifacts will be uploaded, and the test iteration can be very fast (including no time, if there are no changes).
1 parent 7311886 commit f0eece3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/android/adb_clean.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
# See https://swift.org/LICENSE.txt for license information
1010
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1111

12+
import os
13+
1214
from adb.commands import DEVICE_TEMP_DIR, reboot, rmdir
1315

1416

1517
if __name__ == '__main__':
16-
reboot()
17-
rmdir(DEVICE_TEMP_DIR)
18+
if 'SKIP_ANDROID_CLEAN' not in os.environ:
19+
reboot()
20+
rmdir(DEVICE_TEMP_DIR)

0 commit comments

Comments
 (0)