Git Product home page Git Product logo

phprack's Introduction

DevOps By Rultor.com

Build Status PDD status Hits-of-Code

Read about phpRack in ​php|Architect June 2010: "Integration Testing with phpRack Framework".

phpRack is a light framework for automation of integration tests. By integration tests we mean software modules that should be executed in the production environment, in order to validate that said environment is configured as expected. For example your product is a web2.0 application which depends on proper configuration of PHP, Apache, MySQL and availability of YouTube, Flickr and GoogleMaps API's. Your product is properly tested with unit tests (obviously you're using stubs for said services and components). When the product is deployed to the production environment, you want to be sure that the services you need are configured and available. If they are not — you want to get a notification about it before your end-users. And you want to get a detailed notification.

This is when phpRack is mandatory. You shall add phpRack to your project, and write a number of tests. All these tests will be executed when requested and will produce a detailed report, both only and by email. It will save you a lot of time during deployment and later, during maintenance of your product.

Quick Start

To start using phpRack you should do three operations:

  • Upload phpRack library to your server
  • Create phprack.php file in your public_html directory
  • Create PHP integration tests in your rack-tests directory

Let's do them one by one:

Upload phpRack library

Download ZIP archive of phpRach and unpack it to public_html/phpRack or some other directory on your production server.

Create phprack.php

You should create phprack.php in your project's public directory (see full reference), e.g.:

<?php
// this param is mandatory, others are optional
$phpRackConfig = array(
    'dir' => '../rack-tests',
);
// absolute path to the bootstrap script on your server
include '../library/phpRack/bootstrap.php';

Create integration tests

Write integration tests in the directory rack-tests, each one has to extend the class PhpRack_Test (see full list of assertions). For example, file MyTest.php:

<?php
class MyTest extends phpRack_Test
{
    public function testPhpVersionIsCorrect()
    {
        $this->assert->php->version
            ->atLeast('5.2');
    }
    public function testPhpExtensionsExist()
    {
        $this->assert->php->extensions
            ->isLoaded('xsl')
            ->isLoaded('simplexml')
            ->isLoaded('fileinfo');
    }
}

Go to this URL: http://your-website-url/phprack.php and enjoy. Try this link to see what you're going to see on your site: ​http://www.phprack.com/phprack.php.

How to contribute?

First, fork our repository and clone it to your local machine and install Vagrant. Then, run:

vagrant up

A virtual machine with pre-installed requisites will be ready in a few minutes. Login to it and go to /vagrant directory:

vagrant ssh

Then, in the virtual machine run:

phing

All tests should pass. If you see any problems, please submit an new issue to us.

After you make your changes don't forget to run phing again to make sure you didn't break anything. When ready, submit a pull request.

phprack's People

Contributors

bitdeli-chef avatar gamesh avatar kkamkou avatar netcoderpl avatar pavlotitenok avatar renovate[bot] avatar siad007 avatar yegor256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

phprack's Issues

to send runSuite() results by email to site admin

migrated from Trac, where originally posted by yegor256 on 26-Mar-2010 12:20pm

we should allow site admin to receive test results by email if necessary:

#!php
<?php
// Global variable with params required by PhpRack bootstrap script
$phpRackConfig = array(
    'notify' => array(
        'email' => array(
            'transport' => array(
                'class' => 'smtp',
                'host' => 'smtp.gmail.com',
                'port' => '25',
                'username' => 'alex',
                'password' => 'j7L9Kj8H',
            ),
            'recipients' => '[email protected]' // notify this email when tests fail
        ),
    ),
    'dir' => '../rack-tests',
);
include '../library/phpRack/bootstrap.php';

When phpRack_Runner::runSuite() finds some errors, it shall try to send a report to the emails specified.

empty JSON is not rendered at all

migrated from Trac, where originally posted by yegor256 on 17-Mar-2010 7:20am

motivated by #2

when JSON is absolutely empty (zero bytes), our front page doesn't indicate anything. running… message is staying still and is not changing. I suppose this can be fixed.

can you fix it in 1 hour? if yes, please proceed. if no, please estimate the task.

maximum number of connections in Apache - why?

migrated from Trac, where originally posted by yegor256 on 22-Mar-2010 2:43pm

see also #2, #14, #23

