Bug 884331

Summary: rhts-mk-get-current-tag uses insufficient regular expression to get correct name of the test
Product: [Retired] Beaker Reporter: Matěj Cepl <mcepl>
Component: command lineAssignee: Dan Callaghan <dcallagh>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.10CC: asaha, dcallagh, mishin, qwan, rglasz, rmancy
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-06 04:09:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matěj Cepl 2012-12-05 23:11:13 UTC
Description of problem:
$ git tag -l
gedit-desktop-rhel7-gedit-fileOpenLocation-1_2-1
gedit-desktop-rhel7-gedit-fileOpenReopen-1_1-1
gedit-desktop-rhel7-gedit-fileOpenReopen-1_1-2
gedit-desktop-rhel7-gedit-fileOpenReopen-1_1-3
gedit-desktop-rhel7-gedit-fileOpenReopen-1_3-1
gedit-desktop-rhel7-gedit-fileSaveWhenNotAllowed-1_2-1
gedit-desktop-rhel7-gedit-helper-code-1_13-1
gedit-desktop-rhel7-gedit-helper-code-1_13-2
gedit-desktop-rhel7-gedit-helper-code-1_13-3
gedit-desktop-rhel7-gedit-helper-code-1_13-4
gedit-desktop-rhel7-gedit-helper-code-1_13-5
gedit-desktop-rhel7-gedit-helper-code-1_13-6
gedit-desktop-rhel7-gedit-helper-code-1_13-7
gedit-desktop-rhel7-gedit-loadPlugins-1_2-1
gedit-desktop-rhel7-gedit-searchText-1_2-2
gedit-desktop-rhel7-gedit-searchText-1_2-4
gedit-desktop-rhel7-gedit-searchText-1_3-1
gedit-desktop-rhel7-gedit-searchText-1_3-3
gedit-desktop-rhel7-gedit-searchTextNext-1_1-1
gedit-desktop-rhel7-gedit-searchTextNext-1_2-1
gedit-desktop-rhel7-gedit-searchTextNext-1_2-2
gedit-desktop-rhel7-gedit-searchTextNext-1_2-3
gedit-desktop-rhel7-gedit-searchTextNext-1_2-4
gedit-desktop-rhel7-gedit-searchTextReplace-1_2-1
gedit-desktop-rhel7-gedit-searchTextReplace-1_2-2
gedit-desktop-rhel7-gedit-searchTextReplace-1_2-3
gedit-desktop-rhel7-gedit-startViaCommand-1_1-1
gedit-desktop-rhel7-gedit-startViaCommand-1_1-2
gedit-desktop-rhel7-gedit-startViaCommand-1_1-3
gedit-desktop-rhel7-gedit-startViaCommand-1_1-4
gedit-desktop-rhel7-gedit-startViaCommand-1_1-5
gedit-desktop-rhel7-gedit-startViaCommandGnomeTextEditor-1_1-1
gedit-desktop-rhel7-gedit-startViaMenu-1_2-1
$ sh -x /usr/libexec/rhts/rhts-mk-get-current-tag
+ '[' 0 -gt 1 ']'
+ '[' 0 == 1 ']'
++ rhts-mk-get-test-package-name
+ PACKAGE_NAME=gedit
++ echo
++ sed -e 's/\./_/g'
+ CURRENT_VERSION=
+ CURRENT_TAG=gedit--1
+ '[' -d CVS ']'
+ '[' -d .svn ']'
+ git log -1
++ cut -c 11-
++ git for-each-ref --count=1 --sort=-taggerdate '--format=%(refname)' 'refs/tags/gedit*'
+ CURRENT_TAG=gedit-desktop-rhel7-gedit-startViaMenu-1_2-1
++ git cat-file -t refs/tags/gedit-desktop-rhel7-gedit-startViaMenu-1_2-1
+ '[' -n gedit-desktop-rhel7-gedit-startViaMenu-1_2-1 -a tag '!=' tag ']'
+ '[' 0 == 1 ']'
+ echo gedit-desktop-rhel7-gedit-startViaMenu-1_2-1
gedit-desktop-rhel7-gedit-startViaMenu-1_2-1
$ grep 'export TEST' Makefile 
export TEST=/desktop/rhel7/gedit/startViaCommand
export TESTVERSION=1.1
$ 

By using too short glob

'refs/tags/gedit*' script collects wrong name of the tag (“gedit-desktop-rhel7-gedit-startViaMenu-1_2-1” instead of “gedit-desktop-rhel7-gedit-startViaCommand-1_1-5”)

which then leads to bad results.

Version-Release number of selected component (if applicable):
rhts-devel-4.52-3.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1.see above
2.
3.
  
Actual results:
wrong tag found

Expected results:
appropriate tag should be found

Additional info:

Comment 1 Dan Callaghan 2012-12-06 04:09:11 UTC
(In reply to comment #0)
> $ sh -x /usr/libexec/rhts/rhts-mk-get-current-tag

Running these scripts directly like this is not helpful, they rely on TEST and TESTVERSION being exported from the Makefile so the output you are showing here is broken for other reasons.

I think the actual problem here is these two tags:

> gedit-desktop-rhel7-gedit-startViaCommand-1_1-5
> gedit-desktop-rhel7-gedit-startViaCommandGnomeTextEditor-1_1-1

which is to say, I think this is a dupe of bug 869311.

Please upgrade to rhts-devel-4.53 and re-open this bug if you are still seeing issues.

*** This bug has been marked as a duplicate of bug 869311 ***