In case of a platform feature/fix breaks a test in the SDK there should be an option to disable the process killing timeouts in the test runner, which makes it impossible to do some serious debugging. Another great help would be to use some kind of delay flag, that waits for input before executing the tests, so a debugger can be hooked in. I'd love to give high priority for this bug since the first part is very important now that we are going to un-hide our tests on try.
Created attachment 737473 [details] Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620 Here is a --no-quit option, but I'm wondering... shouldn't we rename --no-run to a "platform debugging mode" where we do various things at once? I'm kind of concerned with the always growing number of cfx options. So, we would have, let say --debugger-mode that would disable firefox auto kill, won't run firefox, eventually tweak test executiong time. And then we can continue tweaking this mode and add new specific behavior. While writing this patch, I was thinking about setting an ENV variable with command to run in order to ease running the debugger and avoid painfull cmd.exe copy paste. Also, I'm not sure delaying test executing is that usefull; Can't you set your breakpoints before running the executable?
Comment on attachment 737473 [details] Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620 Can we call that flag something simple? Like --debug. So I don't use cmd.exe, I use the mozilla build tools and most of the windows developers does the same, so it's not all that bad, and the ENV var is a bit off, since no other mozilla test does that. Finally you can set the breakpoint before run on non-windows platforms for sure but for windows it's a bit more difficult. It is not impossible but is a painfull process to set up visual studio to launch the test, it's a lot easier just to attach it to an existing, running process, especially if cfx uses child processes for running the tests (or will use in the future). So for one, I'd be more than glad to have that option... it can be a sub option for the --debug flag like: cfx test --debug norun
I thought about --debug too, but it would be misleading for addon developers. I'm inclined to think that the option name should explicitely tell that's for platform, C++ debugger stuff and that's clearly not to debug addons. Otherwise, I'm not sure I have been clear about the env variable. I was think about something like this: $ cfx --no-run You can start the addon by running: /usr/bin/firefox -profile .... -no-remote or $RUN_JETPACK $ gdb --args $RUN_JETPACK It might not be usefull for you on windows, but handy on linux/gdb.
(In reply to Alexandre Poirot (:ochameau) from comment #3) > I thought about --debug too, but it would be misleading for addon developers. > I'm inclined to think that the option name should explicitely tell that's > for platform, C++ debugger stuff and that's clearly not to debug addons. Is it? I think it might be handy if you want to debug the test itself at js level, when you are implementing a test, and want to attach a remote debugger to it... Might not be possible now, but once it is available it is the very same story, or am I wrong? > > Otherwise, I'm not sure I have been clear about the env variable. I was > think about something like this: > > $ cfx --no-run > You can start the addon by running: > /usr/bin/firefox -profile .... -no-remote > or > $RUN_JETPACK > > $ gdb --args $RUN_JETPACK > > It might not be usefull for you on windows, but handy on linux/gdb. Yeah I got it, and as a second thought just because other test does not have this it does not mean it's a bad idea. So sure, someone will be happy for it I'm sure.
Looks like I won't have time to look at SDK bugs anymore.
Created attachment 8488955 [details] [review] Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620
Comment on attachment 737473 [details] Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620 See https://github.com/mozilla/addon-sdk/pull/1620 now
Commits pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/342154b2c27e2bfd4e589369f0effe162f2ef191 Bug 856999: Add --no-quit option to prevent from killing firefox when running tests. https://github.com/mozilla/addon-sdk/commit/8284e8ee1255b6112c0711ec1219d103f0c6bf7b Merge branch 'master' of https://github.com/mozilla/addon-sdk into bug856999 Conflicts: app-extension/bootstrap.js lib/sdk/system.js python-lib/cuddlefish/__init__.py https://github.com/mozilla/addon-sdk/commit/9a614d99572fddf9b2ed29d97aa457cecb58fd6a Bug 856999: fix for using --no-quit and --stop-on-error together, which was quiting before https://github.com/mozilla/addon-sdk/commit/d3c9f43f091937c756c725dd44826c61752926cf Merge pull request #1620 from erikvold/856999 Bug 856999: Add --no-quit option to prevent from killing firefox when running tests r=@jsantell