Closed
Bug 304600
Opened 20 years ago
Closed 19 years ago
Need a test in the test suite to check for dependency loops
Categories
(Bugzilla :: Testing Suite, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.0
People
(Reporter: mkanat, Assigned: LpSolit)
References
Details
Attachments
(1 file, 1 obsolete file)
We should be able to adapt justdave's use2dot script (from bug 303413) and our
dependency-loop-checking code for process_bug into a test that determines
whether or not our libraries contain dependency loops.
This bug is speaking about code dependencies not "bug xxx depends on" and "bug yyy blocks" type dependencies... right?
| Assignee | ||
Comment 2•20 years ago
|
||
(In reply to comment #1)
> This bug is speaking about code dependencies not "bug xxx depends on" and "bug
> yyy blocks" type dependencies... right?
Right! If Foo.pm uses Bar.pm, then Bar.pm should not use Foo.pm.
Comment 3•19 years ago
|
||
This version of use2dot.pl improves on the previous version by detecting and reporting dependencyloops that are more than one level deep.
example output:
[dave@g4book bugzilla]$ perl ../../misc/use2dot.pl > ~/bugzilla.dot
Dependency on Bugzilla::Attachment from Bugzilla::Flag causes loop.
Dependency on Bugzilla::BugMail from Bugzilla::Flag causes loop.
Dependency on Bugzilla::Product from Bugzilla::Classification causes loop.
Dependency on Bugzilla::User from Bugzilla::Component causes loop.
Dependency on Bugzilla::Bug from Bugzilla::BugMail causes loop.
Dependency on Bugzilla::Flag from Bugzilla::Attachment causes loop.
Dependency on Bugzilla::Component from Bugzilla::Product causes loop.
Dependency on Bugzilla::Product from Bugzilla::User causes loop.
Dependency on Bugzilla::Classification from Bugzilla::User causes loop.
Dependency on Bugzilla::Attachment from Bugzilla::Bug causes loop.
Dependency on Bugzilla::Flag from Bugzilla::Bug causes loop.
You can then use the produced ~/bugzilla.dot file to generate a pretty graph with red lines on the loops like so:
dot -Tpng ~/bugzilla.dot >~/Desktop/bugzilladeps.png
| Assignee | ||
Comment 4•19 years ago
|
||
This is based on use2dot.pl justdave wrote.
Assignee: zach → LpSolit
Attachment #218546 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #225930 -
Flags: review?(justdave)
| Assignee | ||
Updated•19 years ago
|
Target Milestone: --- → Bugzilla 2.24
Comment 5•19 years ago
|
||
Comment on attachment 225930 [details]
010dependencies.t
Looks like it works. Seems to be flagging all the right things. Tree's gonna go red when this is checked in though.
Attachment #225930 -
Flags: review?(justdave) → review+
Updated•19 years ago
|
Flags: approval+
| Assignee | ||
Comment 6•19 years ago
|
||
(In reply to comment #5)
> Looks like it works. Seems to be flagging all the right things. Tree's gonna
> go red when this is checked in though.
One way to prevent to lit the tree is to ignore |require Bugzilla::Foo| which are inside routines. This means writing (?:use|^require) instead of (?:use|require). I checked, there is no dependency loops detected this way. From what mkanat said on IRC, having Perl modules requiring each others is not a problem, e.g. for mod_perl.
I could commit this patch with the change above (on checkin).
| Reporter | ||
Comment 7•19 years ago
|
||
(In reply to comment #6)
> I could commit this patch with the change above (on checkin).
That sounds right to me.
| Assignee | ||
Comment 8•19 years ago
|
||
Checking in t/010dependencies.t;
/cvsroot/mozilla/webtools/bugzilla/t/010dependencies.t,v <-- 010dependencies.t
initial revision: 1.1
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•