Пример #1
0
 def testGetRecent(self):
     with app.test_request_context():
         got = [
             r.name for r in FennecRelease.getRecent(age=timedelta(days=1))
         ]
         # These two fennec build don't have any date.
         # Ship-it will consider today's date
         self.assertEquals(['Fennec-1-build1', 'Fennec-4-build4'], got)
Пример #2
0
 def testGetRecentShipped(self):
     with app.test_request_context():
         with mock.patch('kickoff.model.datetime') as mock_datetime:
             mock_datetime.now.return_value = datetime(2015, 3, 1)
             got = [
                 r.name for r in FennecRelease.getRecentShipped(
                     age=timedelta(days=2))
             ]
             self.assertEquals(
                 ['Fennec-23.0b2-build4', 'Fennec-24.0-build4'], got)
Пример #3
0
    def testGetEditableFennecRelease(self):
        with app.test_request_context():
            release = FennecRelease(submitter='moz://a',
                                    version='0',
                                    buildNumber=1,
                                    mozillaRelbranch='',
                                    branch='releases/mozilla-beta',
                                    mozillaRevision='abcdef123456',
                                    l10nChangesets='ach 72c548f97e82')
            db.session.add(release)
            db.session.commit()

            ret = self.get('/release.html', query_string={'name': 'Fennec-0-build1'})
            self.assertEqual(ret.status_code, 200)
