Closed Bug 1212375 Opened 9 years ago Closed 8 years ago

Fix up file_manager.remove in gaia_test.py

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: martijn.martijn, Unassigned)

References

Details

Attachments

(2 files)

I did some print('Removing: %s' % path) in file_manager remove method and I noticed this as result:
Removing: /cache/*
Removing: /data/b2g/mozilla
Removing: /data/local/debug_info_trigger
Removing: /data/local/indexedDB
Removing: /data/local/OfflineCache
Removing: /data/local/permissions.sqlite
Removing: /data/local/storage/permanent
Removing: /data/local/storage/persistent
Removing: /data/local/storage/default
Removing: /data/misc/wifi/wpa_supplicant.conf
Removing: /storage/sdcard//tests

The last one is wrong.
Comment on attachment 8670822 [details] [review]
[gaia] mwargers:1212375 > mozilla-b2g:master

This fixes it and would have been the correct fix for bug 1182086.
Attachment #8670822 - Flags: review?(npark)
Attachment #8670822 - Flags: review?(jlorenzo)
Comment on attachment 8670822 [details] [review]
[gaia] mwargers:1212375 > mozilla-b2g:master

LGTM
Attachment #8670822 - Flags: review?(npark) → review+
Comment on attachment 8670822 [details] [review]
[gaia] mwargers:1212375 > mozilla-b2g:master

Sorry, this patch will regress what we fixed in bug 1182086. I ran test_gallery_flick with one extra picture taken manually, the test doesn't pass anymore.

I activated the debug traces to see what happens, and it turns out we don't delete what's in /mnt/sdcard anymore.

With the patch, we can see: 
> GaiaFileManager DEBUG | Checking for existance of directory: /mnt/sdcard
> GaiaFileManager DEBUG | Listing items in: /mnt/sdcard
> GaiaFileManager DEBUG | Checking for existance of directory: /mnt/extsdcard

Before the patch, we had:
> GaiaFileManager DEBUG | Checking for existance of directory: /mnt/sdcard/
> GaiaFileManager DEBUG | Listing items in: /mnt/sdcard/
> GaiaFileManager DEBUG | Removing: /mnt/sdcard//.gallery
> GaiaFileManager DEBUG | Removing: /mnt/sdcard//DCIM
> GaiaFileManager DEBUG | Removing: /mnt/sdcard//tests
> GaiaFileManager DEBUG | Checking for existance of directory: /mnt/extsdcard/
Attachment #8670822 - Flags: review?(jlorenzo) → review-
Thanks for testing, oops!
Comment on attachment 8670822 [details] [review]
[gaia] mwargers:1212375 > mozilla-b2g:master

Ok, this works and is simpler. 
A similar thing is also used here: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/gaia_test.py#916
916         self.device.file_manager.remove('/cache/*')
Attachment #8670822 - Flags: review?(npark)
Attachment #8670822 - Flags: review?(jlorenzo)
Attachment #8670822 - Flags: review-
Attachment #8670822 - Flags: review+
Comment on attachment 8670822 [details] [review]
[gaia] mwargers:1212375 > mozilla-b2g:master

Ah, so it now includes suffix.  makes sense.
Attachment #8670822 - Flags: review?(npark) → review+
Comment on attachment 8670822 [details] [review]
[gaia] mwargers:1212375 > mozilla-b2g:master

Works for me! Here's what I get when I run test_gallery_flick.py:

> GaiaFileManager DEBUG | Checking for existance of directory: /storage/sdcard0/tests
> GaiaFileManager DEBUG | Removing: /storage/sdcard0/tests/*
> GaiaFileManager DEBUG | Checking for existance of directory: /mnt/sdcard
> GaiaFileManager DEBUG | Removing: /mnt/sdcard/*
> GaiaFileManager DEBUG | Checking for existance of directory: /mnt/extsdcard
> GaiaFileManager DEBUG | Checking for existance of directory: /storage/sdcard
> GaiaFileManager DEBUG | Checking for existance of directory: /storage/sdcard0
> GaiaFileManager DEBUG | Removing: /storage/sdcard0/*
> GaiaFileManager DEBUG | Checking for existance of directory: /storage/sdcard1
> GaiaFileManager DEBUG | Removing: /storage/sdcard1/*
> GaiaFileManager DEBUG | Copying: /storage/sdcard0/tests/IMG_0001.jpg to: /storage/sdcard0/tests/IMG_0001_1.jpg
> GaiaFileManager DEBUG | Copying: /storage/sdcard0/tests/IMG_0001.jpg to: /storage/sdcard0/tests/IMG_0001_2.jpg
> GaiaFileManager DEBUG | Copying: /storage/sdcard0/tests/IMG_0001.jpg to: /storage/sdcard0/tests/IMG_0001_3.jpg
> GaiaFileManager DEBUG | Copying: /storage/sdcard0/tests/IMG_0001.jpg to: /storage/sdcard0/tests/IMG_0001_4.jpg
> GaiaFileManager DEBUG | Removing: /storage/sdcard0/tests/IMG_0001.jpg
Attachment #8670822 - Flags: review?(jlorenzo) → review+
Thanks for testing again, Johan!

Merged: https://github.com/mozilla-b2g/gaia/commit/1cdb286cd784580b4cc10067a71fda552a018d11
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Depends on: 1213352
Depends on: 1213333
Depends on: 1213353
I've reverted this, because there were recently a couple of bugs filed that are about files on the device, see dependancies.

Reverted: https://github.com/mozilla-b2g/gaia/commit/496e8dfaca95cf7b95a0f42bbd748d96ed8ef703
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: martijn.martijn → nobody
Marking WONTFIX, sorry for the bug spam. If somebody still wants to work on this, please file a new bug for it.
Status: REOPENED → RESOLVED
Closed: 9 years ago8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: