public function testDynamicAnalysisSummaryUpgrade()
 {
     // Delete the summaries examined by this test.
     $ids = $this->ChildIds;
     $ids[] = $this->ParentId;
     $ids[] = $this->StandaloneBuildId;
     $id_arg = implode(', ', $ids);
     pdo_query("DELETE FROM dynamicanalysissummary WHERE buildid IN ({$id_arg})");
     // Run the upgrade function.
     require_once 'include/upgrade_functions.php';
     PopulateDynamicAnalysisSummaryTable();
     // Verify the summaries are still correct.
     $this->VerifyStandaloneBuild();
     $this->VerifySubProjectBuild();
     $this->pass('Test passed');
 }
Exemple #2
0
        // Also add a new unique constraint to the subproject table.
        if ($db_type === 'pgsql') {
            pdo_query('ALTER TABLE subproject ADD UNIQUE (name, projectid, endtime)');
            pdo_query('CREATE INDEX "subproject_unique2" ON "subproject" ("name", "projectid", "endtime")');
        } else {
            pdo_query('ALTER TABLE subproject ADD UNIQUE KEY (name, projectid, endtime)');
        }
    }
    // Support for subproject path.
    AddTableField('subproject', 'path', 'varchar(512)', 'character varying(512)', '');
    // Remove the errorlog from the DB (we're all log files now).
    pdo_query('DROP TABLE IF EXISTS errorlog');
    // Option to pass label filters from index.php to test pages.
    AddTableField('project', 'sharelabelfilters', 'tinyint(1)', 'smallint', '0');
    // Summarize the number of dynamic analysis defects each build found.
    PopulateDynamicAnalysisSummaryTable();
    // Add index to buildupdate::revision in support of this filter.
    AddTableIndex('buildupdate', 'revision');
    // Store CTEST_CHANGE_ID in the build table.
    AddTableField('build', 'changeid', 'varchar(40)', 'character varying(40)', '');
    // Add unique constraints to the *diff tables.
    AddUniqueConstraintToDiffTables();
    // Set the database version
    setVersion();
    // Put that the upgrade is done in the log
    add_log('Upgrade done.', 'upgrade-2-4');
    return;
}
// When adding new tables they should be added to the SQL installation file
// and here as well
if ($Upgrade) {