Comments

boombatower’s picture

Assigned: Unassigned » boombatower

Working on it.

boombatower’s picture

Using the following script to restore database after each test. (placed in index.php)

if (isset($_GET['restore'])) {
  header('Content-Type: text/plain');
  ini_set('display_errors', 1);
  set_time_limit(0);
  ob_start();

  echo "resetting...\n";
  ob_flush();

  db_query('TRUNCATE TABLE {watchdog}');

  db_query("UPDATE {system}
            SET schema_version = %d
            WHERE name = '%s'", 6000, 'pifr');

  $tables = array(
    'pifr_branch',
    'pifr_client',
    'pifr_file',
    'pifr_log',
    'pifr_project',
    'pifr_result',
    'pifr_result_detail',
    'pifr_result_detail_assertion',
    'pifr_test',
    'pifr_file_old',
    'pifr_result_old',
    'pifr_server',
    'pifr_log_old',
  );
  $ret = array();
  foreach ($tables as $table) {
    if (db_table_exists($table)) {
      db_drop_table($ret, $table);
    }
  }

  echo "importing t.d.o dataset...\n";
  ob_flush();

  $parts = parse_url($db_url['default']);
  $command = "mysql -u{$parts['user']} -p{$parts['pass']} " . substr($parts['path'], 1);
  exec($command . ' < /home/boombatower/download/tdo.sql');

  echo "renaming...\n";
  ob_flush();

  db_rename_table($ret, 'pifr_file', 'pifr_file_old');
  db_rename_table($ret, 'pifr_result', 'pifr_result_old');
  db_rename_table($ret, 'pifr_log', 'pifr_log_old');

  echo "importing pifr_server schema...\n";
  ob_flush();

  exec($command . ' < /home/boombatower/download/pifr_server.sql');

  echo "finished...\n";
  ob_flush();

  print_r($ret);

  exit;
}
boombatower’s picture

Title: Confirm upgrade path with t.d.o data » Confirm update path with t.d.o data
Status: Active » Needs review
StatusFileSize
new6.98 KB

This fixes all the blatant problems. The correct number of rows are in the new tables and scan of data looks good. I'll go through and manually confirm 1 of each type before signing this off.

boombatower’s picture

StatusFileSize
new6.48 KB

Removed debug stuff...and lowered update 6202 to use 75 instead of 100 to be safer.

boombatower’s picture

Committed cleanup, checking data.

boombatower’s picture

pifr_test: title field does not seem to be created...maybe just for file tests?

boombatower’s picture

StatusFileSize
new2.14 KB

Looks good, perhaps get more manually confirmation by updating data on a staging site and asking the community to help compare.

Looks good with this patch.

boombatower’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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