our hoster (hostgator.com) has a limitation of 25 concurrent connections on shared hosting plan. and for some reason we reach this amount very soon, just by a simple reloading of a front page (with 5-6 tests).

maybe there is a "leak of connections"? maybe our JS module establishes more connections to the server than necessary? and why they stay open? any ideas?

index.js shall pass JsLint validation

migrated from Trac, where originally posted by yegor256 on 30-Mar-2010 11:25am

jsLint validation shall be passed with index.js

now we have many syntax errors there.

additional logging in file(...) operations

migrated from Trac, where originally posted by yegor256 on 26-Mar-2010 8:49am

we need to enable additional header in file(..) operations. I assume it can be done in 1 hour. if yes, please proceed.

assert->php->pear->package(…)->… to implement

migrated from Trac, where originally posted by yegor256 on 30-Mar-2010 9:04am

we need to implement PEAR validator:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testPearPackages()
    {
        $this->assert->php->pear
            ->package('HTTP_Client') // package exists
            ->atLeast('1.2.2') // at least this version is present
            ->isAlive(); // here we should test that it really works
    }
}

when we validate the existence of a package, we should validate that PEAR is installed and configured properly.

to format defective JSON properly

migrated from Trac, where originally posted by yegor256 on 16-Mar-2010 2:09pm

this ticket is motivated by #2

Would be nice to format defective JSON better. Too long lines shall be wrapped, something similar to PHP wordwrap() should be used. Maximum width shall be 100 symbols. This is only for defective JSON.

Can you fix it? Please, estimate the task.

to implement Views renderer

migrated from Trac, where originally posted by j.derda on 17-Mar-2010 12:22am

Currently phpRack_View is able to render only one specific file and needs phpRack_Runner as an argument of constructor (which is not used). Ability to render other views is needed for finishing implementation of #8

self-reloading tests

migrated from Trac, where originally posted by yegor256 on 22-Mar-2010 10:58am

would be nice to have an ability to ask a test to reload itself every 5-10-.. seconds, when it's rendered in web. this way we can show a tail() of some log file, and make it auto-reloading. very useful function would be.

something like this:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testShowLog()
    {
        $this->_setAjaxOptions(
            array(
                'reload' => 5, // every 5 seconds, if possible
            )
        );
        $this->assert->disc->file
            ->tail('/../log.txt', 20);
    }
}

if you can implement it in 1 hour, please go ahead. if not, please estimate first.

->network->url->curl(…) to implement

migrated from Trac, where originally posted by yegor256 on 17-Mar-2010 7:38am

We should implement this assertion:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testUrlIsAccessible()
    {
        // validate that the URL is accessible
        $this->assert->network->url->
            ->url('http://www.google.com') // set URL (and validate it here)
            ->regex('/google\.com/'); // make HTTP call and find pattern in result
    }
}

thus, we will be able to ping our own URL and make sure that the site is still alive.

to enable execution of the framework from one-time HTTP request

migrated from Trac, where originally posted by yegor256 on 4-Mar-2010 5:59pm

Now we deliver framework result suitable for viewing in web browser (using AJAX). On the other hand, it will be very convenient to use it together with phing HttpRequestTask (see [http://phing.info/trac/ticket/443]).

We should enable such interaction with phpRack: one HTTP GET request, one long result (in plain text, XML, or JSON, depending on the Accept-Result apache header of the request). This result shall include log of all tests executed in one suite. And if all tests are successful, the result shall include some specific text line, like TEST FINISHED or TEST FAILED.

assert->shell->ps() to implement

migrated from Trac, where originally posted by yegor256 on 12-Mar-2010 1:28pm

We should implement this assertion:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testProcesses()
    {
        // view full list of processes on the server
        $this->assert->shell->ps();
    }
}

as usual, this should work both in Linux and in Windows. we should see a full list of processes running now on the server.

php->pear->showList() to implement

migrated from Trac, where originally posted by yegor256 on 30-Mar-2010 11:35am

motivated by #37

to show full list of PEAR packages:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testShowPearPackages()
    {
        $this->assert->php->pear
            ->showList(); // show full list of installed packages
    }
}

besides package names we should show their versions, dates, etc.

as much information as possible

to introduce and implement database related assertions

migrated from Trac, where originally posted by yegor256 on 12-Mar-2010 8:04am

