maildev@lists.thunderbird.net

Thunderbird email developers

View all threads

sharing test code between xpcshell and mozmill

KE
Kai Engert
Fri, Sep 20, 2019 9:56 PM

I'm adding a new mozmill test.

I'd like to reuse test code that already exists, and is used by
xpcshell-test: mailnews/test/resources/smimeUtils.jsm

In the new mozmill test, I tried to include it:

var { SmimeUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/smimeUtils.jsm"
);

That works with a local build!

However, if running in taskcluster, I get a "file not found" error.

Do you have any suggest how I could share the code in smimeUtils between
xpcshell and mozmill?

(I don't want to make it a regular jsm outside of tests.)

Thanks
Kai

I'm adding a new mozmill test. I'd like to reuse test code that already exists, and is used by xpcshell-test: mailnews/test/resources/smimeUtils.jsm In the new mozmill test, I tried to include it: var { SmimeUtils } = ChromeUtils.import( "resource://testing-common/mailnews/smimeUtils.jsm" ); That works with a local build! However, if running in taskcluster, I get a "file not found" error. Do you have any suggest how I could share the code in smimeUtils between xpcshell and mozmill? (I don't want to make it a regular jsm outside of tests.) Thanks Kai
KE
Kai Engert
Fri, Sep 20, 2019 10:14 PM

On 20.09.19 23:56, Kai Engert wrote:

Do you have any suggestion how I could share the code in smimeUtils
between xpcshell and mozmill?

After having posted my question, I discovered that mozmill already uses
some other files from mailnews/test/resources, adds them to a definition
in mozmill/moz.build, and calls a function "load_via_src_path" with the
desired filenames.

I'll check if I can duplicate that for the file I need.

Kai

On 20.09.19 23:56, Kai Engert wrote: > Do you have any suggestion how I could share the code in smimeUtils > between xpcshell and mozmill? After having posted my question, I discovered that mozmill already uses some other files from mailnews/test/resources, adds them to a definition in mozmill/moz.build, and calls a function "load_via_src_path" with the desired filenames. I'll check if I can duplicate that for the file I need. Kai
GL
Geoff Lankow
Sat, Sep 21, 2019 12:38 AM

This is bug 1582055
https://bugzilla.mozilla.org/show_bug.cgi?id=1582055. I discovered the
same thing this week.

GL

On 21/09/2019 09:56, Kai Engert wrote:

I'm adding a new mozmill test.

I'd like to reuse test code that already exists, and is used by
xpcshell-test: mailnews/test/resources/smimeUtils.jsm

In the new mozmill test, I tried to include it:

var { SmimeUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/smimeUtils.jsm"
);

That works with a local build!

However, if running in taskcluster, I get a "file not found" error.

Do you have any suggest how I could share the code in smimeUtils between
xpcshell and mozmill?

(I don't want to make it a regular jsm outside of tests.)

Thanks
Kai


Maildev mailing list
Maildev@lists.thunderbird.net
http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net

This is bug 1582055 <https://bugzilla.mozilla.org/show_bug.cgi?id=1582055>. I discovered the same thing this week. GL On 21/09/2019 09:56, Kai Engert wrote: > I'm adding a new mozmill test. > > I'd like to reuse test code that already exists, and is used by > xpcshell-test: mailnews/test/resources/smimeUtils.jsm > > In the new mozmill test, I tried to include it: > > var { SmimeUtils } = ChromeUtils.import( > "resource://testing-common/mailnews/smimeUtils.jsm" > ); > > That works with a local build! > > However, if running in taskcluster, I get a "file not found" error. > > Do you have any suggest how I could share the code in smimeUtils between > xpcshell and mozmill? > > (I don't want to make it a regular jsm outside of tests.) > > Thanks > Kai > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net
KE
Kai Engert
Sun, Sep 22, 2019 10:43 PM

On 21.09.19 02:38, Geoff Lankow wrote:

This is bug 1582055
https://bugzilla.mozilla.org/show_bug.cgi?id=1582055. I discovered the
same thing this week.

Thanks Geoff. The fix for bug 1582055 helps me (but I also need to use
load_via_src_path like in
mozilla/shared-modules/test-folder-display-helpers.sh).

Kai

On 21.09.19 02:38, Geoff Lankow wrote: > This is bug 1582055 > <https://bugzilla.mozilla.org/show_bug.cgi?id=1582055>. I discovered the > same thing this week. Thanks Geoff. The fix for bug 1582055 helps me (but I also need to use load_via_src_path like in mozilla/shared-modules/test-folder-display-helpers.sh). Kai