Needs for a callback handler in between restart tests

VERIFIED FIXED

Status

defect
--
major
VERIFIED FIXED
10 years ago
3 years ago

People

(Reporter: whimboo, Assigned: mikeal)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [verified-mozmill-1.2.7][mozmill-doc-needed])

Attachments

(1 attachment)

Right now I work on my software update tests and for the fallback case I would have to modify some files on the system in between the tests to make the downloaded update invalid. Sadly there is no way to inject code in my CLI instance which gets called in between restarts. It would be nice to have such a way. I believe one parameter should be enough and which should tell the script the index of the last ran test.

This request is similar to bug 513881.
Blocks: 504653
Severity: normal → major
So, this is what I can do.

I can add an API where one single Python file in the restart test directory can have a bunch of named functions.

A javascript function will be available inside your restart test that you can call with the function name. After that browser is killed, before the next one is started or the test moves on, the python function will be called with the JSON object you sent in javascript.

-Mikeal
The problem is that in some situations we have to execute code from the command line like a Python script and cannot do that from Firefox itself, e.g. while files are still in use. Given that requirement comment 1 would not be helpful for me.

Is it really so complicated to register a callback handler before running the test and calling this function with the persisted object as parameter?
So you want the Python callback to be fired right when you call this handler in JavaScript?

We can do that as well. The only caveat is that you won't be able to get information from Python back in to JavaScript.
No. I want to have this handler called when Firefox has been closed. There is nothing with Javascript involved. Just a Python thing.
Blocks: 525060
Mikeal, isn't that fixed already? I cannot find any checkin in your master.
Assignee: nobody → mrogers
Status: NEW → ASSIGNED
Yeah, this is fixed. There isn't one checkin in particular, the work was done in a branch and then merged last week to my master.

http://github.com/mikeal/mozmill
Marking as fixed. Will test it tomorrow.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-1.2.7]
Mikeal, is there a way to throw any failure from within the Python callback?
yup, just throw an exception. That's how you are suppose to trigger test failures :)
Ok, I have tested the current implementation and I don't see a way how to pass values from the mozmill test to the Python callback function. We really have to pass the persisted object to the callback so you can exchange data. Otherwise the callbacks aren't much helpful. Mikeal, would this be an easy fix?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Mikeal, I would expect those tests to be working. It looks like we still don't pass the correct values back and forward.
As given by Mikeal on IRC we aren't able to pass values back to the Mozmill test because Python callbacks are run asynchronously and the test doesn't wait until it has been finished. We will call this bug the base implementation. Further improvements have to be filed in follow-up bugs.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Whiteboard: [mozmill-1.2.7] → [verified-mozmill-1.2.7]
Whiteboard: [verified-mozmill-1.2.7] → [mozmill-1.2.7][mozmill-doc-needed]
Whiteboard: [mozmill-1.2.7][mozmill-doc-needed] → [verified-mozmill-1.2.7][mozmill-doc-needed]
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.