We should implement this assertion, for databases:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDatabase()
    {
        // we validate that the DB is accessible
        $this->assert->db->mysql
            ->connect($host, $port, $username, $password) // we can connect
            ->dbExists($dbname) // DB exists
            ->tableExists('user'); // table "user" exists
    }
}

maybe some other assertions? so far looks like these set will be sufficient.

and we should keep in mind that we will have other databases, besides mysql and all of them should work in similar way. thus, would be nice to have some abstract package and a number of inherited "children".

assert->cpu->load->...() to implement

migrated from Trac, where originally posted by yegor256 on 16-Mar-2010 2:42pm

We should implement this assertion, which will help to check server loading situation:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testServerIsNotOverloaded()
    {
        // load average at the moment is less than 5.0
        $this->assert->cpu->load
            ->isBelow(5.00);
    }
}

I'm not sure how this could (or couldn't) work in Windows environment...

db->mysql->query(...) to implement

migrated from Trac, where originally posted by yegor256 on 12-Mar-2010 1:17pm

when ticket #6 is implemented, we should implement this:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDatabaseQuery()
    {
        // we show the entire schema of the DB
        $this->assert->db->mysql
            ->connect($host, $port, $username, $password) // we connect
            ->dbExists($dbname) // we use this DB
            ->query('SELECT * FROM user LIMIT 5'); // query and return result
    }
}

in the result of this query() call we should receive data returned to us by MySQL. we should try to format it with tabs and spaces, to make them look convenient for reader.

Small redesign of phprack face

migrated from Trac, where originally posted by kkamkou on 31-Mar-2010 11:12am

I propose to center content. then to move entries into table and make OK and FAILURE as images. At the left side add image like: refresh.

And remove .php extension from script name

LOGO

| refresh | Db/MysqlTest | OK |

to implement HTTP authentication

migrated from Trac, where originally posted by yegor256 on 12-Mar-2010 1:12pm

We declare now that phpRack front page could be HTTP-auth protected, but it doesn't work so far, and is not implemented. Should be implemented, like this:

#!php
<?php
// Global variable with params required by PhpRack bootstrap script
$phpRackConfig = array(
    'auth' => array(
        'username' => 'alex',
        'password' => 'j7L9Kj8H',
    ),
    'dir' => '../rack-tests',
);

// absolute path to the bootstrap script
include '../library/phpRack/bootstrap.php';

Provided username and password shall work for the front page and for AJAX calls.

sample file-related assertions: disc->file->…(filename)

migrated from Trac, where originally posted by yegor256 on 12-Mar-2010 8:15am

in addition to #5 we would need these assertions:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testFile()
    {
        $file = '/../../application/test.txt';

        $this->assert->disc->file
            ->exists($file) // this file exists
            ->isReadable($file) // it is readable
            ->isWritable($file) // it is writable
            ->isDir($file); // it is a directory
    }
}

maybe something else?

disable automatic AJAX start of tests

migrated from Trac, where originally posted by yegor256 on 22-Mar-2010 11:00am

motivated by #24

some tests take good enough of server CPU resource (like php lint of all PHP files, for example), and we don't want such tests to start automatically when the front page is loaded. thus, would be nice to have this option:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testShowLog()
    {
        $this->_setAjaxOptions(
            array(
                'autoStart' => false, // true by default
            )
        );
        $this->assert->php->lint('./');
    }
}

if you can implement it in 1 hour, please go ahead. if not, please estimate first.

AJAX calls shall be consequent, not concurrent

migrated from Trac, where originally posted by yegor256 on 20-Mar-2010 9:32am

motivated by #20

our AJAX calls shall be consequent, not concurrent. mostly because of possible limitations of apache.

if you can fix it in 1 hour, please go ahead. otherwise, please provide your estimate.

->cpu->performance->atLeast(…) to implement

migrated from Trac, where originally posted by yegor256 on 16-Mar-2010 7:53pm

motivated by #15

We should implement this assertion, which will help to check whether the server we have is sufficient for our tasks. whether it is fast enough:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testServerIsFast()
    {
        // CPU performance is higher than 3.40
        $this->assert->cpu->performance
            ->atLeast(3.40);
    }
}

I'm not sure how we should measure the performance and what scale to use, but we should do it somehow… I will try to find some industry metrics.

invalid regex shall be detected

migrated from Trac, where originally posted by yegor256 on 26-Mar-2010 1:39pm

see #21

