1 -----------------------------------------------------------------------------
2 # Solgenomics Test Suite
3 -----------------------------------------------------------------------------
5 This is the SGN test suite, which helps us verify that code is working as it should.
9 perl t/test_fixture.pl t/unit/
10 perl t/test_fixture.pl t/unit_fixture/
11 perl t/test_fixture.pl t/selenium2/
13 To run the tests in a given folder, run the following command from the `sgn` folder, changing the folder name depending on the tests you want to run:
16 perl t/test_fixture.pl --logfile logfile.testserver.txt t/unit_mech/ 2>test.results.txt
19 To run a single files test, run this command, changing the file path to the file you want:
22 perl t/test_fixture.pl --logfile logfile.testserver.txt t/unit_mech/AJAX/BrAPI_v2.t 2>test.results.txt
25 The variables in the calls for the following purposes:
27 `logfile` - the output file for the server logs
29 `2>test.result.txt` - the output file for the test results
31 To determine which tests are failing, look in your output log file for the errors thrown from the test file. It will tell you the line number in the debug message.
33 -----------------------------------------------------------------------------
34 #Testing Configuration
35 -----------------------------------------------------------------------------
37 The tests run on the dedicated `sgn_test.conf` file. Currently, the configuration file is
38 setup to work with the breedbase docker compose build. The only variable that makes it
39 specific to the docker build is the `dbhost` variable. Set this to `localhost` if you
40 want to run the tests outside of the docker container.
42 -----------------------------------------------------------------------------
44 -----------------------------------------------------------------------------
48 Unit tests in the Bio::SecreTary::* namespace. These tests do not require a database to run.
52 Unit tests in the CXGN::* namespace. These tests do not require a database to run.
56 Tests related to POD documentation. These tests do not require a database to run.
58 ## t/unit_fixture/CXGN
60 Unit fixture tests in the CXGN::* namespace. These test run against the fixture database.
61 These tests run directly against backend CXGN modules (most often Moose objects).
65 Unit fixture tests in the SGN::* namespace. These test run against the fixture database.
66 These tests run directly against backend SGN modules (most often Moose objects).
68 ## t/unit_fixture/Controller
70 Unit fixture tests in the SGN::Controller::* namespace. These test run against the fixture database.
71 These tests run through URL requests to Catalyst::Controller modules.
73 ## t/unit_fixture/AJAX
75 Unit fixture tests in the SGN::Controller::AJAX::* namespace. These test run against the fixture database.
76 These tests run through URL requests to Catalyst::Controller::REST modules.
78 ## t/unit_fixture/Static
80 These tests check that static files are accessible from web services.
84 Integration tests, which use selenium2 to launch a web browser.
85 These tests are useful for testing client side javascript, but use of these tests has fallen short lately because of the slowness of selenium.
89 Tests which run tests against live websites.
93 -----------------------------------------------------------------------------
95 -----------------------------------------------------------------------------
99 Used to launch a test server and to load the fixture database. Also useful for testing entire directories at once.
103 Contains test data, such as test GFF3 files or test images. Used by the rest of the test suite.
107 Libraries written for and to be used by the test suite, such as SGN::Test::Data.
111 -----------------------------------------------------------------------------
113 -----------------------------------------------------------------------------
117 Tests in the SGN::* namespace
121 Tests in the CXGN::* namespace
123 ## t/legacy/integration/
125 This directory contains integration tests, which test how multiple peices of code interact,
126 as opposed to unit tests, which usually test a small piece of code in isolation.
129 ## t/legacy/validate/
131 Validation tests, which run "html lint" tests to make sure our HTML validates, which is important
132 for making the website render properly and quickly in many browsers.