[Fusionforge-commits] r10950 - in trunk/tests: . func/Testing scripts

Christian Bayle cbayle at libremir.placard.fr.eu.org
Tue Oct 12 00:38:17 CEST 2010


Author: cbayle
Date: 2010-10-12 00:38:17 +0200 (Tue, 12 Oct 2010)
New Revision: 10950

Added:
   trunk/tests/DEBDebian60Tests.php
   trunk/tests/func/Testing/DEBSeleniumRemoteSuite.php
   trunk/tests/scripts/fusionforge-build-and-test-deb.sh
Log:
Preliminary test suite for debian install, build package, start and stop a vm


Added: trunk/tests/DEBDebian60Tests.php
===================================================================
--- trunk/tests/DEBDebian60Tests.php	                        (rev 0)
+++ trunk/tests/DEBDebian60Tests.php	2010-10-11 22:38:17 UTC (rev 10950)
@@ -0,0 +1,36 @@
+<?php
+if (!defined('PHPUnit_MAIN_METHOD')) {
+	define('PHPUnit_MAIN_METHOD', 'AllTests::main');
+}
+
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+require_once 'func/Testing/DEBSeleniumRemoteSuite.php';
+
+class DEBDebian60Tests
+{
+	public static function main()
+	{
+		PHPUnit_TextUI_TestRunner::run(self::suite());
+	}
+
+	public static function suite()
+	{
+		$suite = new DEBSeleniumRemoteSuite('PHPUnit');
+
+		// Selenium tests
+//		$suite->addTestFiles(glob("func/Site/*Test.php"));
+//		$suite->addTestFiles(glob("func/Trackers/*Test.php"));
+//		$suite->addTestFiles(glob("func/Tasks/*Test.php"));
+//		$suite->addTestFiles(glob("func/Forums/*Test.php"));
+//		$suite->addTestFiles(glob("func/News/*Test.php"));
+//		$suite->addTestFiles(glob("func/PluginsBlocks/*Test.php"));
+		
+		return $suite;
+	}
+}
+
+if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
+	AllTests::main();
+}
+?>

Added: trunk/tests/func/Testing/DEBSeleniumRemoteSuite.php
===================================================================
--- trunk/tests/func/Testing/DEBSeleniumRemoteSuite.php	                        (rev 0)
+++ trunk/tests/func/Testing/DEBSeleniumRemoteSuite.php	2010-10-11 22:38:17 UTC (rev 10950)
@@ -0,0 +1,27 @@
+<?php
+
+require dirname(__FILE__).'/SeleniumRemoteSuite.php';
+
+class DEBSeleniumRemoteSuite extends SeleniumRemoteSuite
+{
+	protected function setUp()
+	{
+		parent::setUp();
+
+///		system("scp -r ../tests root@".HOST.":/usr/share");
+///		system("ssh root@".HOST." 'ln -s gforge /usr/share/src'");
+		
+///		system("scp -rp ~/fusionforge_repo root@".HOST.":");
+///		system("scp -rp ".dirname(__FILE__)."/../../../src/rpm-specific/dag-rpmforge.repo root@".HOST.":/etc/yum.repos.d/");
+
+//		system("scp -rp ".dirname(__FILE__)."/../../../src/rpm-specific/fusionforge-ci.repo root@".HOST.":/etc/yum.repos.d/");
+///		if (getenv('FFORGE_RPM_REPO')) {
+///			system("ssh root@".HOST." 'cd /etc/yum.repos.d/; wget ".getenv('FFORGE_RPM_REPO')."/fusionforge.repo'");
+///		}
+
+		sleep(5);
+		
+///		system("ssh root@".HOST." 'yum install -y fusionforge fusionforge-scmsvn fusionforge-online_help fusionforge-extratabs fusionforge-ldapextauth fusionforge-scmgit fusionforge-blocks'");
+	}
+}
+?>

Added: trunk/tests/scripts/fusionforge-build-and-test-deb.sh
===================================================================
--- trunk/tests/scripts/fusionforge-build-and-test-deb.sh	                        (rev 0)
+++ trunk/tests/scripts/fusionforge-build-and-test-deb.sh	2010-10-11 22:38:17 UTC (rev 10950)
@@ -0,0 +1,43 @@
+#!/bin/sh -x
+
+export CURDIR=`pwd`
+export WORKSPACE=${WORKSPACE:-$CURDIR}
+
+export CONFIG_PHP=func/config.php.buildbot
+export SELENIUM_RC_HOST=192.168.0.204
+export SELENIUM_RC_DIR=$WORKSPACE/reports
+if [ "x${HUDSON_URL}" = "x" ]
+then
+	. tests/openvz/config.default
+	if [ -f tests/openvz/config.`hostname` ] ; then . tests/openvz/config.`hostname`; fi
+	export VEID=$VEIDDEB
+	export IPBASE=$IPDEBBASE
+	export IPDNS=$IPDEBDNS
+	ARCH=`dpkg-architecture -qDEB_BUILD_ARCH`
+	export VZTEMPLATE=debian-$DEBVERS-$ARCH-minimal
+	export VZPRIVATEDIR
+	export SELENIUM_RC_URL=http://`hostname -f`/ws/reports
+	export FFORGE_RPM_REPO=http://`hostname -f`/ws/build/packages
+	export HOST=debian6.local
+	export SELENIUM_RC_HOST=localhost
+else
+	export SELENIUM_RC_URL=${HUDSON_URL}job/$JOB_NAME/ws/reports
+	export FFORGE_RPM_REPO=${HUDSON_URL}job/$JOB_NAME/ws/build/packages
+	export HOST=debian6.local
+fi
+export DB_NAME=gforge
+export CONFIGURED=true
+
+[ ! -d $WORKSPACE/build ] || rm -fr $WORKSPACE/build
+mkdir -p $WORKSPACE/build/packages
+[ ! -d $WORKSPACE/reports ] || rm -fr $WORKSPACE/reports
+mkdir -p $WORKSPACE/reports/coverage
+
+make -f Makefile.debian BUILDRESULT=$WORKSPACE/build/packages rsqueeze
+
+cd tests
+phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml DEBDebian60Tests.php
+
+cd ..
+cp $WORKSPACE/reports/phpunit-selenium.xml $WORKSPACE/reports/phpunit-selenium.xml.org
+xalan -in $WORKSPACE/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $WORKSPACE/reports/phpunit-selenium.xml


Property changes on: trunk/tests/scripts/fusionforge-build-and-test-deb.sh
___________________________________________________________________
Added: svn:executable
   + *




More information about the Fusionforge-commits mailing list