Пример #4
0
    def setUp(self):
        self.cef_fd, self.cef_file = mkstemp()
        app.config['DEBUG'] = True
        app.config['CSRF_ENABLED'] = False
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
        app.config.update(cef_config(self.cef_file))
        with app.test_request_context():
            db.init_app(app)
            db.create_all()
            r = FennecRelease(
                submitter='joe',
                version='1',
                buildNumber=1,
                branch='a',
                mozillaRevision='abc',
                l10nChangesets='{"hi": { "revision": "fe436c75f71d" }}',
                mozillaRelbranch=None)
            r.ready = True
            db.session.add(r)

            r = FennecRelease(
                submitter='joe',
                version='4',
                buildNumber=4,
                branch='a',
                mozillaRevision='abc',
                l10nChangesets='{"fr": { "revision": "fe436c75f71d" }}',
                mozillaRelbranch=None)
            db.session.add(r)

            r = FennecRelease(
                submitter='joe',
                version='4',
                buildNumber=5,
                branch='a',
                mozillaRevision='abc',
                l10nChangesets=
                '{"de": { "revision": "fe436c75f71d", "platforms": ["android", "android-multilocale"]  }}',
                mozillaRelbranch='BAR',
                submittedAt=datetime(2005, 1, 2, 2, 3, 3, 5))
            db.session.add(r)

            r = FirefoxRelease(partials='0,1',
                               promptWaitTime=5,
                               submitter='joe',
                               version='2.0',
                               buildNumber=1,
                               branch='a',
                               mozillaRevision='def',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 4, 3, 4, 5, 6),
                               comment="yet an other amazing comment",
                               mh_changeset='xyz')
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1',
                               promptWaitTime=5,
                               submitter='joe',
                               version='2.0.2esr',
                               buildNumber=1,
                               branch='a',
                               mozillaRevision='def',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 4, 3, 4, 5, 6),
                               comment="yet an other amazing comment")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1',
                               promptWaitTime=5,
                               submitter='joe',
                               version='38.1.0esr',
                               buildNumber=1,
                               branch='a',
                               mozillaRevision='def',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2015, 1, 4, 3, 4, 5, 6),
                               comment="yet an other amazing comment")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FennecRelease(
                submitter='joe',
                version='24.0',
                buildNumber=4,
                branch='a',
                mozillaRevision='abc',
                l10nChangesets='{"an": { "revision": "fe436c75f71d" }}',
                submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                shippedAt=datetime(2015, 3, 1, 3, 4, 5, 6),
                mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FennecRelease(
                submitter='joe',
                version='24.0.1',
                buildNumber=4,
                branch='a',
                mozillaRevision='abc',
                l10nChangesets='{"an": { "revision": "fe436c75f71d" }}',
                submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                shippedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FennecRelease(
                submitter='joe',
                version='23.0b2',
                buildNumber=4,
                branch='a',
                mozillaRevision='abc',
                l10nChangesets='{"an": { "revision": "fe436c75f71d" }}',
                submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                shippedAt=datetime(2015, 2, 27, 3, 4, 5, 6),
                mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(
                partials='0,1',
                promptWaitTime=5,
                submitter='joe',
                version='3.0b2',
                buildNumber=1,
                branch='a',
                mozillaRevision='def',
                l10nChangesets='ja zu',
                mozillaRelbranch='FOO',
                submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                comment="yet an other amazing comment",
                isSecurityDriven=True,
                description="We did this because of an issue in NSS")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1',
                               promptWaitTime=5,
                               submitter='joe',
                               version='3.0b2',
                               buildNumber=2,
                               branch='a',
                               mozillaRevision='defa',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="yet an other amazing comment")
            db.session.add(r)

            r = FirefoxRelease(
                partials='0,1',
                promptWaitTime=5,
                submitter='joe',
                version='3.0b3',
                buildNumber=1,
                branch='a',
                mozillaRevision='defau',
                l10nChangesets='ja zu',
                mozillaRelbranch='FOO',
                submittedAt=datetime(2005, 2, 3, 4, 5, 6, 7),
                shippedAt=datetime(2005, 2, 3, 4, 5, 6, 7),
                comment="yet an other amazing comment",
                isSecurityDriven=True,
                description="Another beta release for Firefox 3")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(
                partials='0,1',
                promptWaitTime=5,
                submitter='joe',
                version='3.0.1',
                buildNumber=1,
                branch='a',
                mozillaRevision='def',
                l10nChangesets='ja zu',
                mozillaRelbranch='FOO',
                submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                comment="yet an other amazing comment",
                description="we did this release because of foo")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            # Thunderbird data
            r = ThunderbirdRelease(
                commRevision='ghi',
                commRelbranch=None,
                partials='0',
                promptWaitTime=None,
                submitter='bob',
                version='2',
                buildNumber=2,
                branch='b',
                mozillaRevision='ghi',
                l10nChangesets='li',
                mozillaRelbranch=None,
                submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                shippedAt=datetime(2005, 1, 3, 1, 1, 1, 1),
                comment='My great comment!',
                isSecurityDriven=True,
                mh_changeset='xyz',
                description="we did this release because of bar")
            r.complete = True
            r.ready = True
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz',
                                   commRelbranch=None,
                                   partials='1.0build1',
                                   promptWaitTime=None,
                                   submitter='bob',
                                   version='4.0',
                                   buildNumber=1,
                                   branch='b',
                                   mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(
                                       2005, 1, 1, 1, 1, 1, 1),
                                   description="foo reason")
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz',
                                   commRelbranch=None,
                                   partials='1.0build1',
                                   promptWaitTime=None,
                                   submitter='bob',
                                   version='23.0',
                                   buildNumber=1,
                                   branch='b',
                                   mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(
                                       2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 1, 3, 1, 1, 1, 1),
                                   description="bar reason")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz',
                                   commRelbranch=None,
                                   partials='1.0build1',
                                   promptWaitTime=None,
                                   submitter='bob',
                                   version='23.0.1',
                                   buildNumber=1,
                                   branch='b',
                                   mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(
                                       2014, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2014, 2, 3, 1, 1, 1, 1),
                                   description="bar2 reason")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz',
                                   commRelbranch=None,
                                   partials='1.0build1',
                                   promptWaitTime=None,
                                   submitter='bob',
                                   version='24.0b2',
                                   buildNumber=2,
                                   branch='b',
                                   mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(
                                       2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 2, 1, 1, 1, 1, 1),
                                   description="bar2 reason")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            db.session.commit()
