Difference between revisions of "CDash:Testing"

From KitwarePublic
Jump to navigationJump to search
Line 11: Line 11:


* Add a file named CDashTesting/cdash/config.local.php containing:
* Add a file named CDashTesting/cdash/config.local.php containing:
<pre>
<pre>
<?php
<?php
Line 17: Line 18:
?>
?>
</pre>
</pre>
This file is automatically included by CDash's config.php, but only if it exists.


The database has to be named exactly 'cdash4simpletest' for the tests to run. Part of the test suite involves destroying the existing database of that name and re-creating it from scratch. Because the testing of CDash drops and creates the database you need to make sure this database is not being used for any other purpose than self testing. Also, make sure that the $CDASH_DB_LOGIN has enough privileges to create/drop databases on your SQL server.
The database has to be named exactly 'cdash4simpletest' for the tests to run. Part of the test suite involves destroying the existing database of that name and re-creating it from scratch. Because the testing of CDash drops and creates the database you need to make sure this database is not being used for any other purpose than self testing. Also, make sure that the $CDASH_DB_LOGIN has enough privileges to create/drop databases on your SQL server.


* Add a file named CDashTesting/testing/config.test.local.php containing (example values only... adjust to suit your localhost web server):
* Add a file named CDashTesting/testing/config.test.local.php containing (example values only... adjust to suit your localhost web server):
<pre>
<pre>
<?php
<?php
Line 34: Line 38:
?>
?>
</pre>
</pre>
** '''urlwebsite''' is the URL to access the tested installation of CDash. Since simpletest emulates a web browser you need to make sure that the urlwebsite is accessible locally. That is, you should be able to visit this URL in a web browser on the testing machine and see the main CDash page.
 
** '''outputdirectory''' is a directory where the testing output can be stored on the system. Make sure that the current user can write to that directory.
This file is automatically included by CDash's config.test.php, but only if it exists.
** '''type''' is the type of submission for CDash: Nightly, Continuous or Experimental.
 
** '''site''' is the name of the site submitting to CDash.
* '''urlwebsite''' is the URL to access the tested installation of CDash. Since simpletest emulates a web browser you need to make sure that the urlwebsite is accessible locally. That is, you should be able to visit this URL in a web browser on the testing machine and see the main CDash page.
** '''buildname''' is name of the build
* '''outputdirectory''' is a directory where the testing output can be stored on the system. Make sure that the current user can write to that directory.
** '''cdash''' is the URL to the current dashboard. Note that the project should be named CDash, i.e. http://www.cdash.org/CDash/submit.php?project=CDash
* '''type''' is the type of submission for CDash: Nightly, Continuous or Experimental.
** '''svnroot''' is the file system path to your testing installation of CDash. The self testing does an svn update to check what files have changed.
* '''site''' is the name of the site submitting to CDash.
* '''buildname''' is name of the build
* '''cdash''' is the URL to the current dashboard. Note that the project should be named CDash, i.e. http://www.cdash.org/CDash/submit.php?project=CDash
* '''svnroot''' is the file system path to your testing installation of CDash. The self testing does an svn update to check what files have changed.


=== Starting the testing ===
=== Starting the testing ===

Revision as of 14:44, 21 October 2009

CDash integrates a self-testing framework based on Simple Test. The self testing code is located in the CDash/testing directory.

Submitting a CDash Dashboard to the CDash dashboard

Don't worry, it's not a mistake in the title of this section, self-testing involves submitting a CDash submission to CDash.

Configuring the testing

Here are the steps on how to configure the testing:

  • Checkout the CDash source code from the svn repository to a directory named "CDashTesting" in your web server's htdocs folder.
  • Add a file named CDashTesting/cdash/config.local.php containing:
<?php
$CDASH_DB_NAME = 'cdash4simpletest';
$CDASH_TESTING_MODE = true;
?>

This file is automatically included by CDash's config.php, but only if it exists.

The database has to be named exactly 'cdash4simpletest' for the tests to run. Part of the test suite involves destroying the existing database of that name and re-creating it from scratch. Because the testing of CDash drops and creates the database you need to make sure this database is not being used for any other purpose than self testing. Also, make sure that the $CDASH_DB_LOGIN has enough privileges to create/drop databases on your SQL server.

  • Add a file named CDashTesting/testing/config.test.local.php containing (example values only... adjust to suit your localhost web server):
<?php
$configure = array(
  'urlwebsite'       => 'http://localhost/CDashTesting',
  'outputdirectory'  => 'C:/tmp',  // or /tmp or ~/tmp on a Linux/Mac server
  'type'             => 'Nightly',
  'site'             => 'computername.companyname',
  'buildname'        => 'SVN-Win32-xampp',
  'cdash'            => 'http://www.cdash.org/CDash',
  'svnroot'          => 'C:/xampp/htdocs/CDashTesting'
  );
?>

This file is automatically included by CDash's config.test.php, but only if it exists.

  • urlwebsite is the URL to access the tested installation of CDash. Since simpletest emulates a web browser you need to make sure that the urlwebsite is accessible locally. That is, you should be able to visit this URL in a web browser on the testing machine and see the main CDash page.
  • outputdirectory is a directory where the testing output can be stored on the system. Make sure that the current user can write to that directory.
  • type is the type of submission for CDash: Nightly, Continuous or Experimental.
  • site is the name of the site submitting to CDash.
  • buildname is name of the build
  • cdash is the URL to the current dashboard. Note that the project should be named CDash, i.e. http://www.cdash.org/CDash/submit.php?project=CDash
  • svnroot is the file system path to your testing installation of CDash. The self testing does an svn update to check what files have changed.

Starting the testing

Then to launch the tests and submit a dashboard:

 cd CDashTesting/testing
 php5 alltests.php

For xampp installations on Windows, run:

 cd CDashTesting/testing
 C:\xampp\php\php.exe alltests.php

To run the tests in your browser (without submitting a dashboard) visit the URL:

 http://localhost/CDashTesting/testing/alltests.php