consider the following example:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testUrlIsAccessible()
    {
        // validate that the URL is accessible
        $this->assert->network->url->
            ->url('http://www.google.com')
            ->regex('google.com'); // this is NOT a regex
    }
}

now it fails, and says that the regex is absent. we should do either:

  1. raise a defect because of invalid regex
  2. try to use it as a plain text pattern, not regex

I would prefer to use the second option. And add a message to the log that the regex is not valid, but is good as a pattern.

refactoring of phpRack_Package_Network_Ports::isOpen()

migrated from Trac, where originally posted by yegor256 on 23-Mar-2010 8:01am

There is a problem in phpRack_Package_Network_Ports::isOpen() (see source code). We should refactor this method and use phpRack_Adapters_Url (together with PHP sockets).

to implement file->tailf(...)

migrated from Trac, where originally posted by yegor256 on 24-Mar-2010 12:17pm

combination of #24 and #5

we should implement this assertion:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testShowLog()
    {
        $this->assert->disc->file
            ->tailf('/../log.txt', 20);
    }
}

this assertion will set ajaxOptions (see #24) to 'reload' immediately (once finished), and will show the last 20 lines of the file.

connection time out in CURL

migrated from Trac, where originally posted by yegor256 on 26-Mar-2010 1:42pm

see #21.

after 5 seconds of waiting it says "connection timed out" and we don't give a user an ability to change options of phpRack_Adapters_Url. I consider it as a defect.

phpRack_Adapters_Config_Ini to implement

migrated from Trac, where originally posted by yegor256 on 12-Apr-2010 7:22am

Would be nice to optimize this code:

#!php
<?php
class MysqlTest extends PhpRack_Test
{
    public function testConnections()
    {
        $ini = parse_ini_file(APPLICATION_PATH . '/config/app.ini', true);
        $production = $ini['production : global'];
        $this->assert->db->mysql
            ->connect(
                'localhost',
                3306,
                $production['resources.db.params.username'],
                $production['resources.db.params.password']
            )
            ->dbExists($production['resources.db.params.dbname'])
            ->showConnections();
    }
}   

to something like this:

#!php
<?php
class MysqlTest extends PhpRack_Test
{
    public function testConnections()
    {
        $ini = new phpRack_Adapters_Config_Ini(
            APPLICATION_PATH . '/config/app.ini',
            'production'
        );
        $this->assert->db->mysql
            ->connect(
                'localhost',
                3306,
                $ini->resources->db->params->username,
                $ini->resources->db->params->password
            )
            ->dbExists($ini->resources->db->params->dbname)
            ->showConnections();
    }
}   

In other words, we should allow our users to get params from their custom INI files.

db->mysql->showStats(...) to implement

migrated from Trac, where originally posted by yegor256 on 26-Mar-2010 11:33am

we should implement this:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDatabaseStats()
    {
        // we show the entire schema of the DB
        $this->assert->db->mysql
            ->connect($host, $port, $username, $password) // we connect
            ->dbExists($dbname) // we use this DB
            ->showStats(); // full stats of all tables
    }
}

in the result of this showStats() call we should receive a full list of tables with summary statistic for every table, like total number of rows, size of table on disc, etc.

everything that MySQL can give us.

"stop test" doesn't work in Safari

migrated from Trac, where originally posted by yegor256 on 13-Apr-2010 2:57pm

see #36

When I click "click to stop" nothing happens. I tested with Safari 4.0.5 in Mac OS Snow Leopard.

The same function works fine on the same computer, but with Firefox.

AJAX reloading of individual tests

migrated from Trac, where originally posted by yegor256 on 13-Mar-2010 9:09am

we should enable AJAX reloading of any individual test by means of clicking the name of the test. AJAX call will be re-initiated and result rendered again.

disc->showDirectory(…) shall accept 'maxDepth' param

migrated from Trac, where originally posted by yegor256 on 6-Apr-2010 9:47am

We shall be able to provide maxDepth param:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testViewFiles()
    {
        $this->assert->disc->showDirectory(
             '.', 
             array(
                 'maxDepth' => 2,
             )
        );
    }
}

This param means the maximum depth level to be visible. This param is more powerful than exclude.

to give an ability to stop a test in AJAX mode

migrated from Trac, where originally posted by yegor256 on 26-Mar-2010 1:47pm