Пример #5
0
 def testGetRecent(self):
     with app.test_request_context():
         got = [r.name for r in FennecRelease.getRecent(age=timedelta(days=1))]
         # These two fennec build don't have any date.
         # Ship-it will consider today's date
         self.assertEquals(['Fennec-1-build1', 'Fennec-4-build4'], got)
Пример #6
0
 def setUp(self):
     self.cef_fd, self.cef_file = mkstemp()
     app.config['DEBUG'] = True
     app.config['CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
     app.config.update(cef_config(self.cef_file))
     with app.test_request_context():
         db.init_app(app)
         db.create_all()
         r = FennecRelease(submitter='joe',
                           version='1',
                           buildNumber=1,
                           branch='a',
                           mozillaRevision='abc',
                           l10nChangesets='af de',
                           dashboardCheck=True,
                           mozillaRelbranch=None)
         r.ready = True
         db.session.add(r)
         r = FennecRelease(submitter='joe',
                           version='4',
                           buildNumber=4,
                           branch='a',
                           mozillaRevision='abc',
                           l10nChangesets='gh ij',
                           dashboardCheck=True,
                           mozillaRelbranch=None)
         db.session.add(r)
         r = FennecRelease(submitter='joe',
                           version='4',
                           buildNumber=5,
                           branch='a',
                           mozillaRevision='abc',
                           l10nChangesets='lk mn',
                           dashboardCheck=False,
                           mozillaRelbranch='BAR',
                           submittedAt=datetime(2005, 1, 2, 2, 3, 3, 5))
         db.session.add(r)
         r = FirefoxRelease(partials='0,1',
                            promptWaitTime=5,
                            submitter='joe',
                            version='2',
                            buildNumber=1,
                            branch='a',
                            mozillaRevision='def',
                            l10nChangesets='ja zu',
                            dashboardCheck=True,
                            mozillaRelbranch='FOO',
                            submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                            comment="yet an other amazying comment",
                            enUSPlatforms=None)
         r.complete = True
         r.ready = True
         db.session.add(r)
         r = ThunderbirdRelease(commRevision='ghi',
                                commRelbranch=None,
                                partials='0',
                                promptWaitTime=None,
                                submitter='bob',
                                version='2',
                                buildNumber=2,
                                branch='b',
                                mozillaRevision='ghi',
                                l10nChangesets='li',
                                dashboardCheck=True,
                                mozillaRelbranch=None,
                                submittedAt=datetime(
                                    2005, 1, 1, 1, 1, 1, 1),
                                comment='My great comment!',
                                enUSPlatforms="foo bar")
         r.complete = True
         r.ready = True
         db.session.add(r)
         r = ThunderbirdRelease(commRevision='zzz',
                                commRelbranch=None,
                                partials='1.0build1',
                                promptWaitTime=None,
                                submitter='bob',
                                version='4.0',
                                buildNumber=1,
                                branch='b',
                                mozillaRevision='yyy',
                                l10nChangesets='yy zz',
                                dashboardCheck=True,
                                mozillaRelbranch=None,
                                submittedAt=datetime(
                                    2005, 1, 1, 1, 1, 1, 1))
         db.session.add(r)
         db.session.commit()
Пример #7
0
    def setUp(self):
        self.cef_fd, self.cef_file = mkstemp()
        app.config['DEBUG'] = True
        app.config['CSRF_ENABLED'] = False
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
        app.config.update(cef_config(self.cef_file))
        with app.test_request_context():
            db.init_app(app)
            db.create_all()
            r = FennecRelease(submitter='joe', version='1.0', buildNumber=1,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='{"hi": { "revision": "fe436c75f71d" }}',
                              mozillaRelbranch=None)
            r.ready = True
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='4.0', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='{"fr": { "revision": "fe436c75f71d" }}',
                              mozillaRelbranch=None)
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='4.0', buildNumber=5,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='{"de": { "revision": "fe436c75f71d", "platforms": ["android", "android-multilocale"]  }}',
                              mozillaRelbranch='BAR',
                              submittedAt=datetime(2005, 1, 2, 2, 3, 3, 5))
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='2.0', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 4, 3, 4, 5, 6),
                               comment="yet an other amazing comment",
                               mh_changeset='xyz')
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            three_digit_esr_release = FirefoxRelease(
                partials='0,1', promptWaitTime=5,
                submitter='joe', version='2.0.2esr', buildNumber=1,
                branch='a', mozillaRevision='def',
                l10nChangesets='ja zu',
                mozillaRelbranch='FOO',
                submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                shippedAt=datetime(2005, 1, 4, 3, 4, 5, 6),
                comment="yet an other amazing comment"
            )
            three_digit_esr_release.complete = True
            three_digit_esr_release.ready = True
            three_digit_esr_release.status = "shipped"
            db.session.add(three_digit_esr_release)

            two_digit_esr_release = FirefoxRelease(
                partials='0,1', promptWaitTime=5,
                submitter='joe', version='38.0esr', buildNumber=1,
                branch='a', mozillaRevision='def',
                l10nChangesets='ja zu',
                mozillaRelbranch='FOO',
                submittedAt=datetime(2015, 1, 2, 3, 4, 5, 6),
                shippedAt=datetime(2015, 1, 4, 3, 4, 5, 6),
                comment="yet an other amazing comment"
            )
            two_digit_esr_release.complete = True
            two_digit_esr_release.ready = True
            two_digit_esr_release.status = "shipped"
            db.session.add(two_digit_esr_release)

            r = FennecRelease(submitter='joe', version='24.0', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='{"an": { "revision": "fe436c75f71d" }}',
                              submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              shippedAt=datetime(2015, 3, 1, 3, 4, 5, 6),
                              mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='24.0.1', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='{"an": { "revision": "fe436c75f71d" }}',
                              submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              shippedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='23.0b2', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='{"an": { "revision": "fe436c75f71d" }}',
                              submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              shippedAt=datetime(2015, 2, 27, 3, 4, 5, 6),
                              mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='1.0.9', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='legacy',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="yet an other amazing comment",
                               description="we did this release because of foo")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0b1', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="Rule with release_eta",
                               description="Rule with release_eta",
                               release_eta=datetime(2005, 1, 2, 3, 4, 5, 7))
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)


            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0b2', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="yet an other amazing comment",
                               isSecurityDriven=True,
                               description="We did this because of an issue in NSS")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0b2', buildNumber=2,
                               branch='a', mozillaRevision='defa',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="yet an other amazing comment",
                               release_eta=datetime(2005, 1, 2, 3, 4, 5, 7))
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0b3', buildNumber=1,
                               branch='a', mozillaRevision='defau',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 2, 3, 4, 5, 6, 7),
                               shippedAt=datetime(2005, 2, 3, 4, 5, 6, 7),
                               comment="yet an other amazing comment",
                               isSecurityDriven=True,
                               description="Another beta release for Firefox 3")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0.1', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu',
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="yet an other amazing comment",
                               description="we did this release because of foo")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = DeveditionRelease(
                partials='0,1', promptWaitTime=5, submitter='joe',
                version='3.0b5', buildNumber=1, branch='a',
                mozillaRevision='def', l10nChangesets='ja zu',
                mozillaRelbranch='FOO',
                submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                comment="yet an other amazing comment",
                description="we did this release because of foo")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            # Thunderbird data
            r = ThunderbirdRelease(commRevision='ghi', commRelbranch=None,
                                   partials='0', promptWaitTime=None,
                                   submitter='bob', version='2.0', buildNumber=2,
                                   branch='b', mozillaRevision='ghi',
                                   l10nChangesets='li',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 1, 3, 1, 1, 1, 1),
                                   comment='My great comment!',
                                   isSecurityDriven=True,
                                   mh_changeset='xyz',
                                   description="we did this release because of bar")
            r.complete = True
            r.ready = True
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='4.0', buildNumber=1,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   description="foo reason")
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='23.0', buildNumber=1,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 1, 3, 1, 1, 1, 1),
                                   description="bar reason")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='23.0.1', buildNumber=1,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2014, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2014, 2, 3, 1, 1, 1, 1),
                                   description="bar2 reason")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='24.0b2', buildNumber=2,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz',
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 2, 1, 1, 1, 1, 1),
                                   description="bar2 reason")
            r.complete = True
            r.ready = True
            r.status = "shipped"
            db.session.add(r)

            db.session.commit()
