Closed Bug 579929 Opened 14 years ago Closed 13 years ago

if --profile is specified and the directory doesn't exist, Mozrunner should make a profile there

Categories

(Testing :: Mozbase, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Assigned: k0scist)

Details

(Whiteboard: [mozmill-2.0+])

Attachments

(1 file)

Currently, if --profile is given as an argument to Mozrunner, the specified directory will be assumed to contain a profile and will be used. If --profile is not given, a new profile will be generated in a temporary directory. http://github.com/mozautomation/mozmill/blob/master/mozrunner/mozrunner/__init__.py#L163 However, for the case where --profile is specified and the directory does not exist, Mozrunner should create a new profile in that directory. This profile should not be deleted on program exit. Existing behaviour: (mozmill)> mozmill -b ~/firefox/firefox -t mozmill-tests/firefox/ --showall -p /dfjkadfsdf/sdfjasdfk Traceback (most recent call last): File "/home/jhammel/mozmill/bin/mozmill", line 8, in <module> load_entry_point('mozmill==1.4.1', 'console_scripts', 'mozmill')() File "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py", line 645, in cli CLI().run() File "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py", line 622, in run self._run() File "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py", line 582, in _run runner = self.create_runner() File "/home/jhammel/mozmill/src/mozmill/mozrunner/mozrunner/__init__.py", line 479, in create_runner addons=self.addons) File "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py", line 577, in get_profile profile = jsbridge.CLI.get_profile(self, *args, **kwargs) File "/home/jhammel/mozmill/src/mozmill/jsbridge/jsbridge/__init__.py", line 112, in get_profile profile = mozrunner.CLI.get_profile(self, *args, **kwargs) File "/home/jhammel/mozmill/src/mozmill/mozrunner/mozrunner/__init__.py", line 492, in get_profile return self.profile_class(binary, profile, addons, preferences) File "/home/jhammel/mozmill/src/mozmill/mozrunner/mozrunner/__init__.py", line 192, in __init__ self.set_preferences(self.preferences) File "/home/jhammel/mozmill/src/mozmill/mozrunner/mozrunner/__init__.py", line 254, in set_preferences f = open(prefs_file, 'w') IOError: [Errno 2] No such file or directory: '/dfjkadfsdf/sdfjasdfk/user.js'
Should we treat this the same way as when specifying no --profile option and removing such a profile after the test run? I would think so.
(In reply to comment #1) > Should we treat this the same way as when specifying no --profile option and > removing such a profile after the test run? I would think so. If that is the case, then there is no reason to add the functionality (that is, if the files are temporary, there is no point in choosing where they go). I was thinking that if a non-existant but specified location was chosen, the profile would persist and, optimally, not be cleaned up. The main use case would be debugging purposes. If this behaviour is not desired, the ticket may be closed: I don't know if I see the point of adding functionality to create a temporary profile in a specific location.
So what happens if I accidentally miss-type the location? We would create a new profile which I will have to remove manually after the application has quit. Personally I don't like it. IMO we should only use existing folders and quit otherwise with a better failure message. And as another note... such a newly created profile wouldn't be accessible from Firefox profile manager itself. So it will be harder for users to get that profile integrated. Those are just my ideas. What do you think?
(In reply to comment #3) > So what happens if I accidentally miss-type the location? I generally don't see this is a valid argument. While I understand for end-user facing software (e.g. non-command line software) the desire for confirmation dialogs and what not, most often if you mistype a command line, all sorts of horrible things can happen. > We would create a new > profile which I will have to remove manually after the application has quit. > Personally I don't like it. IMO we should only use existing folders and quit > otherwise with a better failure message. > > And as another note... such a newly created profile wouldn't be accessible from > Firefox profile manager itself. So it will be harder for users to get that > profile integrated. > > Those are just my ideas. What do you think? We can close this bug as invalid if this isn't a desired feature. Less work for us. I don't see the point of creating a temporary profile in a specific location unless it enables some additional functionality.
Any status update here? I'm content closing as WONTFIX
Since there doesn't seem to be much interest or consensus, I'm closing as wontfix. Feel free to reopen the issue if we want to do something more
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Whiteboard: [mozmill-2.0?]
Contingently +'ing for 2.0. I'd like to see a real way forward here. Jeff, what are you proposing?
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
Current behaviour: when you specify a non-existent directory with --profile you err out: mozmill --profile /tmp/asfjasdfjkasdf -t src/mozmill/mozmill/test/test_demo.js Traceback (most recent call last): File "/home/jhammel/mozmill/bin/mozmill", line 8, in <module> load_entry_point('mozmill==2.0a', 'console_scripts', 'mozmill')() File "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py", line 505, in cli CLI(args).run() File "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py", line 466, in run runner = self.create_runner() File "/home/jhammel/mozmill/src/mozmill/mozrunner/mozrunner/runner.py", line 346, in create_runner self.runner_args()) File "/home/jhammel/mozmill/src/mozmill/mozrunner/mozrunner/runner.py", line 246, in create_runner profile = profile_class(**profile_args) File "/home/jhammel/mozmill/src/mozmill/mozprofile/mozprofile/profile.py", line 78, in __init__ self.set_preferences(self.preferences) File "/home/jhammel/mozmill/src/mozmill/mozprofile/mozprofile/profile.py", line 189, in set_preferences f = open(prefs_file, 'w') IOError: [Errno 2] No such file or directory: '/tmp/asfjasdfjkasdf/user.js' Exception IOError: (2, 'No such file or directory', '/tmp/asfjasdfjkasdf/user.js') in <bound method FirefoxProfile.cleanup of <mozprofile.profile.FirefoxProfile object at 0xa1bb1ec>> ignored Proposed behaviour: When a profile directory doesn't exist at a location, make one, and persist this directory (don't kill it after the tests). As per comment 7, it sounds like they already do this for thunderbird. In comment 1 and comment 3, :whimboo objects to this and proposes that this feature not be included or that the profile is cleaned up. If the profile is going to be cleaned up, there is no point in making it. So we just need to decide if it is a feature or a misfeature that specifying --profile wrt a nonexistent path will create and persist said profile
Attached patch proposed fix (deleted) — Splinter Review
I'm still not sure if this is a change we want or not, but here is a proposed first stab. I made it pretty minimal as I'm not entirely sure of operational requirements, but this is what I'd recommend for 2.0. If we *don't* want this we should 2.0- it and move on.
Assignee: nobody → jhammel
Attachment #533848 - Flags: review?(fayearthur+bugs)
Comment on attachment 533848 [details] [diff] [review] proposed fix looks great.
Attachment #533848 - Flags: review?(fayearthur+bugs) → review+
Status: REOPENED → RESOLVED
Closed: 14 years ago13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: