Place pifr.php in the root of drupal to make test run without configuring master


require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

require_once drupal_get_path('module', 'pifr_client') . '/review/pifr_client_review.inc';

$base_url = 'http://test.client.example.com';

  $test = array(
    'test_id' => '7',
    'core' => array (
      'repository' => array (
        'type' => 'cvs',
        'url' => ':pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal/drupal',
      ),
      'branch_identifier' => 'HEAD',
    ),
//    'file_url' => url('pass.patch', array('absolute' => TRUE)), //'http://example.com/pifr_server/some.patch',
    'file_url' => url(drupal_get_path('module', 'pifr_server') .'/confirmation/pass.patch', array('absolute' => TRUE)),
  );
  $review = new PIFRClientReview($test);
  $review->run();
  print '<h3>' . t('Self test') . '</h3>';
  print '<div class="pifr-client-section">'. var_export($review, TRUE) .'</div>';
drupal_page_footer();

Comments

boombatower’s picture

Lets work this into a button or something and make a proper patch.

boombatower’s picture

Category: support » feature
boombatower’s picture

Status: Needs work » Needs review
StatusFileSize
new1.77 KB

Here is a cleaned up version.

boombatower’s picture

Title: Console script to self-test pifr2 client » Script to self-test pifr2 client
Status: Needs review » Fixed

Committed.

Amazon’s picture

Status: Fixed » Needs work

Are there some instructions on how this to use this? Is this script going to be installed in all instances, or do you symlink it from the /scripts directory to the root directory?

boombatower’s picture

Status: Needs work » Needs review
+/**
+ * @file
+ * Provides a script to invoke the test client manually.
+ *
+ * Place this script in the Drupal root and access it directly through your web
+ * browser.
+ *
+ * Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
+ */

All you need to do is hit in web browser and it will dump out the results.

boombatower’s picture

StatusFileSize
new877 bytes
boombatower’s picture

Status: Needs review » Fixed

Committed.

robezy’s picture

Category: feature » bug

Hi,

I got following error when i ran the script.

PIFRClientReview::__set_state(array( 'CHECKOUT_DIRECTORY' => 'sites/default/files/checkout', 'REVIEW_DIRECTORY' => 'sites/default/files/review', 'database' => PIFRClientReviewDB_mysql::__set_state(array( )), 'vcs' => array ( 'cvs' => PIFRClientReviewVCS_cvs::__set_state(array( )), ), 'test' => array ( 'test_id' => '7', 'core' => array ( 'repository' => array ( 'type' => 'cvs', 'url' => ':pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal/drupal', ), 'branch_identifier' => 'HEAD', ), 'file_url' => 'http://test.client.example.com/sites/all/modules/project_issue_file_revi...', ), 'filePath' => NULL, 'adminPassword' => NULL, 'error' => array ( '@reason' => 'failed to retrieve file from project client', 'code' => 2, ), ))

Am i supposed to change the base_url of variable in the script?

boombatower’s picture

I guess you can add the base_url variable as in the initial post. My thoughts were to run it through the browser so all the regular variables were created.

Per #6:

Place this script in the Drupal root and access it directly through your web browser.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.