Uploaded image for project: 'Doctrine MongoDB ODM'
  1. Doctrine MongoDB ODM
  2. MODM-99

ODM tests drop all collections from all databases on the MongoDB server


    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0BETA1
    • Fix Version/s: 1.0.0BETA2
    • Component/s: None
    • Labels:
    • Environment:
      Cent OS 5.5, PHP 5.3.3


      Recently I run ODM tests in my sandbox and found out that all collections in all databases were dropped after that.
      Thanks god I did run it in my sandbox only which has own database instance.

      After reviewing the code I found out that Doctrine\ODM\MongoDB\Tests\BaseTest->tearDown() method cleans up the whole MongoDB server after running the tests.

      From one hand such extremely unsafe behavior is not mentioned anywhere from another hand there are no ways to work around it currently but only changing the tests code.

      It would be really great if there is a way to specify MongoDB connection parameters for ODM tests or at least change tests code in order to drop only databases which were created during the test
      and no others else.

      Thank you.


        vkaplich Vitaliy Kaplich created issue -
        jwage Jonathan H. Wage made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.0.0BETA2 [ 10092 ]
        Resolution Fixed [ 1 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={expand=changesets[0:20].revisions[0:29],reviews, query=MODM-99}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            jwage Jonathan H. Wage
            vkaplich Vitaliy Kaplich
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: