⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 294893 in webkit


Ignore:
Timestamp:
May 26, 2022, 1:18:36 PM (4 years ago)
Author:
Jonathan Bedard
Message:

[git-webkit] Support radar when auto-filing bug
​https://bugs.webkit.org/show_bug.cgi?id=240969
<rdar://problem/93989777>

Reviewed by Dewei Zhu.

  • Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/branch.py:

(Branch.main): Handle case where tracker does not have defined credentials.

  • Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/branch_unittest.py:

(TestBranch.test_create_bug): Added.

Canonical link: ​https://commits.webkit.org/251016@main

Location:
trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/branch.py

    r294038 r294893  
    119119        if not issue and Tracker.instance():
    120120            if ' ' in args.issue:
    121                 if getattr(Tracker.instance(), 'credentials'):
     121                if getattr(Tracker.instance(), 'credentials', None):
    122122                    Tracker.instance().credentials(required=True, validate=True)
    123123                issue = Tracker.instance().create(
  • trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/branch_unittest.py

    r293875 r294893  
    126126
    127127    def test_create_bug(self):
    128         self.maxDiff = None
    129         with MockTerminal.input('2'), OutputCapture(level=logging.INFO) as captured, mocks.local.Git(self.path), bmocks.Bugzilla(
     128        with OutputCapture(level=logging.INFO) as captured, mocks.local.Git(self.path), bmocks.Bugzilla(
    130129            self.BUGZILLA.split('://')[-1],
    131130            issues=bmocks.ISSUES,
    … …  
    178177        self.assertEqual(captured.stderr.getvalue(), '')
    179178
     179    def test_create_radar(self):
     180        with OutputCapture(level=logging.INFO) as captured, mocks.local.Git(self.path), Environment(RADAR_USERNAME='tcontributor'), bmocks.Radar(
     181            issues=bmocks.ISSUES,
     182            projects=bmocks.PROJECTS,
     183        ), patch('webkitbugspy.Tracker._trackers', [radar.Tracker(project='WebKit')]), mocks.local.Svn(), MockTime, wkmocks.Terminal.input(
     184            '[Area] New Issue', 'Issue created via command line prompts.',
     185            '1', '2',
     186        ):
     187            self.assertEqual(0, program.main(
     188                args=('branch',),
     189                path=self.path,
     190            ))
     191            self.assertEqual(local.Git(self.path).branch, 'eng/Area-New-Issue')
     192
     193            issue = radar.Tracker(project='WebKit').issue(4)
     194            self.assertEqual(issue.title, '[Area] New Issue')
     195            self.assertEqual(issue.description, 'Issue created via command line prompts.')
     196            self.assertEqual(issue.project, 'WebKit')
     197            self.assertEqual(issue.component, 'SVG')
     198            self.assertEqual(issue.version, 'Safari 15')
     199
     200        self.assertEqual(
     201            captured.stdout.getvalue(),
     202            '''Enter issue URL or title of new issue:
     203Issue description:
     204What component in 'WebKit' should the bug be associated with?:
     205    1) SVG
     206    2) Scrolling
     207    3) Tables
     208    4) Text
     209:
     210What version of 'WebKit SVG' should the bug be associated with?:
     211    1) Other
     212    2) Safari 15
     213    3) Safari Technology Preview
     214    4) WebKit Local Build
     215:
     216Created '<rdar://4> [Area] New Issue'
     217Created the local development branch 'eng/Area-New-Issue'
     218''',
     219        )
     220        self.assertEqual(captured.stderr.getvalue(), '')
     221
    180222    def test_to_branch_name(self):
    181223        self.assertEqual(program.Branch.to_branch_name('something with spaces'), 'something-with-spaces')
Note: See TracChangeset for help on using the changeset viewer.