pear:qa:ci
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
pear:qa:ci [2011/11/04 10:32] – clockwerx | pear:qa:ci [2012/04/12 23:22] – clockwerx | ||
---|---|---|---|
Line 6: | Line 6: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
- | * [[http:// | + | * [[http:// |
* [[https:// | * [[https:// | ||
- | The helper scripts live at http://svn.php.net/ | + | The helper scripts live at https://github.com/ |
===== Jenkins ===== | ===== Jenkins ===== | ||
Line 15: | Line 15: | ||
==== How do I make sure my tests work? ==== | ==== How do I make sure my tests work? ==== | ||
- | In general, we encourage the use of an AllTests.php - we target PHPUnit 3.4 at this time. | + | In general, we encourage the use of an appropriate phpubnit.xml - we target PHPUnit 3.6 at this time. |
Your package directory layout should allow you to successfully run your test suite as below: | Your package directory layout should allow you to successfully run your test suite as below: | ||
<code bash> | <code bash> | ||
$ cd Foo_Bar/ | $ cd Foo_Bar/ | ||
- | $ php tests/AllTests.php | + | $ phpunit -c phpunit.xml |
</ | </ | ||
- | ... or as per the phpunit command above. | ||
- | |||
- | http:// | ||
==== My directory layout doesn' | ==== My directory layout doesn' | ||
Line 41: | Line 38: | ||
# Run tests to confirm no fatal errors, using one of | # Run tests to confirm no fatal errors, using one of | ||
- | $ php tests/ | ||
$ pear run-tests -r tests/ | $ pear run-tests -r tests/ | ||
$ phpunit tests/ | $ phpunit tests/ | ||
Line 56: | Line 52: | ||
- Making use of PHPUnit' | - Making use of PHPUnit' | ||
- Checking your environment and skipping the test if it cannot run | - Checking your environment and skipping the test if it cannot run | ||
+ | |||
+ | There is also a test mysql instance available. | ||
+ | |||
+ | > Hi Daniel: | ||
+ | > | ||
+ | > On Wed, Nov 16, 2011 at 08:34:04AM +1030, Daniel O' | ||
+ | > > http:// | ||
+ | > > | ||
+ | > > This and a few others obviously need a database to be tested properly. | ||
+ | > > Certainly that machine has mysql on it; or sqlite is probably available - | ||
+ | > > what would be needed to load up an appropriate schema/tear it down after | ||
+ | > > the tests? | ||
+ | > | ||
+ | > I agree and mentioned this on pear-qa a while ago. Take a look at what | ||
+ | > I committed to DB tests yesterday. | ||
+ | > MYSQL_TEST_* environment variables, which are used for PHP's tests. | ||
+ | > should create a test user and database and set those environment | ||
+ | > variables in the cron job, or whatever. | ||
+ | > | ||
+ | > A similar setup should be made for PostgreSQL in PEAR and PHP's unit | ||
+ | > tests. | ||
+ | > | ||
+ | > SQLite3 tests should use ": | ||
+ | > | ||
+ | > Thanks, | ||
+ | > | ||
+ | > --Dan | ||
+ | |||
+ | ==== Build tools ==== | ||
+ | In general, ant is the preferred way of managing a build after a certain level of complexity. See http:// | ||
+ | |||
+ | Noteably, we prefer phpdoc/ | ||
+ | |||
+ | Some packages use phing | ||
+ | |||
+ | ==== Dependencies ==== | ||
+ | There are two available techniques for managing dependencies without installing system wide libraries. | ||
+ | |||
+ | The first is relatively straight forward - simply pulling the library from source and pushing it into a lib directory. | ||
+ | <code bash> | ||
+ | $ git clone git:// | ||
+ | $ git clone git:// | ||
+ | $ phpunit --include-path lib/ | ||
+ | </ | ||
+ | |||
+ | This can be either configured in the jenkins build or (preferred) in the relevant build.xml and phpunit.xml files. | ||
+ | |||
+ | |||
+ | The second is to utilise [http:// | ||
==== Todo ==== | ==== Todo ==== | ||
Line 75: | Line 120: | ||
pear upgrade -f PEAR | pear upgrade -f PEAR | ||
pear upgrade XML_RPC | pear upgrade XML_RPC | ||
- | svn co http://svn.php.net/ | + | git clone git://github.com/ |
cd pear-core/ | cd pear-core/ | ||
</ | </ | ||
Line 87: | Line 132: | ||
* For some tests the executable php-cgi is needed. In some Linux distributions this is contained in a separate package, but on for instance Gentoo Linux this has to be enabled using the cgi USE flag. | * For some tests the executable php-cgi is needed. In some Linux distributions this is contained in a separate package, but on for instance Gentoo Linux this has to be enabled using the cgi USE flag. | ||
* If running on linux, do not run the tests as root | * If running on linux, do not run the tests as root | ||
- | |||
- |
pear/qa/ci.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1