Closed
Bug 203318
Opened 22 years ago
Closed 22 years ago
008filter.t fails to do chdir $topdir - if @Support::Templates::include_paths returns more than one path
Categories
(Bugzilla :: Testing Suite, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: burnus, Assigned: burnus)
Details
Attachments
(1 file, 1 obsolete file)
|
2.15 KB,
patch
|
Details | Diff | Splinter Review |
This is perl, v5.6.1 built for i386-linux.
If I run ./runtests.sh --verbose 008filter
this fails after the first checked directory (e.g. templates/de/default).
The problem is here:
---------------<cut>-----------------------------
my $topdir = cwd;
foreach my $path (@Support::Templates::include_paths) {
$path =~ m|template/([^/]+)/|;
my $lang = $1;
chdir $topdir; # absolute path
ok(0, "TOPDIR: $topdir / cwd: ".cwd." / path: $path\n");
--------------<cut>------------------------------
The ok-line I inserted shows:
a) first loop run:
not ok 1 - TOPDIR: /web/server/bugzilla/docroot / cwd:
/web/server/bugzilla/docroot / path: template/de/default
b) second loop run:
not ok 88 - TOPDIR: /web/server/bugzilla/docroot / cwd:
/web/server/bugzilla/docroot/template/de/default / path: template/en/default
Why is cwd not $topdir in the second loop run?
(The problems I have are obvious: I cannot check more than one directory at one
./runtests run -- needing to hide the directories one by one for the
@Support::Templates::include_paths command)
| Assignee | ||
Updated•22 years ago
|
Summary: 008filter.t fails to do chdir $topdir - runs only one languager → 008filter.t fails to do chdir $topdir - if @Support::Templates::include_paths returns more than one path
| Assignee | ||
Comment 1•22 years ago
|
||
Thanks to Jens Dreger (our local PERL guru) for finding the error:
$/ = undef; # normally $/ is "\n"
my $topdir = cwd;
saves "dir\n" instead of "dir" which doesn't exist. Therefore chdir $topdir
fails (silently) and it works once.
(in the ok output I forgot a few line breaks)
| Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.18
| Assignee | ||
Updated•22 years ago
|
Attachment #121658 -
Flags: review?(gerv)
| Assignee | ||
Comment 3•22 years ago
|
||
This code
chdir $topdir; # absolute path
my @testitems = Support::Templates::find_actual_files($path);
left me for custom/ in the directory $topdir/$path/bugs/create. I have no idea
why, but it did!
I therefore added a chdir $topdir; afterwards.
Since I got a bit confused whether (en) is (en/custom) or (en/default), I
changed this too.
Attachment #121658 -
Attachment is obsolete: true
| Assignee | ||
Updated•22 years ago
|
Attachment #121661 -
Flags: review?(gerv)
| Assignee | ||
Updated•22 years ago
|
Attachment #121658 -
Flags: review?(gerv)
Comment 4•22 years ago
|
||
Please don't use the name "version" for the variable that has the value "custom"
or default"; version implies version number. A better name might be "flavour",
or something. Otherwise, looks good.
Gerv
Comment 5•22 years ago
|
||
Comment on attachment 121661 [details] [diff] [review]
New version, fixes additional problem
Vitaly had mentioned this before we shipped and I absolutely could not
reproduce it no matter how hard I tried. The $/ thing makes perfect sense
though. I wonder if Cwd works even with $/ cleared on Mac OS X (which is where
I was doing all my testing) or perhaps chdir ignores the \n on the end on Mac
OS X or something.... anyhow, this works.
Attachment #121661 -
Flags: review+
| Assignee | ||
Comment 6•22 years ago
|
||
gerv: ok, I'll call it "flavor" (not "flavour" ;-)
Flags: approval?
Comment 7•22 years ago
|
||
'cwd' apparently uses 'chomp' which in turn depends on $/ value.
It can be demonstrated with chomp('cwd') not working there, either.
Comment 8•22 years ago
|
||
go for it. please check it in on both the 2.16 branch and the tip.
Flags: approval? → approval+
| Assignee | ||
Comment 9•22 years ago
|
||
HEAD
Checking in t/008filter.t;
/cvsroot/mozilla/webtools/bugzilla/t/008filter.t,v <-- 008filter.t
new revision: 1.3; previous revision: 1.2
done
BUGZILLA-2_16-BRANCH
Checking in 008filter.t;
/cvsroot/mozilla/webtools/bugzilla/t/008filter.t,v <-- 008filter.t
new revision: 1.1.2.2; previous revision: 1.1.2.1
done
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•22 years ago
|
Attachment #121661 -
Flags: review+
Updated•22 years ago
|
Attachment #121661 -
Flags: review?(gerv)
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•