we should give user an ability to stop long-running test in AJAX mode. when running (xx:xx)… message is visible the user shall be able to click it (right this message) and the test shall be stopped, as "failure".

to enable making SSL a mandatory protocol for web front

migrated from Trac, where originally posted by yegor256 on 8-Apr-2010 11:17am

We should enable a new option onlySSL:

#!php
<?php
$phpRackConfig = array(
    'auth' => array(
        'username' => 'alex',
        'password' => 'j7L9Kj8H',
        'onlySSL' => true,
    ),
    'dir' => '../rack-tests',
);

When it is set to TRUE (false by default), we should disable any interaction through web panel, if the protocol is not SSL.

php->lint() assertion to implement

migrated from Trac, where originally posted by yegor256 on 11-Mar-2010 6:30pm

We should implement this assertion:

#!php
<?php
class PhpConfigurationIsValidTest extends PhpRack_Test
{
    public function testPhpLint()
    {
        $options = array(
            'extensions' => 'php,phtml',
            'exclude' => '/\.svn/',
        );
        // lint validation of all files in the directory
        $this->assert->php->lint('/../../application', $options);
    }
}

php -l will be executed for every PHP file in the given directory and problems will be reported. Options shall be provided in second param.

properly render invalid JSON reply

migrated from Trac, where originally posted by yegor256 on 4-Mar-2010 6:02pm

When reply from server doesn't contain valid JSON (for example because of a fatal PHP error in the code) our AJAX just crashes.

This is not a correct behavior. We should display the text in any case.

tailf() should keep the latest N lines on the screen forever

migrated from Trac, where originally posted by yegor256 on 8-Apr-2010 12:26pm

motivated by #28

tailf() should keep the latest N lines ($linesCount) forever on the screen. otherwise, the log goes out and in order to keep it back I need to reload the entire web front.

to implement db->mysql->version->atLeast(...)

migrated from Trac, where originally posted by yegor256 on 25-Mar-2010 8:49am

motivated by #6

we should enable validation of MySQL version:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDatabaseVersion()
    {
        $this->assert->db->mysql
            ->connect($host, $port, $username, $password) // we can connect
            ->version->atLeast('5.0');
    }
}

js on-fly minification

migrated from Trac, where originally posted by yegor256 on 14-Apr-2010 9:18am

motivated by #45

we should do something with JS "minification". now we push a raw JS code to the browser, including comments. not a correct behavior. what are the options? (static minification is out of question).

Invalid ajax request on win os

migrated from Trac, where originally posted by kkamkou on 14-Mar-2010 1:15pm

On windows platform "phpRack" tests will not start, because path with only one "" will be omitted.

For example:
'div#d1': 'D:.work...\rack-tests\PhpConfigurationTest.php' will be: "D:.work...rack-testsPhpConfigurationTest.php"

bug in: phpRack/layout/layout.phtml

behavior of JS timer shall be altered a bit

migrated from Trac, where originally posted by yegor256 on 16-Mar-2010 6:45pm

ticket is motivated by #12

behavior of running timer should be altered a bit. right now we don't see the timer from the first load of the page. user shall click the name of the test to start a timer. this is not correct. we should start the timer when the test is started. and indicate it either when time is over 5 seconds or when the user clicked the name of the test.

can you make such a change? if yes, please estimate this task.

->mysql->showConnections() to implement

migrated from Trac, where originally posted by yegor256 on 30-Mar-2010 10:47am

motivated by #31

we should implement this:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDatabaseConnections()
    {
        $this->assert->db->mysql
            ->connect($host, $port, $username, $password) // we connect
            ->showConnections(); // full list of currently open connections
    }
}

in the result of this showConnections() call we should receive a full list of currently open connections to the server. this log will be very useful in combination with dynamic AJAX reloader.

db->mysql->showServerInfo() to implement

migrated from Trac, where originally posted by yegor256 on 11-Apr-2010 6:11am

we should allow our users to see full information about all databases on the server, like full list of them, how many tables in every one, how much space every one takes, what users are registered on the server, etc.

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDbInfo()
    {
        $this->assert->db->mysql
            ->connect($host, $port, $username, $password) // we connect
            ->showServerInfo(); // full information about MySQL server
    }
}

I think that this information is mandatory:

  • full list of databases + size in bytes, number of tables
  • full list of users + their permissions
  • mysql server version
  • global config options