Пример #8
0
 def setUp(self):
     self.db_fd, self.db_file = mkstemp()
     self.cef_fd, self.cef_file = mkstemp()
     app.config['DEBUG'] = True
     app.config['CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///%s' % self.db_file
     app.config.update(cef_config(self.cef_file))
     with app.test_request_context():
         db.init_app(app)
         db.create_all()
         r = FennecRelease(submitter='joe', version='1', buildNumber=1,
                           branch='a', mozillaRevision='abc',
                           l10nChangesets='af de', dashboardCheck=True,
                           mozillaRelbranch=None)
         r.ready = True
         db.session.add(r)
         r = FennecRelease(submitter='joe', version='4', buildNumber=4,
                           branch='a', mozillaRevision='abc',
                           l10nChangesets='gh ij', dashboardCheck=True,
                           mozillaRelbranch=None)
         db.session.add(r)
         r = FennecRelease(submitter='joe', version='4', buildNumber=5,
                           branch='a', mozillaRevision='abc',
                           l10nChangesets='lk mn', dashboardCheck=False,
                           mozillaRelbranch='BAR',
                           submittedAt=datetime(2005, 1, 2, 2, 3, 3, 5))
         db.session.add(r)
         r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                            submitter='joe', version='2', buildNumber=1,
                            branch='a', mozillaRevision='def',
                            l10nChangesets='ja zu', dashboardCheck=True,
                            mozillaRelbranch='FOO',
                            submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6))
         r.complete = True
         r.ready = True
         db.session.add(r)
         r = ThunderbirdRelease(commRevision='ghi', commRelbranch=None,
                                partials='0', promptWaitTime=None,
                                submitter='bob', version='2', buildNumber=2,
                                branch='b', mozillaRevision='ghi',
                                l10nChangesets='li', dashboardCheck=True,
                                mozillaRelbranch=None,
                                submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1))
         r.complete = True
         r.ready = True
         db.session.add(r)
         r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                partials='1.0build1', promptWaitTime=None,
                                submitter='bob', version='4.0', buildNumber=1,
                                branch='b', mozillaRevision='yyy',
                                l10nChangesets='yy zz', dashboardCheck=True,
                                mozillaRelbranch=None,
                                submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1))
         db.session.add(r)
         db.session.commit()
