Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9593

Missing documentation for running unit tests

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.7-PL1
    • Fix Version/s: 3.0.8-RC1
    • Component/s: Other
    • Labels:
      None
    • Environment:
      Php with minimum required extensions and no libraries installed

      Description

      For the purposes of this ticket I am a phpbb user who wants to participate in development. In particular I see a request for help in to fix some failing test cases. I decided to run the test suite to see whether I can fix some of the failures.

      I see no documentation for how to run tests. I change to tests directory and see one php file in it. I run it.

      [code]
      pie@snap tests % php all_tests.php

      Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in /home/pie/apps/phpbb3/tests/test_framework/framework.php on line 29

      Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.:/usr/local/share/pear') in /home/pie/apps/phpbb3/tests/test_framework/framework.php on line 29
      [/code]

      Actual result: error above

      Expected result: a readme file in tests directory explaining what prerequisite software I need to run the tests, and how to run the tests.

        Activity

        Hide
        Oleg Oleg [X] (Inactive) added a comment -
        Show
        Oleg Oleg [X] (Inactive) added a comment - Link that I forgot: http://tracker.phpbb.com/browse/PHPBB3-9592
        Hide
        bantu Andreas Fischer added a comment -
        Show
        bantu Andreas Fischer added a comment - Had a look at this? http://wiki.phpbb.com/display/DEV/Unit+Tests
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Examining the two servers that run phpbb the only overlapping extensions appear to be pgsql and session, and I'm not convinced I need the session one. So, the only extension that phpbb absolutely requires to run is some database access one, it would seem.

        Specifying required extensions is necessary for two reasons:

        1. Users that run test suite on systems that don't run boards, and therefore may not have any particular extension installed.

        2. Users that run test suite and want to test features they don't use on their board. In particular apparently I don't need gd since I don't use gd captchas, but assuming eventually tests are written for it I would need to have gd installed to run the entire test suite.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Examining the two servers that run phpbb the only overlapping extensions appear to be pgsql and session, and I'm not convinced I need the session one. So, the only extension that phpbb absolutely requires to run is some database access one, it would seem. Specifying required extensions is necessary for two reasons: 1. Users that run test suite on systems that don't run boards, and therefore may not have any particular extension installed. 2. Users that run test suite and want to test features they don't use on their board. In particular apparently I don't need gd since I don't use gd captchas, but assuming eventually tests are written for it I would need to have gd installed to run the entire test suite.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Since the docs exist the readme file just needs to link to them.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Since the docs exist the readme file just needs to link to them.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        After installing phpunit:

        pie@snap tests % phpunit all_tests.php 
        PHPUnit 3.4.1 by Sebastian Bergmann.
         
        .
        Fatal error: Call to undefined function ctype_digit() in /home/pie/apps/phpbb3/tests/utf/utf8_wordwrap_test.php on line 51
        

        Note that phpbb source code does not use ctype functions. Clearly this is a test-only requirement.

        Show
        Oleg Oleg [X] (Inactive) added a comment - After installing phpunit: pie@snap tests % phpunit all_tests.php PHPUnit 3.4.1 by Sebastian Bergmann.   . Fatal error: Call to undefined function ctype_digit() in /home/pie/apps/phpbb3/tests/utf/utf8_wordwrap_test.php on line 51 Note that phpbb source code does not use ctype functions. Clearly this is a test-only requirement.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        I would suggest separating running unit tests and writing unit tests into separate pages.

        As someone who wants to help (by running unit tests) but does not understand phpbb test framework, I want to get started quickly and see results. The running section is 3/4 of a page, the writing section is nearly 4 pages. I have to read a huge amount of text and discard most of it because it's irrelevant. The more useless work I have to do the more likely I am to give up and go do something else.

        Show
        Oleg Oleg [X] (Inactive) added a comment - I would suggest separating running unit tests and writing unit tests into separate pages. As someone who wants to help (by running unit tests) but does not understand phpbb test framework, I want to get started quickly and see results. The running section is 3/4 of a page, the writing section is nearly 4 pages. I have to read a huge amount of text and discard most of it because it's irrelevant. The more useless work I have to do the more likely I am to give up and go do something else.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Proposed readme file.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Proposed readme file.
        Hide
        bantu Andreas Fischer added a comment -

        Very much appreciated.

        I changed the commit message slightly to follow http://wiki.phpbb.com/display/DEV/Git

        Show
        bantu Andreas Fischer added a comment - Very much appreciated. I changed the commit message slightly to follow http://wiki.phpbb.com/display/DEV/Git

          People

          • Assignee:
            bantu Andreas Fischer
            Reporter:
            Oleg Oleg [X] (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development