Closed Bug 275705 Opened 20 years ago Closed 20 years ago

Better diagnostics for broken charts

Categories

(Bugzilla :: Reporting/Charting, defect)

2.17.7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: gerv, Assigned: glob)

References

Details

Attachments

(4 files, 3 obsolete files)

We need at least: - A better error message if they haven't run collectstats.pl - Better diags if their GD installation isn't working Gerv
i've been thinking about how to provide an error if GD isn't working. the best i can come up with is have a static image that says "your gd library isn't working, unable to create graph, yadda yadda".
The best thing would be for testserver.pl to create an image using GD.pm and diff it against a known good test image. Then, we can output an error if it doesn't work. Gerv
Attached patch v1 (obsolete) — Splinter Review
adds GD and Chart testing to testserver.pl output looks like.. E:\bugzilla\275705>perl testserver.pl http://localhost:81/275705 TEST-OK Got ant picture. TEST-OK Webserver is executing CGIs. TEST-OK Webserver is preventing fetch of http://localhost:81/275705/localconfig. TEST-OK GD Library generated a good PNG image TEST-OK GD Library generated a good GIF image TEST-OK Chart Library generated a good png image required images coming up. all the images belong in the t/ directory.
Assignee: gerv → bugzilla
Status: NEW → ASSIGNED
Attached image t/testgd.gif (obsolete) —
Attached image t/testgd.png
Attached image t/testchart.gif
Attached image t/testchart.png
the only thing i'm not sure about is if different versions of the GD library generate different but binaries with the same bitmap -- i'm not sure but i think there's versions of the GD library that generate uncompressed gifs. this needs testing on a range of platforms.
Byron: thanks for taking this on :-) IMO, we should not be testing for or configuring Bugzilla to generate GIFs any more. It just adds to the support burden, every browser we care about supports PNGs, and some versions of GD don't support GIF. For example, running this on my Linux i686 Mandrake 10 machine gives: TEST-OK GD Library generated a good PNG image TEST-FAILED GD returned: Can't locate object method "gif" via package "GD::Image" at ./testserver.pl line 168. TEST-OK Chart Library generated a good png image That would be an obvious-by-inspection bug in your image->can() call, but I still think we should dispense with the GIF business. Other patch comments: - you need to clean up after yourself by deleting the images you create if the test is successful. - If an image is created but the compare fails, you should WARN, and suggest they compare the images by eye. - the script should not by die-ing on errors at any point - (nit) Bugzilla coding style doesn't have a blank line after an opening or a closing brace. - Can we produce some more useful error output if the test fails? Like a suggestion to read a section of the manual, or check GD versions, or something? - You should be able to factor out the file comparison code into a common subroutine. Gerv
Dave: is it true that libgd 1.x goes with GD.pm 1.x, and libgd 2.x goes with GD.pm 2.x? If so, we could also at least check for a major version number match in checksetup.pl. That would help. Gerv
according to reports.cgi gif is the preferred format. my $type = $testimg->can('gif') ? "gif" : "png"; until that's changed (topic of another bug i suspect), we need to test the generation of gifs. > the script should not by die-ing on errors at any point it's in an eval block, so i'm doing a throw/catch exception. hrm, i can't see any way to check the version of libgd that gd.pm is loading.
Byron: reports.cgi is going away as soon as possible. You might say "well, we'll have a test until it goes", but we definitely don't need to test GIF generation from GD::Image (new charts), only Chart::Lines (old charts). If you can't test the libgd version number via GD.pm, a second-best is executing libgd-config --version, and hoping it's the version GD.pm is loading. On Windows, I understand that they ship together, so I suspect there's no chance of a mismatch. Gerv
(In reply to comment #10) > Dave: is it true that libgd 1.x goes with GD.pm 1.x, and libgd 2.x goes with > GD.pm 2.x? If so, we could also at least check for a major version number match > in checksetup.pl. That would help. Yes, that's correct. I've also seen reports that libgd 1.x didn't have a libgd-config, that it was new in 2.x, but I haven't confirmed that.
*** Bug 284666 has been marked as a duplicate of this bug. ***
*** Bug 276832 has been marked as a duplicate of this bug. ***
*** Bug 257497 has been marked as a duplicate of this bug. ***
byron: are you able to make the markups to this patch? I do like it :-) Gerv
gerv, yes, it's still on my radar.
Attachment #169982 - Attachment is obsolete: true
Attached patch v2 (obsolete) — Splinter Review
Attachment #169980 - Attachment is obsolete: true
Attachment #177105 - Flags: review?(gerv)
Comment on attachment 177105 [details] [diff] [review] v2 r=gerv, except remove the TEST-INFO line - it breaks scanning down to make sure everything is "OK". Gerv
Attachment #177105 - Flags: review?(gerv) → review+
Flags: approval?
Flags: approval? → approval+
Attached patch Patch v.3Splinter Review
Checked in patch (with review markup), for reference. Gerv
Attachment #177105 - Attachment is obsolete: true
Fixed. Checking in testserver.pl; /cvsroot/mozilla/webtools/bugzilla/testserver.pl,v <-- testserver.pl new revision: 1.5; previous revision: 1.4 done RCS file: /cvsroot/mozilla/webtools/bugzilla/t/testchart.gif,v done Checking in t/testchart.gif; /cvsroot/mozilla/webtools/bugzilla/t/testchart.gif,v <-- testchart.gif initial revision: 1.1 done RCS file: /cvsroot/mozilla/webtools/bugzilla/t/testchart.png,v done Checking in t/testchart.png; /cvsroot/mozilla/webtools/bugzilla/t/testchart.png,v <-- testchart.png initial revision: 1.1 done RCS file: /cvsroot/mozilla/webtools/bugzilla/t/testgd.png,v done Checking in t/testgd.png; /cvsroot/mozilla/webtools/bugzilla/t/testgd.png,v <-- testgd.png initial revision: 1.1 done Gerv
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 2.20
Flags: documentation?
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: