Closed Bug 282733 Opened 20 years ago Closed 20 years ago

Database-Upgrade Regression Tests for checksetup on landfill

Categories

(Bugzilla :: bugzilla.org, enhancement)

2.19.2
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(3 files, 6 obsolete files)

It's very difficult to make a general-purpose regression test script for
checksetup, because it's difficult to generate old databases on the fly.
However, landfill.bugzilla.org already has all the databases and tools in place
to run such a test.

Basically, the script would just clone a bunch of databases, upgrade them, and
then watch for warnings or errors.

It would have to only run every few hours, because otherwise it would hose landfill.
We need to:

1. Check if we can create an empty database
2. Check if we can run cleanly against the tip database
3. Check if we can upgrade from 2.8
4. Check if we can upgrade from intermediate versions

We could do 1, 2, and 3 on every checkin, and only do 4 once a day, or once
every six hours, perhaps.
Attached file v1 (obsolete) —
Here it is. I've got it working on landfill, in an installation called
checksetup.

Right now it only works there, but it's easy to make it work on other
installations.

Soon I will integrate it into tinderbox.

I'm just posting it here for reference. :-)
Next steps are to:

(1) Integrate with Tinderbox
(2) Make it do some actual tests on the created DBs, like making a bunch of Bug
objects and User objects, and calling their methods.
Attached file v2 (obsolete) —
OK, here's version 2. I basically cleaned up version 1.

Now, it needs a tinderclient wrapper. I know that I need to send email to some
email address at regular intervals... what's the format of the email? Who knows
this? justdave? Are there some docs about this somewhere in the tinderbox code?


Basically, the script just needs to continually check for changes in
checksetup, and then run the basic test if there have been changes. It should
write out two logs: one that is stdout+stderr, and one that is just stderr.

If test-checksetup.pl returned non-0, we're burning (red). If the stderr log
contains anything, we're orange.
Attachment #174759 - Attachment is obsolete: true
Attached file Tinderbox script, not working (obsolete) —
I have NO IDEA why this script isn't working. It dies with:

Test complete. Failed 0 time(s).
Can't use string ("--------------------------------") as a SCALAR ref while
"strict refs" in use at ./tinderbox.pl line 74.

So that's in these lines of tinderbox.pl:

Log($log,`perl -W ./test-checksetup.pl 2> $error_log 2>&1`);
checkerrors($log);
Log($log,"test-checksetup.pl complete\n");
Log($log,"----------------------------------------------------\n\n");
									       
			     
##########################
# Check For Any Warnings #
##########################
Log($log,"---------------------------------------------\n");


Here's the CATCH: if I comment-out the line that runs test-checksetup, it works
fine. Of course, that defeats the whole purpose of the script!
Attached file Working tinderbox script (obsolete) —
OK, this one works and is now running on landfill.

Yes, I will soon modify it so that it runs the test even if other files than
checksetup have changed.

Right now it:

(1) Creates an empty database
(2) Runs against the tip database
(3) Upgrades 2.10

It doesn't do 2.8 because I know that burns, at the moment.
Attachment #174849 - Attachment is obsolete: true
Attached file Tinderbox Client, v3 (obsolete) —
OK, this tinderbox client is pretty much the good one. It runs checksetup if
there have been any changes in the installation.

By the way, this script is a bit cleaner than Devel::Tinderclient in a few
places, most noticeably the cool thing I did with IO::Tee. However, it's not as
configurable or generally useful (yet) as Devel::Tinderclient.
Attachment #174939 - Attachment is obsolete: true
OK, we also have the full test, now. I'll post the two new scripts for basic and
full here tomorrow, and then this is resolved.
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
Attached file Tinderbox Client, v4 (obsolete) —
OK, *this* is the final, currently-working Tinderbox client.

It has so many cool bells and whistles that I can't even begin to explain.
Hahaha.

Anyhow, this code is WAY cleaner than Devel::Tinderclient, but not as
configurable. 

However, if somebody was going to re-write Devel::Tinderclient, this would be a
good place to start. I also changed Tinderconfig.pm to have "use strict" and
"use constant" for the configuration variables.

Right now it's sending me the tinderbox messages, just to make sure that
everything works before I flood the landfill tinderbox. :-)
Attachment #174947 - Attachment is obsolete: true
OK, here's what I have now for the test-checksetup script as it's running on
landfill.

It also does testing on each created database, now. Any further enhancements to
it will go in a future bug. :-)
Attachment #174837 - Attachment is obsolete: true
OK, this client is running properly and working on landfill, now.
Attachment #175197 - Attachment is obsolete: true
Note that I removed a lot of variables from this, but I also left some in that
don't need to be there. No big deal.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 175279 [details]
Final Test-Checksetup Script (v3)

Just a small strange-worded text:

    # This is 2.08 is that it sorts properly.
Oh, that should have been: "This is 2.08 so that it sorts properly." :-) I fixed
it on the running copy on the server.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: