Testing won't reset config.php

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
Senky
Former Team Member
Posts: 2300
Joined: Thu Apr 30, 2009 8:49 pm
Name: Jakub
Contact:

Testing won't reset config.php

Post by Senky »

Is it only me, or phpBB really does not reset config.php to previous state after tests are finished? I test my extension, so here is what I call:
~/www/ad/phpBB/vendor/bin/phpunit -c ~/www/ad/phpBB/ext/phpbb/ads/phpunit.xml.dist
Tests use ~/www/ad/tests/test_config.php, generating new ~/www/ad/phpBB/config.php with proper config to be used while testing. But after that, it won't revert ~/www/ad/phpBB/config.php back to original state, so I am unable to use my board in browser again until I replace config with original one.
‎‏‏ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‎‏‏‎ ‎ ‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎🔔
Browser & Mobile Notifications Extension
Now with Safari (both macOS and iOS) support!
webhostuk
Registered User
Posts: 21
Joined: Tue Apr 13, 2010 1:11 pm
Location: UK
Contact:

Re: Testing won't reset config.php

Post by webhostuk »

I feel its more of server permission issue here. I guess the user is not getting overwrite permission.
WebhostUK.Co.UK | Best UK web Hosting
Webhost.US.Com | Best US Web Hosting
99.99% guaranteed uptime with 24/7 support
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Testing won't reset config.php

Post by 3Di »

Care to explain your development stack?
I mean, are you developing with what and where.

:)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Senky
Former Team Member
Posts: 2300
Joined: Thu Apr 30, 2009 8:49 pm
Name: Jakub
Contact:

Re: Testing won't reset config.php

Post by Senky »

webhostuk wrote: Wed Jun 21, 2017 12:24 pm I feel its more of server permission issue here. I guess the user is not getting overwrite permission.
So it revers config for you?

3Di wrote: Wed Jun 21, 2017 12:32 pm Care to explain your development stack?
I mean, are you developing with what and where.

:)
Sure! It's Apache/2.4.25, PHP 5.6.30, MariaDB 15.1 - all installed via Homebrew on Mac. No MAMP or similar.
‎‏‏ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‎‏‏‎ ‎ ‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎🔔
Browser & Mobile Notifications Extension
Now with Safari (both macOS and iOS) support!
rxu
Extensions Development Team
Posts: 3711
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Contact:

Re: Testing won't reset config.php

Post by rxu »

Just looked at the code https://github.com/phpbb/phpbb/blob/mas ... #L282-L292 and it seems that config.php is only being renamed to config_dev.php before the board got installed for tests.
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5859
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: Testing won't reset config.php

Post by MattF »

After running functional tests locally you must manually copy the config_dev.php contents back into your config.php file.

It's mentioned in the testing docs, at the end:
https://github.com/phpbb/phpbb/blob/mas ... #running-1
This will change your board's config.php file, but it makes a backup at config_dev.php, so you can restore it after the test run is complete.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
Senky
Former Team Member
Posts: 2300
Joined: Thu Apr 30, 2009 8:49 pm
Name: Jakub
Contact:

Re: Testing won't reset config.php

Post by Senky »

Thanks for your explanations! I expected it to return config to original value, but a simple script will do it as well.
‎‏‏ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‎‏‏‎ ‎ ‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎🔔
Browser & Mobile Notifications Extension
Now with Safari (both macOS and iOS) support!
Post Reply

Return to “Extension Writers Discussion”