#ubuntu-autopilot 2014-09-29
<veebers> thomi: you have a moment?
<thomi> sure
<thomi> what's up?
<veebers> thomi: Do you agree that this test does what we described the other day (WRT the datetime + tz tests)? http://bazaar.launchpad.net/~veebers/autopilot/adding_timezone_timestamp_tests/revision/514
<veebers> thomi: this is against trunk and passes, it fails when used on the datetime changes of balloons (that I'm taking over)
<thomi> veebers: no, that's not right
<thomi> I don't think
<thomi> hmmm
<veebers> thomi: my thought process:
<veebers> given a known timestamp, create a qml datetime object and compare what we get back down the line against a locally created datetime w/ the same timestamp
<thomi> veebers: ok, a few things.
<thomi> first, I'm not convinced that setting 'TZ' does what you expect - maybe it does, but I'd like to see a test proving that first.
<thomi> Second, that's not how users will ever compare the times in their autopilot tests, so it's not a great representation of what we're trying to fix
<thomi> Third, this doesn't mention times outside the 32 biut boundary - shoul dit?
<thomi> *should it
<thomi> that's all I have right now :D
<veebers> thomi: Right, I did some manual testing for the TZ part (but nothing seen here) and it does what I expect. 2nd good point re: user comparison. 3rd No doesn't test outside the 32bit yet, but is intended to prove the correctness of the DateTime types (and thus soon to prove the >32bit datetime stuff)
<veebers> I'll update it now
<veebers> thanks thomi :-)
<thomi> hmm, yes
<thomi> I think also we need to do some manual testing before we try and land this
<thomi> get balloons to try it
<thomi> and maybe others in different timezones
<veebers> thomi: yeah sounds good.
<veebers> thomi: if you have a moment, are these changes a step in the right direction (ignoring pt3 of yours at this stage); http://bazaar.launchpad.net/~veebers/autopilot/adding_timezone_timestamp_tests/revision/515
<thomi> veebers: that looks to me like you're testing the incorrect behavior
<thomi> veebers: if the qml property says:
<thomi> property date testingTime: new Date('2014-01-15 12:34:52');
<thomi> then in autopilot I should be able to do:
<thomi> date_object.day == 15
<thomi> date_object.hour == 12
<thomi> tht should *never* change
<veebers> thomi: hmm, good point, will check that out
#ubuntu-autopilot 2014-09-30
<veebers> thomi: when you have a moment could you take a look at this MP? https://code.launchpad.net/~veebers/autopilot/adding_timezone_timestamp_tests/+merge/236444
<thomi> veebers: needs a few fixes
<thomi> diff comments added
<veebers> thomi: cool, thank you
<veebers> thomi: ah, hmm, so the reason I use a timestamp in that test is/was to show that given a timestamp the qml app will display and provide the datetime in localtime. I'm not sure if that's still needed in the suite?
<thomi> ummm
<thomi> how do you know that the timestamp you use corresponds to the datetime string?
<veebers> thomi: I went from a known datetime (in UTC), generated a timestamp for it and then checked the time of that time stamp in different TZ's etc. Is that flawed?
<thomi> hmmmm
<thomi> So, you're trying to prove that qml doesn't know about timezones?
<thomi> I'm not sure I understand what that test is trying to say
<veebers> thomi: hmm, I guess the test was more for me, i.e. given an epoch and a TZ env what time will the qml date display
<thomi> veebers: but, the TZ is irrelevant, right?
<thomi> oh, you're using the TZ env var to *prove* that the TZ is irrelevant?
<veebers> thomi: will, when the TZ changes so does the time string displayed. So i guess irrelevant for the tests, but shows that the right time is shown for the TZ
<thomi> whaaa?
<thomi> well, that's fucked up already
<thomi> shouldn't it be the same string, always and forever?
<veebers> thomi: I might be confused now. When using the epoch/timestamp it displays in the localtime. When using the string '2014-01-15 12:34:52' it always displays that string regardless of TZ
<thomi> 'it' being qml, right?
<veebers> err yeah sorry, the simple qml script there
<thomi> well, that is fucked up
<thomi> so... qml applies a local timezone calculation to timestamps, but not to time strings
<thomi> veebers: in that case, at least comment the test... at the moment I doubt anyone apart from ytou will be able to understand it in 6 weeks time :D
<veebers> thomi: ack, will do.
<veebers> thomi: so I'll keep them as 2 tests (referring to your diff comment)
<veebers> thomi: MP updated
<thomi> veebers: what about timestamps in the far future?
<veebers> thomi: I'm not sure I understand? This is against trunk, not the large timestamp fix
<veebers> these tests will be used to ensure that the large datetime changes don't regress us
<thomi> ok - I thought the goal here was to fix the timestamp issues in AP?
<veebers> thomi: that's coming, I'm taking on balloons' branch and finishing it off
<thomi> ahh, so you'll merge these in first, then, in a separate branch do the large timestamp fix?
<veebers> thomi: yep, that;s the plan
<thomi> ahhh ok
<veebers> (sorry I wasn't very clear on that :-P)
<thomi> LGTM then, will approve
<thomi> veebers: done
<veebers> thomi: awesome, cheers
<thomi> veebers: just FYI - when you add a card, please add a 'task' card, not a 'scoping' card
<thomi> (to the LKKB board that is)
<veebers> thomi: noted. I could have sworn I added a task >:-\
<thomi> :D
<veebers> thomi: ah I see, it was when quick adding the tasks to the main card, it defaults to scoping (didn't notice) and if you move your mouse cursor outside the dialog thingy it closes it :-\
<thomi> lol
<veebers> thomi: hmm, can you do me a favor, can you run this test for me please? autopilot.tests.functional.test_introspection_features.IntrospectionFeatureTests.test_customised_proxy_classes_have_extension_classes
<thomi> sure
<thomi> veebers: fails for me...
<thomi> testtools.matchers._impl.MismatchError: <class 'autopilot.introspection.qt.QtObjectProxyMixin'> not in (<class 'autopilot.tests.functional.test_introspection_features.EmulatorBase'>, <class 'autopilot.introspection._search.ApplicationProxyObject'>)
<veebers> thomi: yeah for me too (and for the CI run) :-\
<thomi> which is interesting - it passed when we landed that code
<veebers> I don't see it fail in this run: https://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic-autopilot/348/? (syntax error on my part), but the next CI run it failed: https://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic-autopilot/349/?
<thomi> interesting
<balloons> elopio, you about?
<elopio> balloons: I am.
<elopio> how can I help you?
<balloons> :-) so I'm looking at home patching and launching again, in an attempt to finish fixing https://bugs.launchpad.net/ubuntu-filemanager-app/+bug/1367453
<ubot5> Ubuntu bug 1367453 in Ubuntu Terminal App "Security dialog causes tests to fail" [Critical,Triaged]
<balloons> so to that end, I just completed a merge of what andrew did to get music to work
<balloons> so I haven't really gut checked this much, but here: https://code.launchpad.net/~nskaggs/ubuntu-filemanager-app/fix-1367453/+merge/236628
<balloons> elopio, ^^
<elopio> balloons: what I don't like of this is that it is untested.
<elopio> if it works, I'm ok with getting it merged.
<elopio> but we need a way to make sure that it won't break again.
<elopio> balloons: I'm thinking of something on ubuntu-app-launch that launches the app on a temporary clean environment.
<elopio> but many of the details of that are unclear yet for me. We need tedg for that.
<balloons>  elopio well, what 'works' and what we want to do aren't necessarily the same. But music app trunk now has the lovely directly overwriting of the os env vars. that's how he got it to work
<balloons> elopio, your idea sounds nice
<elopio> balloons: yes, if this makes the file manager get back to green, +1.
<elopio> I'm reporting the bugs for the things I mentioned on my testability email to the qa-team.
<elopio> I'll talk to ted tomorrow to see if he agrees this is a good idea or if he has an alternative.
<elopio> please reply to that email if you have anything to add.
<balloons> elopio, he spoke with andrew about it for a long time
<balloons> if I remember correctly, he felt like not setting the actual env vars was asking for trouble
<elopio> balloons: I don't care about the actual way of doing it. I guess it will involve setting the env vars.
<elopio> but what I think it's a must is for the devs to maintain it, and to have the solution tested so it doesn't break repeateatly.
<balloons> elopio, and this is beyond the uitk helpers yes?
<elopio> I think that this helper should live in the ubuntu-app-launch branch. But I'm not sure of that. I'll start putting the bug there and see where the discussion leads us.
<balloons> a system level manner of launching an app in a clean env
<elopio> balloons: yes. I wouldn't like it to be on uitk.
<elopio> there might be some arguments to put it there, but I think it must be lower level than that.
<elopio> balloons: but I see a lot of problems. It's likely that if we launch unity on one env and the apps in another, things can behave crazy.
<elopio> so the other topic of launching apps without unity running seems related.
<elopio> I was going to set a call for this week as suggested by thomi, but then jfunk told me to file the bugs first, which makes sense.
<elopio> I will send an email with the bugs to that thread, as soon as I have them.
<balloons> elopio, I agree.. something should exist at the ubuntu-app-launch level. It's possible we have a helper in uitk that bootstraps nicely into this (and autopilot too, let's not forget!), but the heavy lifting should be in ubuntu-app-launch.
<balloons> come to think of it, heh, if anything I'd rather see minimal scaffolding in autopilot itself. I was ranting already about how the AP app launchers are sort of deprecated because of this (ie, they exist and 'work', but you shouldn't use them)
<thomi> balloons: huh?
<balloons> hey thomi .. need to watch your pycon video, sounds quite interesting
<veebers> balloons: why shouldn't you use the ap launchers? Have I missed soemthing?
 * balloons should have known better than to say this on the ap channel
