summaryrefslogtreecommitdiff
path: root/FS-Test/README
blob: 8e9681cefb09a202e853a432c6a8449ed37b4940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FS-Test

INSTALLATION

This module no longer needs to be installed. Run it directly from the source
tree.

RUNNING TESTS

"freeside-test-run" is the main test script. Currently there's only one test
plan, "ui_tests". freeside-test-run will:

- download all the URLs listed in the test plan into a directory in /tmp
- compare them to the reference versions with "diff -ur"
- write the output to "freeside_test.YYYYMMDD.diff"

The raw output directory will not be deleted, so you can examine the results
yourself.

If you want to do anything with the database besides compare the test results
to reference, run "freeside-test-start" by hand first. This will create a
database with the test image and start Apache with a fake time of one day after
the last bill. If there's an existing Freeside database, it will be renamed to
"freeside_YYYYMMDD" (the current date).

To put the existing database back in place, run "freeside-test-stop", then
restart Apache and any Freeside services.

UPDATING THE REFERENCE PAGES

The simplest way to update the reference copies of the test pages is

bin/freeside-test-start
bin/freeside-test-fetch -d ./share/output

(from the FS-Test source directory). If you're installing from a git repo,
this will overwrite the working tree with the newly downloaded test pages.
You can then use "git diff" to examine your changes and "git commit" to 
commit them when you're done.

ADDING NEW TESTS

For UI tests, add the URL, minus the "http://hostname/freeside" prefix,
to share/ui_tests. Then run freeside-test-fetch to get the reference output
of the test and copy it to share/output (and add that file to git).

When adding any new test, make sure to _run it twice_ on the same database
and code version to detect random or time-sensitive variations. These will
throw false alerts when anyone else uses your test, so you'll need to suppress
them somehow.

WHAT'S IN THE TEST DATABASE

Two hundred customers with random nonsensical U.S. addresses. One third have
automatic checking, the rest have credit cards. 10% of the customers have 
separate billing and service addresses.

Four package definitions (plus the unique "system domain"): annual domain,
monthly prorated account, monthly prorated broadband service, monthly
phone. Each package has one service except the phone package, which has a 
quantity limit of 4. The two monthly prorated packages have setup fees.

Each customer has three of the four packages, started over the period from 
2015-08-01 to 2016-03-01. Each package has a service configured (with a random
username, domain name, phone number, or IP address).  Customers were invoiced 
on the first day of each month during that period.

There's a billing event to run automatic credit card billing on eligible 
invoices. The configured gateway is Business::OnlinePayment::Dummy, which
returns success for everything, so customers with credit cards will be fully
paid.

One user with unlimited access. Username "test", password "test".

There are no cancellations or suspensions, no credits, no taxes, no refunds,
no discounts, no exports, and no RT tickets.  All of this stuff lies in the
bright shining future.

If you modify the test database, be sure to update this section also. Also
update the company name to "Freeside Test X.Y.Z" where X.Y is the Freeside
version number and Z is the test database version number, and set the same
value in freeside-test-start so that old test databases aren't used by
mistake.