Пример #9
0
    def setUp(self):
        self.cef_fd, self.cef_file = mkstemp()
        app.config['DEBUG'] = True
        app.config['CSRF_ENABLED'] = False
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
        app.config.update(cef_config(self.cef_file))
        with app.test_request_context():
            db.init_app(app)
            db.create_all()
            r = FennecRelease(submitter='joe', version='1', buildNumber=1,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='af de', dashboardCheck=True,
                              mozillaRelbranch=None)
            r.ready = True
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='4', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='gh ij', dashboardCheck=True,
                              mozillaRelbranch=None)
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='4', buildNumber=5,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='lk mn', dashboardCheck=False,
                              mozillaRelbranch='BAR',
                              submittedAt=datetime(2005, 1, 2, 2, 3, 3, 5))
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='2.0', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu', dashboardCheck=True,
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 4, 3, 4, 5, 6),
                               comment="yet an other amazying comment",
                               enUSPlatforms=None)
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)


            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='2.0.2esr', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu', dashboardCheck=True,
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 4, 3, 4, 5, 6),
                               comment="yet an other amazying comment",
                               enUSPlatforms=None)
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='38.1.0esr', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu', dashboardCheck=True,
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2015, 1, 4, 3, 4, 5, 6),
                               comment="yet an other amazying comment",
                               enUSPlatforms=None)
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='24.0', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='gh ij', dashboardCheck=True,
                              submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              shippedAt=datetime(2015, 3, 1, 3, 4, 5, 6),
                              mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='24.0.1', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='gh ij', dashboardCheck=True,
                              submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              shippedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)

            r = FennecRelease(submitter='joe', version='23.0b2', buildNumber=4,
                              branch='a', mozillaRevision='abc',
                              l10nChangesets='gh ij', dashboardCheck=True,
                              submittedAt=datetime(2015, 2, 26, 3, 4, 5, 6),
                              shippedAt=datetime(2015, 2, 27, 3, 4, 5, 6),
                              mozillaRelbranch=None)
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0b2', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu', dashboardCheck=True,
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="yet an other amazying comment",
                               isSecurityDriven=True,
                               description="We did this because of an issue in NSS",
                               enUSPlatforms=None)
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0b2', buildNumber=2,
                               branch='a', mozillaRevision='defa',
                               l10nChangesets='ja zu', dashboardCheck=True,
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 3, 2, 3, 4, 5, 6),
                               comment="yet an other amazying comment",
                               enUSPlatforms=None)
            db.session.add(r)

            r = FirefoxRelease(partials='0,1', promptWaitTime=5,
                               submitter='joe', version='3.0.1', buildNumber=1,
                               branch='a', mozillaRevision='def',
                               l10nChangesets='ja zu', dashboardCheck=True,
                               mozillaRelbranch='FOO',
                               submittedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               shippedAt=datetime(2005, 1, 2, 3, 4, 5, 6),
                               comment="yet an other amazying comment",
                               enUSPlatforms=None,
                               description="we did this release because of foo")
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)

            # Thunderbird data
            r = ThunderbirdRelease(commRevision='ghi', commRelbranch=None,
                                   partials='0', promptWaitTime=None,
                                   submitter='bob', version='2', buildNumber=2,
                                   branch='b', mozillaRevision='ghi',
                                   l10nChangesets='li', dashboardCheck=True,
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 1, 3, 1, 1, 1, 1),
                                   comment='My great comment!',
                                   enUSPlatforms="foo bar",
                                   isSecurityDriven=True,
                                   description="we did this release because of bar")
            r.complete = True
            r.ready = True
            db.session.add(r)

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='4.0', buildNumber=1,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz', dashboardCheck=True,
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   description="foo reason")
            db.session.add(r)
            db.session.commit()

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='23.0', buildNumber=1,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz', dashboardCheck=True,
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 1, 3, 1, 1, 1, 1),
                                   description="bar reason")
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)
            db.session.commit()

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='23.0.1', buildNumber=1,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz', dashboardCheck=True,
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2014, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2014, 2, 3, 1, 1, 1, 1),
                                   description="bar2 reason")
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)
            db.session.commit()

            r = ThunderbirdRelease(commRevision='zzz', commRelbranch=None,
                                   partials='1.0build1', promptWaitTime=None,
                                   submitter='bob', version='24.0b2', buildNumber=2,
                                   branch='b', mozillaRevision='yyy',
                                   l10nChangesets='yy zz', dashboardCheck=True,
                                   mozillaRelbranch=None,
                                   submittedAt=datetime(2005, 1, 1, 1, 1, 1, 1),
                                   shippedAt=datetime(2005, 2, 1, 1, 1, 1, 1),
                                   description="bar2 reason")
            r.complete = True
            r.ready = True
            # Shipped
            r.status = "postrelease"
            db.session.add(r)
            db.session.commit()
Пример #10
0
 def testGetRecentShipped(self):
     with app.test_request_context():
         with mock.patch('kickoff.model.datetime') as mock_datetime:
             mock_datetime.now.return_value = datetime(2015, 3, 1)
             got = [r.name for r in FennecRelease.getRecentShipped(age=timedelta(days=2))]
             self.assertEquals(['Fennec-23.0b2-build4', 'Fennec-24.0-build4'], got)
Пример #11
0
 def testGetRecent(self):
     with app.test_request_context():
         got = [r.name for r in FennecRelease.getRecent(age=timedelta(days=1))]
         self.assertEquals(['Fennec-1-build1', 'Fennec-4-build4'], got)