ousamabenyounes / log2test
Transorm your Apache2 Access log files to simple curl or selenium/phpunit tests...
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 24
Watchers: 3
Forks: 3
Open Issues: 5
Language:JavaScript
Requires
- php: ^5.6 || ^7.0
- cedriclombardot/twig-generator: ^1.1
- incenteev/composer-parameter-handler: ~2.0
- jasny/twig-extensions: ^1.0
- kassner/log-parser: ~1.0
- phpunit/phpunit: 5.5.*
- phpunit/phpunit-selenium: >=1.2
- symfony/console: ^3.1
- symfony/filesystem: ^3.1
- symfony/process: ^3.1
- symfony/yaml: ^3.1
Requires (Dev)
- behat/behat: ^3.2
- phake/phake: @stable
- symfony/var-dumper: ^3.0
README
Log2Test is a PHP application that allows you to transform your Production Log into test.
You can export your log to the following stack:
- Curl: Php Multi Curl Test => A good solution if you have huge apache2 log file or if you don't need to run JavaScript or Ajax calls
- PhpunitCurl: Phpunit Curl test
- PhpunitSelenium: Allows you to open all your log file urls' on defined browsers you need to test
Why exporting your production log files to tests?
- Be able to find broken links
- Detect Blank/Empty web pages (When a 500 error occurs and no error redirection page is enabled)
- Before deploying new features to production, you can easily launch real tests on your pre-production environment
- Launching all your access log on different browsers with Selenium allows you to validate Cross Browser Compatibility
Install
git clone https://github.com/ousamabenyounes/log2test
composer install
How to use
Let's now see how Log2Test works step by step as seen on the screencast gif file bellow
- At the beginning, there are no existing tests in the "generated/Curl" directory
- Given this context:
- A configuration file (Yaml File) -> config/parameters-log2test.yml
- An Apache2 Access Log file -> log/test.log
- Running ./bin/log2test command will generate and run all your tests
Configuration
Open configuration file:
config/parameters-log2test.yml
Here are all the configuration file's properties:
Requirements
Phpunit
Selenium Server (only needed if you choose phpunit_selenium as your test stack)
Test
Log2test is tested with PHPUNIT & Behat
./bin/phpunit
./bin/behat
On each commit, a complete build is launched on http://travis-ci.org/ousamabenyounes/log2test/
Host Sample
You can provide a simple strings like this:
"www.shop2tout.com"
You can also provide an array with source / destination value
["www.shop2tout.com", "www.shop2tout.local"],
The first case is the source host you will be searching on your apache logs
The second case is the destination host which will be used on generated tests
We recommend using the second format, so your production website is not affected by the heavy tests you'll launch'
Todo
Add Global Reporting
Add YellowLabTools option on parsing
Contributors
- Ousama Ben Younes ousamabenyounes
- Youval Teboul youvalteboul