<thomi> balloons: I think it's more the case that you perhaps should have said it sooner
<thomi> if there's a problem, we need to know about it
 * thomi can't remember how many times he's written that in this channel
<balloons> Of course, I'm always keen to discuss things.. It's why we are talking about it ;-)
<thomi> well... we're not 'discussing' it at the moment. You mention something,a nd veebers and I are really confused :P
<balloons> anyways, as elopio mentioned application launching for things under test on the phablet devices have gotten quite muddled
<balloons> this is a recent thing, although there have been smaller testability issues for awhile
<balloons> my concern is we are doing a number of things to get our desired outcome (launch the app, pass it arguments, introspect it, have it start in a custom env (clean or setup by us))
<balloons> autopilot has launchers for applications that I think should be handling this sort of thing. We really shouldn't be needed to bolt on so many things
<thomi> ok, what things, specifically, are you having to 'bolt on' ?
<balloons> So I'm concerned launch_upstart_application and launch_click_application aren't going to be best practice as-is
<thomi> why?
<balloons> thomi, elopio is working on expounding things in a grokable manner per above, but see the list in parentheses. Perhaps you looking at an example might also help
 * thomi looks for a list in parenthesis
<balloons> basically right now I am unable to easily create a clean env or pass arguments to my app
<elopio> thomi, veebers: this is all related to the discussion I started on the mailing lists: we are doing all sorts of weird things to get a clean environment and use a test doubles for services.
<balloons> I was referring to (launch the app, pass it arguments, introspect it, have it start in a custom env (clean or setup by us))
<thomi> ahh
<thomi> so, we do all those things except the env right now, AFAIK
<elopio> balloons and I have been discussing it a lot over the previous months, and now I think it's clear the solution is not something that the two of us can implement on a test setup.
<balloons> thomi, for a long time the env was the only issue, but now argument passing is non-trivial
<balloons> and it's getting more muddled rather than clearer
<thomi> so
<thomi> this is frustrating for me
<thomi> for a few reasons
<balloons> this isn't to say autopilot itself isn't doing enough.. But I think the underlying platform is migrating away and not considering testability.. basically elopio's mail
<thomi> first, this has been happening for a few months, by your admission, but this is the first I'm hearing of it.
<thomi> Second, you keep making vague statements like 'getting more muddled' - I really don't know what that means
<thomi> AFAIK, we support argument passing for upstart apps
<thomi> what, exactly is missing?
<elopio> thomi: that's the clearest example, passing arguments.
<balloons> thomi, here's an example from the file manager that triggered this: http://paste.ubuntu.com/8468882/
<balloons> check out the launch_test_click() method
<elopio> we can't pass an argument to an app launched by ubuntu-app-launch, because it ignores the arguments and just runs the exec line of the desktop file.
 * thomi reads
