-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for generic github repo markers as 'bugrefs Using the generic profile '<marker>[#<project/repo>]#<id>' for all bugrefs, especially for github, allows to track all issues reported on github and especially test fixing pull requests to be recorded as 'bugrefs' with the same icon as for "test issues", i.e. poo#. This way there is no need to create a ticket just to track a test issue for which already a github pull request exist because otherwise the URL to the github PR would not mean anything special to github and therefore not mark a job as "labeled". Also, pasting full github URLs is supported, same as for all other bugrefs, meaning that the URL is abbreviated into short form bugrefs. The pattern follows the openSUSE/OBS recommendation.
- Loading branch information
Showing
5 changed files
with
84 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env perl -w | ||
|
||
# Copyright (C) 2016 SUSE LLC | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
BEGIN { | ||
unshift @INC, 'lib'; | ||
} | ||
|
||
use strict; | ||
use OpenQA::Utils; | ||
use Test::More; | ||
use Test::Mojo; | ||
use Test::Warnings; | ||
use Test::Output qw/stderr_like/; | ||
|
||
is bugurl('bsc#1234'), 'https://bugzilla.suse.com/show_bug.cgi?id=1234', 'bug url is properly expanded'; | ||
ok find_bugref('gh#os-autoinst/openQA#1234'), 'github bugref is recognized'; | ||
is bugurl('gh#os-autoinst/openQA#1234'), 'https://github.com/os-autoinst/openQA/issues/1234'; | ||
is bugurl('poo#1234'), 'https://progress.opensuse.org/issues/1234'; | ||
is href_to_bugref('https://progress.opensuse.org/issues/1234'), 'poo#1234'; | ||
is bugref_to_href('boo#9876'), '<a href="https://bugzilla.opensuse.org/show_bug.cgi?id=9876">boo#9876</a>'; | ||
is href_to_bugref('https://github.com/foo/bar/issues/1234'), 'gh#foo/bar#1234'; | ||
is href_to_bugref('https://github.com/os-autoinst/os-autoinst/pull/960'), 'gh#os-autoinst/os-autoinst#960', 'github pull are also transformed same as issues'; | ||
is bugref_to_href('gh#foo/bar#1234'), '<a href="https://github.com/foo/bar/issues/1234">gh#foo/bar#1234</a>'; | ||
like bugref_to_href('bsc#2345 poo#3456 and more'), qr{a href="https://bugzilla.suse.com/show_bug.cgi\?id=2345">bsc\#2345</a> <a href=.*3456.*> and more}, 'bugrefs in text get replaced'; | ||
like bugref_to_href('boo#2345,poo#3456'), qr{a href="https://bugzilla.opensuse.org/show_bug.cgi\?id=2345">boo\#2345</a>,<a href=.*3456.*}, 'interpunctation is not consumed by href'; | ||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters