Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test should not read global configuration file #8187

Closed
Preclowski opened this issue Jun 23, 2015 · 9 comments
Closed

Test should not read global configuration file #8187

Preclowski opened this issue Jun 23, 2015 · 9 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@Preclowski
Copy link

Reading config from global configuration file, config.ini.php, occurs in many problems with development. In my opinion separating those configurations may improve development speed and quality and would make tests more reliable.

@diosmosis
Copy link
Member

Tests should only use global.ini.php for most values, see https://github.com/piwik/piwik/blob/master/tests/PHPUnit/Framework/Mock/TestConfig.php#L46 in master.

Please be more specific and provide a failing test if possible.

@Preclowski
Copy link
Author

@diosmosis you have two new plugins that have own archivers

PluginA and PluginB

and while executing tests for PluginA (e.g. API tests), there might be an error thrown by archiver of PluginB

it really makes no sense to execute this logic or to make sure that all additional plugins are disabled before running tests

@diosmosis
Copy link
Member

That is not enough information. It is expected that PluginB would throw an exception failing a test in PluginA, if PluginB is specified in global.ini.php. If it is not, then you will need to provide a failing test, as this is not something I can reproduce.

@quba
Copy link
Contributor

quba commented Jun 23, 2015

@diosmosis both plugins are enabled only in config.ini.php, not in global.

@diosmosis
Copy link
Member

That information does not help me diagnose what is happening in your situation.

@Preclowski
Copy link
Author

@diosmosis When I finish those plugins I will create pull request which will explain this situation.

@mattab
Copy link
Member

mattab commented Jun 23, 2015

When creating a bug report, the minimum is to provide an error message or steps to reproduce the issue. Otherwise it does not help us but it takes us time to try to help and then realise we can't help.

Ideally we always need a way to reproduce an issue before we can decide how to best address the challenge we face.

@mattab
Copy link
Member

mattab commented Jul 15, 2015

@Preclowski can you send more information how to reproduce this issue, as so far we could not reproduce it? by design the tests "should" use global config file, and not use config.ini.php so that local configuration does not affect the result of tests. please let us know if it is not working as expected

@mattab mattab closed this as completed Jul 15, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jul 15, 2015
@mattab
Copy link
Member

mattab commented Jul 15, 2015

Reopen issue if there is any problem, with steps to reproduce (or example test file etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

4 participants