<balloons> and consider why on earth we need to go through so much pain and code to setup an app to test
<elopio> so we need to do a temp desktop file for the test. I hacked a way to do it and it works for evernote. Now we can copy it all over the place, or instead do it right and put a helper that handles this case on the relevant project.
<balloons> _patch_home is also fun to read :-)
<elopio> thomi: this has been happening for a long time, but not because we are ignoring it.
<elopio> it started as just a nice and clean temporary overwrite of $HOME
<balloons> the argument issue is recent.. it happened this month
<elopio> then they kept adding things that kept breaking the clean solution.
<balloons> it's what caused elopio and I to renew our conversations about this, as indeed things keep being broken
<elopio> so every time they break it, we make the adjustments.
<balloons> we had the env issues sorted with a helper
<elopio> now it's up to a point that's not manageable. We have been saying for a long time that tests break because devs don't plan for testability.
<thomi> ok, so in launch_test_click I don't see any issue with argument pasing. It seems to me that all this work is due to trying to set a clean environment for the app to run in - is that correct?
<veebers> I remember seeing an email about ubuntu-app-launch not passing arguments, but not the result of it
<elopio> it's just now that it became critical.
<elopio> thomi: so, launch_test_click passes arguments to ubuntu-app-launch
<balloons> thomi, the point is launch_test_click should just be self.launch_upstart_application(
<balloons>             application_name,
<balloons>             emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase) right? but you can see the amount of hackery that is needed to make it happen
<elopio> and ubuntu-app-launch ignores it, as per design.
<balloons> I mean launching locally or via an installed binary (not on the phone) you can see is simple
<veebers> balloons: is "--forceAuth false" needed for all applications or just the file manager?
<thomi> so... the complaint is that it takes a lot of code to launch the app in a sandbox, and you need to repeat that code across multiple applications?
<balloons> veebers, that's actually needed for file manager and terminal. but other apps need other arguments
<veebers> It seems that the inability to pass arguments is due to ubuntu-app-launch, not autopilot right?
<balloons> thomi, yes. And once completed, it breaks as the system beneath changes.
<veebers> if ubuntu-app-launch did what we expected with arguments then launch_click would do what is needed
<balloons> thomi, from an AP perspective, I feel like what's happening at the platform level should incoporate better testability that autopilot can hook into
<thomi> balloons: I agree!
<elopio> veebers: yes, it's not autopilot's fault that ual ignores arguments.
<veebers> balloons: I agree too (I think we can all agree with that)
<balloons> thomi, I'm sure.. That was all I was getting at. I simply don't want you to be left behind in this either
<balloons> "you" as in autopilot
<thomi> Can someone point me to the ML thread where id's discussed that libUAL ignored arguments by design?
<elopio> the problem is that it's also not ual's fault, because it should just pay attention to the desktop file.
<thomi> elopio: sez who?
<thomi> elopio: that seems like a silly idea to me
<thomi> elopio: not being able to launch an app with a command line parameter seems like a bad move
<elopio> thomi: the devs. This is not a discussion on the ML, this is a bug report.
<elopio> let me look for it.
<elopio> thomi: that's what I thought at first.
<elopio> what I think now is that the passing of arguments or not is not the problem.
<elopio> the problem is that the devs were not thinking of the automation needs.
<balloons> right ^^ it's a symptom of a growing issue
<elopio> I don't care if the solution is to pass an argument, or create a temporary desktop file.
<elopio> as long as it's a simple call I can do from anywhere, and it
<elopio> it
<elopio> it's safe to use always because they keep it up-to-date, I'm happy.
<balloons> we've had this time and again.. reminders went through it with the account console stuff, clock and calendar suffer via EDS, and now we have PAM, which again has no testability in mind
<elopio> thomi, veebers: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1367871
<ubot5> Ubuntu bug 1367871 in Ubuntu UI Toolkit "ubuntu-app-launch doesn't pass arguments to the executable" [Undecided,New]
<balloons> the reason we are passing the arg is because we can't actually test PAM properly
<balloons> so we are just disabling it via a switch and running the tests the old way.
<balloons> but I digress
<thomi> hmmm
<thomi> ok, I've read the bug
<thomi> balloons: elopio: so, if the write_sandbox_desktop_file were a reusable fixture that lived in autopilot, would you be happy?
<thomi> (to fix this specific issue)
<balloons> so to be clear, nothing I'm spouting on about is a bug whose source is in autopilot. It's merely things that affect test authors and by extension autopilot
<elopio> thomi: no. The devs convinced me that for that particular case, we need a second app that's called evernote-sandbox.
<thomi> balloons: I understand, I'm talking with my 'QA tech lead' hat on
<elopio> for other cases, yes. A helper that rewrites the desktop file of the app to add extra parameters to the exec line would make me happy.
<balloons> thomi, on that specific issue, if write_sandbox_desktop_file is the 'official' way to do it, then yes. But my expectation as a test author is that you would hide that complexity from me unless needed
<balloons> so if later the platform decided to pass arguments directly again, my code doesn't change and my tests don't break
<balloons> do you feel architecturally that this abstraction should be in autopilot?
<elopio> thomi: but then you are linking that to all the rest of the problems
<thomi> balloons: well, we already have that code in AP, just not in the public API
<elopio> where will that desktop file live? In /tmp?
<elopio> then you hit problems with unity, ual and app armor.
<thomi> I don't recall the specifics, sorry
<balloons> ahh yes, lovely app armor..
<elopio> thus, the subject of the thread.
<balloons> that was a ton of fun in malta
<balloons> until they broke it :-)
<thomi> so, I think we're going in circles here
<elopio> thomi: we are. That's why I listed the main problems balloons and I have had, and I am going to report bugs for them
<elopio> and then schedule a meeting. And then plan who and how to fix them.
<thomi> elopio: right. please make sure I'm included
<balloons> elopio, I need to get the security issues in there too. I don't believe those are well represented atm
<thomi> elopio: and please do it before the sprint
<elopio> I expect the answer to "who?" would be: "not the QA team".
<elopio> balloons: yes, please reply to the mail. I think I didn't take into account the terminal and filemanager cases explicitly.
<elopio> thomi: and of course you will be invited to the party. As I said, I haven't scheduled the meeting yet because I need to collect and report bugs.
#ubuntu-autopilot 2014-10-02
<rpadovani> elopio, ping
<elopio> rpadovani: pong.
<rpadovani> elopio, about this MR, do you want I revert your changes or something else? I'm not sure on how manage it
<rpadovani> https://code.launchpad.net/~rpadovani/ubuntu-calculator-app/1365564/+merge/233400
<elopio> rpadovani: yes. Now the two methods in the Screen class called swipe_to_delete and _drag_pointing_device_to_delete should no longer be needed.
<elopio> it would be great if you remove them as part of your MP.
<rpadovani> elopio, gotcha, thanks
