Tester: print tests environment
- Milo
- Nette Core | 1283
Reason
Using a Nette Tester is easy (at least for me). But for a familiarization it
can seem to be tricky, mainly part with default -n
or
-n -c php.ini
options. It would be helpful to show how the
environment really looks from running tests point of view.
Propose
Add new option -i Print environment info
. If runned with this
option, Tester prints and exits:
Nette Tester (v0.0.0)
---------------------
PHP version:
5.5.4 (CGI)
PHP binary:
/home/milo/php/5.5.4/php-cgi
INI files:
/home/milo/tester/php.ini
/etc/php/conf.d/*
Extensions:
core
dom
pdo
pdo_pgsql
...
Implementation
Add new file Tester/Runner/dump-environment.php
which will
contain something like:
echo json_encode(array(
'version' => PHP_VERSION,
'binary' => defined('PHP_BINARY') ? PHP_BINARY : NULL,
'extensions' => get_loaded_extensions(),
...
));
This file will be runned as a Runner\Job
when
tester -i
invoked.
To be discussed
Propose seems to me pretty straightforward, but there is a few things I would like to discuss:
- which next important info sould be printed
- output text sould be short, well, there can be a lot of extensions
- maybe better option name, seems to me waste of short option
-i
for this, on the other hand it is handy and fast to write
Last edited by Milo (2014-02-11 11:36)
- David Grudl
- Nette Core | 8227
Looks great!
Maybe -i
(like info) is better than -e
. And it be
implemented without dump-environment.php
, via
php -r
.
What about write extensions separated by comma?
- Milo
- Nette Core | 1283
David Grudl wrote:
Maybe
-i
(like info) is better than-e
.
Agree, it's better. RFC updated.
And it be implemented without
dump-environment.php
, viaphp -r
.
Unfortunately -r
works with CLI only.
What about write extensions separated by comma?
Sounds good.
Last edited by Milo (2014-01-21 21:23)
- David Grudl
- Nette Core | 8227
@nAS Used ini file is displayed by default:
Nette Tester (v0.9.5)
---------------------
Log: W:\Nette\_nette\tests\test.log
PHP 5.3.6 | "C:\PHP\versions\php-5.3.6\php-cgi.exe" -n -c "W:\Nette\_nette\tests\php-win.ini" | 50 threads
- David Grudl
- Nette Core | 8227
Myslím, že shoda je jednomyslná, takže bude fajn, když to implementuješ.