Fill-database

Review Request #2104 — Created Feb. 6, 2011 and submitted — Latest diff uploaded

Information

Review Board
fill-database

Reviewers

Here is the fully functioning fill-database script.

Command and arguments take the form of:
./reviewboard/manage.py fill-database --users=N1 --review-requests=N2:N3 --diffs=N4:N5 --reviews=N6:N7 --diff-comments=N8:N9

Added: a password can now be set for all users created using --password=TEXT
fill-database --users=10 --password=custom1

For instance:
./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1 --reviews=1 --diff-comments=1

or

./reviewboard/manage.py fill-database --users=1 --review-requests=1:10 --diffs=1:5 --reviews=1:5 --diff-comments=1:5
Testing for fill-database
March 20, 2011 tests added:
Tested missing diff directory, missing diff files, & missing repo directory
Tested causing error cases where try/except clauses were changed

March 13, 2011 Tests added:
Tested running exceptions, where path files could not be found
Tested adding the password parameter (--password=test5)
Tested adding random lorem ipsum wording to summary & description

In the cases below where the database is empty a superuser has been created

Test adding only one user on empty database
./reviewboard/manage.py fill-database --users=1

Test adding many users on an empty database
./reviewboard/manage.py fill-database --users=100
./reviewboard/manage.py fill-database --users=1000

Test adding large num of users
./reviewboard/manage.py fill-database --users=10000

Test adding users and arguments other than review-request 
(shouldn't add anything but users)
./reviewboard/manage.py fill-database --users=5 --diffs=1
./reviewboard/manage.py fill-database --users=5 --reviews=1
./reviewboard/manage.py fill-database --users=5 --diffs=1 --reviews=1
./reviewboard/manage.py fill-database --users=5 --diff-comments=1
./reviewboard/manage.py fill-database --users=5 --diffs=1 --reviews=1 --diff-comments=1

Test adding users and review-requests to emtpy database
./reviewboard/manage.py fill-database --users=1 --review-requests=1
./reviewboard/manage.py fill-database --users=1 --review-requests=1:10
./reviewboard/manage.py fill-database --users=100 --review-requests=1:10

Test adding arguments other than diffs
(shouldn't add anything but users & review-requests)
./reviewboard/manage.py fill-database --users=1 --review-requests=1 --reviews=100
./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diff-comments=100
./reviewboard/manage.py fill-database --users=1 --review-requests=1 --reviews=100 --diff-comments=100

Test adding users, review-requests, and diffs to empty database
./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1
./reviewboard/manage.py fill-database --users=100 --review-requests=1:10 --diffs=0:10

Test adding users, requests, diffs, and arguments other than reviews
(shouldn't add anything but users, requests & diffs)
./reviewboard/manage.py fill-database --users=5 --review-requests=1:5 --diffs=1:10 --diff-comments=10

Test adding users, requests, diffs, and reviews to empty database
./reviewboard/manage.py fill-database --users=1 --review-requests=1:5 --diffs=1 --reviews=1
./reviewboard/manage.py fill-database --users=100 --review-requests=0:5 --diffs=0:5 --reviews=0:5

Test adding users, requests, diffs, reviews, and comments to empty database
./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1 --reviews=1 --diff-comments=1

Test adding additional information to existing database
./reviewboard/manage.py fill-database --users=5 --review-requests=1:5 --diffs=1:5 --reviews=1:10 --diff-comments=1:10

Test adding lots of information
./reviewboard/manage.py fill-database --users=1 --review-requests=1 --diffs=1 --reviews=100 --diff-comments=1
./reviewboard/manage.py fill-database --users=5 --review-requests=5 --diffs=10 --reviews=100 --diff-comments=1
./reviewboard/manage.py fill-database --users=100 --review-requests=10 --diffs=10 --reviews=10 --diff-comments=10
[unfortunately while this last test does work, I ran it for 24hour without it completing the task entirely]

Test some params at 0, shouldn't execute following parameters
./reviewboard/manage.py fill-database --users=5 --review-requests=0 --diffs=1:5 --reviews=1:5 --diff-comments=1:5
./reviewboard/manage.py fill-database --users=5 --review-requests=2 --diffs=0 --reviews=1:5 --diff-comments=1:5
./reviewboard/manage.py fill-database --users=5 --review-requests=2 --diffs=2 --reviews=0 --diff-comments=1:5
./reviewboard/manage.py fill-database --users=5 --review-requests=2 --diffs=2 --reviews=2 --diff-comments=0

Additional quantity-based tests:
./reviewboard/manage.py fill-database --users=5 --review-requests=1:5 --diffs=1:10 --reviews=1:10 --diff-comments=1:10
./reviewboard/manage.py fill-database --users=100 --review-requests=100
./reviewboard/manage.py fill-database --users=100 --review-requests=50 --diffs=20
./reviewboard/manage.py fill-database --users=100 --review-requests=30 --diffs=10
./reviewboard/manage.py fill-database --users=100 --review-requests=20 --diffs=5 --reviews=50
./reviewboard/manage.py fill-database --users=100 --review-requests=20 --diffs=5 --reviews=20
./reviewboard/manage.py fill-database --users=100 --review-requests=20 --diffs=5 --reviews=10
./reviewboard/manage.py fill-database --users=100 --review-requests=10 --diffs=5 --reviews=10 --diff-comments=10