All users were logged out of Bugzilla on October 13th, 2018

Update packaging for automation scripts

RESOLVED FIXED

Status

RESOLVED FIXED
9 years ago
4 years ago

People

(Reporter: whimboo, Assigned: whimboo)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
Right now we are using a really messy method to load necessary modules from a sub folder which is not in the system path. As Jeff mentioned I will have to look at http://k0s.org/portfolio/packaging.html

Comment 1

9 years ago
For e.g. http://github.com/whimboo/mozmill/blob/firefox-automation/scripts/firefox-automation/testrun_bft.py this should be easy.  Instead of doing

{{{
base_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(base_path, 'libs'))

from testrun import BftTestRun
}}}

Add a __init__.py file to the 'libs' subdirectory (it can be an empty file, as long as it's there), then just make it `from libs.testrun import BftTestRun`.

I'm not sure why things are organized the way they are (e.g., libs seems counter-intuitive to me), but I haven't had a chance to really study this code, but that's another issue
(Assignee)

Comment 2

9 years ago
(In reply to comment #1)
> Add a __init__.py file to the 'libs' subdirectory (it can be an empty file, as
> long as it's there), then just make it `from libs.testrun import BftTestRun`.

Lets see if that works.

> I'm not sure why things are organized the way they are (e.g., libs seems
> counter-intuitive to me), but I haven't had a chance to really study this code,
> but that's another issue

Shall I call it testrun? The reason is that I do not want to clutter the root where all the scripts are located you can execute.
(Assignee)

Updated

8 years ago
Component: Mozmill → Mozmill Tests
QA Contact: mozmill → mozmilltests
Summary: [mozmill] Update packaging for automation scripts → Update packaging for automation scripts
(Assignee)

Comment 3

8 years ago
Move of Mozmill related project bugs to newly created components. You can
filter out those emails by using "Mozmill-Tests-to-MozillaQA" as criteria.
Component: Mozmill Tests → Mozmill Automation
Product: Testing → Mozilla QA
QA Contact: mozmill-tests → mozmill-automation
Whiteboard: [mozmill-automation]
Version: Trunk → unspecified
(Assignee)

Comment 4

8 years ago
Created attachment 506786 [details] [diff] [review]
Patch v1

Simply fix to correctly use the packaging method of Python.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #506786 - Flags: review?(jhammel)

Updated

8 years ago
Attachment #506786 - Flags: review?(jhammel) → review+
(Assignee)

Comment 5

8 years ago
Landed as:
http://hg.mozilla.org/qa/mozmill-automation/rev/c5c83155c14b
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.