maybe something else?

timezone setting shall be configured

migrated from Trac, where originally posted by yegor256 on 11-Mar-2010 4:27pm

Right now we use time() or date() methods and this problems comes out when PHP is not configured properly:

phpRack error (2): date(): It is not safe to rely on the system's timezone
settings. You are *required* to use the date.timezone setting or
the date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected 'America/New_York'
for 'EST/-5.0/no DST' instead, 

we should configure timezone every time we start phpRack testing cycle. and we should NOT override system settings, but validate their existence first.

Daniel, what do you think? possible? can you estimate?

disc->file->...() assertions to implement

migrated from Trac, where originally posted by yegor256 on 11-Mar-2010 7:51pm

we should implement this simple assertion:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testFileExists()
    {
        // show the content of the file
        $this->assert->disc->file->cat('/../../application/test.txt');

        // show tail of the file, 100 last lines
        $this->assert->disc->file->tail('/../../application/test.txt', 100);

        // show head of the file, 30 first lines
        $this->assert->disc->file->head('/../../application/test.txt', 30);
    }
}

This assertion will be very helpful in viewing of log files or some other system files, which are important.

suites of tests

migrated from Trac, where originally posted by yegor256 on 12-Apr-2010 12:19pm

Would be nice to have an ability to use pre-defined configurable suites of tests, for example:

#!php
<?php
/**
 * file name is rack-tests/MySuite.php
 */
class MySuite extends PhpRack_Suite
{
    protected function _init()
    {
        $this->_addSuite('ServerHealth');
        $this->_addSuite(
            'DatabaseHealth', 
            array(
                'url' => 'jdbc:mysql://localhost:3306/test?username=test&password=test'
            )
        );
        $this->_addSuite('PHP5');
        $this->_addTest(
            'LogViewer',
            array(
                'file' => APPLICATION_PATH . '/../../my.log',
            )
        );
    }
}

Suite is a collection of tests, which is configured on-fly. Runner finds such a suite and gets tests from it. And use these tests as if they were defined in individual classes/files.

We will defined these tests and sub-suites inside phpRack, and users will be able to use them, without a necessity to create custom tests in every project. When you have 10 projects, you have to replicate test files in all of them. It's very error-prone. The explained suite approach will help to avoid such a redundancy.

HTML compression to implement

migrated from Trac, where originally posted by yegor256 on 10-Apr-2010 8:21am

we should implement phpRack_View::compressedHtml() properly, in order to remove all comments from our HTML and reduce its size (by removing unnecessary spaces).

if you can do it in 1 hour, please go ahead.

when test is running log should not be visible

migrated from Trac, where originally posted by yegor256 on 18-Mar-2010 6:51pm

when test is just started, and is still running - I click the label running… with timer and I see the log sliding down, with empty content.

this should not happen, nothing should be scrolled down. can you fix this?

cancelled test shall stop on server

migrated from Trac, where originally posted by yegor256 on 29-Mar-2010 3:46pm

when I cancel a test in web (clicking ESC), the server-side operation is running.

we need to fix it, and to ensure that when the front is stopped (connection is closed), the server part stops immediately.

db->mysql->showSchema() to implement

migrated from Trac, where originally posted by yegor256 on 12-Mar-2010 1:15pm

when ticket #6 is implemented, we should implement this:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDatabaseSchema()
    {
        // we show the entire schema of the DB
        $this->assert->db->mysql
            ->connect($host, $port, $username, $password) // we connect
            ->dbExists($dbname) // we use this DB
            ->showSchema(); // full schema is visible
    }
}

in the result of this showSchema() call we should receive a full list of tables, views, stored procedures, triggers. for every table we should see it's CREATE TABLE text. also we should see for every table the number of rows it contains. and maybe some other information, if possible.

disc->performance->atLeast(…) to implement

migrated from Trac, where originally posted by yegor256 on 16-Mar-2010 8:08pm

motivated by #17

We should implement this assertion, which will help to check whether the disc we have is sufficiently fast for our tasks:

#!php
<?php
class MyTest extends PhpRack_Test
{
    public function testDiscIsFast()
    {
        // Disc performance is higher than 3.40
        $this->assert->disc->performance
            ->atLeast(3.40);
    }
}

I'm not sure how we should measure the performance and what scale to use, but we should do it somehow… I will try to find some industry metrics.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.