User Tools

Site Tools


dev:contributing:qa

This is an old revision of the document!


QA Requirements for Evergreen Code Contributions

Types of Tests

Perl Unit Tests

These are used for testing Perl functions which can be executed without a running Evergreen system.

  • They are built using Perl's http://perldoc.perl.org/Test/More.html
  • Files are kept in the Evergreen repository under Open-ILS/src/perlmods/t/.
  • Unit tests are executed during the "make check" phase when building Evergreen

For a simple example, see Open-ILS/src/perlmods/t/01-OpenILS-Application.t. Of note is the following section of code which tests a Perl function in the AppUtils.pm module:

is(                                                                            
    OpenILS::Application::AppUtils::entityize(0, 'èöçÇÈÀ'),                    
    'èöçÇÈÀ',                                    
    'entityize: diacritics'                                                    
); 
Perl Live Tests

Live tests are used for testing a running Evergreen system. They can communicate over the network, talk to the database, etc. To execute live tests, Evergreen must be running and the "concerto" data set must be installed.

NOTE: The "concerto" dataset can be installed when the database is built using the "–load-all-sample" option.

Running the live tests:

cd Open-ILS/src/perlmods
make livecheck

For a simple example, see Open-ILS/src/perlmods/live_t/00-simple.t. Note how it's making API calls to the open-ils.storage service.

my $ses = $script->session('open-ils.storage');                                
my $req = $ses->request('open-ils.storage.direct.actor.user.retrieve', 1);     
if (my $resp = $req->recv) {                                                   
    if (my $user = $resp->content) {                                           
        is(                                                                    
            ref $user,                                                         
            'Fieldmapper::actor::user',                                        
            'open-ils.storage.direct.actor.user.retrieve returned aou object'  
        );                                    
        ...
dev/contributing/qa.1422033063.txt.gz · Last modified: 2022/02/10 13:34 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.