Bug 1516843 - Copy mozmill test files to the staging directory at build-time (local development only); r=Fallen
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 01 Jan 2019 11:22:23 +1300
changeset 33238 178da49fe8c8
parent 33237 40bfc93a1dcc
child 33239 a58e59146246
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs1516843
Bug 1516843 - Copy mozmill test files to the staging directory at build-time (local development only); r=Fallen
calendar/test/mozmill/Makefile.in
calendar/test/mozmill/moz.build
calendar/test/mozmill/shared-modules/moz.build
mail/test/mozmill/Makefile.in
mail/test/mozmill/moz.build
mail/test/mozmill/shared-modules/moz.build
--- a/calendar/test/mozmill/Makefile.in
+++ b/calendar/test/mozmill/Makefile.in
@@ -22,41 +22,27 @@ else
 MOZMILLPROGRAM = $(ABS_DIST)/bin/thunderbird$(BIN_SUFFIX)
 endif
 
 check-no-solo = $(foreach solo,SOLO_TEST SOLO_FILE,$(if $($(solo)),$(error $(subst SOLOVAR,$(solo),$(1)))))
 find-solo-test = $(if $(and $(SOLO_TEST),$(SOLO_FILE)),$(error Both SOLO_TEST and SOLO_FILE are specified. You may only specify one.),$(if $(SOLO_TEST),$(SOLO_TEST),$(if $(SOLO_FILE),$(SOLO_FILE),$(error SOLO_TEST or SOLO_FILE needs to be specified.))))
 
 include $(moztopsrcdir)/config/rules.mk
 
-# Calendar uses both its own shared modules and those from Thunderbird. Since
-# the build system and mozmill is not set up to include files from two different
-# locations, we have to stuff them into the same directory. There might be
-# problems if the names are the same, but I propose we boycott those modules!
-mozmill-stage: MOZMILL_STAGE=$(MOZMILLDIR)/stage
-mozmill-stage: MOZMILL_STAGE_SHARED=$(MOZMILL_STAGE)/shared-modules
-mozmill-stage: $(MOZMILL_SHARED)
-	$(INSTALL) -D $(MOZMILL_STAGE)
-	$(INSTALL) -D $(MOZMILL_STAGE_SHARED)
-	$(INSTALL) $(addprefix $(srcdir)/,$(shell cat $(srcdir)/mozmilltests.list)) $(MOZMILL_STAGE)
-
-	$(INSTALL) $(wildcard $(commtopsrcdir)/mail/test/mozmill/shared-modules/*.js) $(MOZMILL_STAGE_SHARED)
-	$(INSTALL) $(wildcard $(srcdir)/shared-modules/*.js) $(MOZMILL_STAGE_SHARED)
-
-mozmill: mozmill-stage
+mozmill:
 	unset PYTHONHOME && cd $(MOZMILLDIR) && unset MACOSX_DEPLOYMENT_TARGET && \
 	$(MOZMILLPYTHON) runtestlist.py --list=$(srcdir)/mozmilltests.list \
 	--binary="$(MOZMILLPROGRAM)" \
 	--dir=$(abspath $(MOZMILLDIR))/stage \
 	--symbols-path=$(ABS_DIST)/crashreporter-symbols \
 	--plugins-path=$(ABS_DIST)/plugins \
 	$(MOZMILL_EXTRA)
 
 mozmill-one: solo-test = $(find-solo-test)
-mozmill-one: mozmill-stage
+mozmill-one:
 	unset PYTHONHOME && cd $(MOZMILLDIR) && unset MACOSX_DEPLOYMENT_TARGET && \
 	$(MOZMILLPYTHON) runtest.py \
 	--test=$(abspath $(MOZMILLDIR))/stage/$(solo-test) \
 	--binary="$(MOZMILLPROGRAM)" \
 	--symbols-path=$(ABS_DIST)/crashreporter-symbols \
 	--plugins-path=$(ABS_DIST)/plugins \
 	$(MOZMILL_EXTRA)
 
--- a/calendar/test/mozmill/moz.build
+++ b/calendar/test/mozmill/moz.build
@@ -1,4 +1,22 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Copies the files in this folder to a staging directory in the objdir.
+TEST_HARNESS_FILES.mozmill.stage += [
+    'cal-recurrence/*',
+    'eventDialog/*',
+    'invitations/*',
+    'recurrenceRotated/*',
+    'testAlarmDefaultValue.js',
+    'testBasicFunctionality.js',
+    'testLocalICS.js',
+    'testTimezones.js',
+    'testTodayPane.js',
+    'views/*',
+]
+
+DIRS += [
+    'shared-modules',
+]
new file mode 100644
--- /dev/null
+++ b/calendar/test/mozmill/shared-modules/moz.build
@@ -0,0 +1,13 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Copies the files in this folder to a staging directory in the objdir.
+# Files from mail/test/mozmill/shared-modules are copied into the same
+# directory to allow calendar tests to run. Due to an oddity in the
+# build system, we can't use the same wildcard twice for a destination.
+TEST_HARNESS_FILES.mozmill.stage['shared-modules'] += [
+    'test-calendar-utils.js',
+    'test-item-editing-helpers.js',
+]
--- a/mail/test/mozmill/Makefile.in
+++ b/mail/test/mozmill/Makefile.in
@@ -27,10 +27,13 @@ ifndef MOZ_AUTOMATION
 # creating a virtualenv for them.
 libs:: mozmill-virtualenv
 endif
 
 PKG_STAGE = $(DIST)/test-stage
 
 stage-package:
 	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/
+	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/fakeserver
+	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/resources
 	@(cd $(commtopsrcdir)/mail/test/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
-	@(cd $(DEPTH)/_tests/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
+	@(cd $(DEPTH)/_tests/mozmill/fakeserver && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/fakeserver && tar -xf -)
+	@(cd $(DEPTH)/_tests/mozmill/resources && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/resources && tar -xf -)
--- a/mail/test/mozmill/moz.build
+++ b/mail/test/mozmill/moz.build
@@ -42,8 +42,12 @@ TEST_HARNESS_FILES.mozmill.fakeserver +=
 TEST_HARNESS_FILES.mozmill.resources += mailnews_files([
     'test/resources/asyncTestUtils.js',
     'test/resources/folderEventLogHelper.js',
     'test/resources/logHelper.js',
     'test/resources/messageGenerator.js',
     'test/resources/messageInjection.js',
     'test/resources/messageModifier.js',
 ])
+
+DIRS += [
+    'shared-modules',
+]
new file mode 100644
--- /dev/null
+++ b/mail/test/mozmill/shared-modules/moz.build
@@ -0,0 +1,11 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Copies the files in this folder to a staging directory in the objdir.
+# The calendar mozmill test files are run from there and use some files
+# from this folder.
+TEST_HARNESS_FILES.mozmill.stage['shared-modules'] += [
+    'test*.js',
+]