Running the "normal" phpBB tests with my extension enabled

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
gothick
Registered User
Posts: 69
Joined: Sat Apr 21, 2007 7:20 am
Name: Matt Gibson
Contact:

Running the "normal" phpBB tests with my extension enabled

Post by gothick »

Hi,

Is there a way of running the full, normal phpBB test suite with my extension activated? The extension I'm developing shouldn't really change anything in the normal "flow" of phpBB, so it struck me that it would be a good reassurance if I could run the phpBB tests with it enabled and make sure the results were the same as when it's not...

Thanks,

Matt

(PS: Sorry if this has been asked before; my Google-fu appears to be failing me today!)
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53412
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Running the "normal" phpBB tests with my extension enabled

Post by Brf »

What is a "full, normal phpBB test suite"?
What are "the results"?
User avatar
gothick
Registered User
Posts: 69
Joined: Sat Apr 21, 2007 7:20 am
Name: Matt Gibson
Contact:

Re: Running the "normal" phpBB tests with my extension enabled

Post by gothick »

Ah, sorry, perhaps an example might help. For example, if I pull the latest phpBB 3.2.x from git, install the composer dependencies, set up a functional testing URL in the appropriate environment variable and run:

Code: Select all

phpBB/vendor/bin/phpunit --group __nogroup__,functional
...it will run what I was thinking of as a "full, normal phpBB test suite". By "the results" I mean the output thereof (i.e. in a perfect world, the success of all tests.)

So what I'm saying is, having run that once, "out of the box", I'd like to run it again, with the only difference being that my extension is enabled, on the grounds that the results *should* be the same, but if I've written some bad code in my extension somehow, perhaps they won't be.

I'm wondering if there is a standard way of doing that.

Regards,

Matt
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Running the "normal" phpBB tests with my extension enabled

Post by david63 »

David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
gothick
Registered User
Posts: 69
Joined: Sat Apr 21, 2007 7:20 am
Name: Matt Gibson
Contact:

Re: Running the "normal" phpBB tests with my extension enabled

Post by gothick »

david63 wrote: Mon Sep 25, 2017 6:31 am Is this of any help? - https://area51.phpbb.com/docs/dev/3.2.x ... sting.html
Any particular bit you had in mind? It does mention how to make sure my extension is loaded when running my own functional tests, but that doesn't seem to give me a way of running phpBB's own tests with my extension enabled.

Matt
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53412
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Running the "normal" phpBB tests with my extension enabled

Post by Brf »

gothick wrote: Mon Sep 25, 2017 5:46 am

Code: Select all

phpBB/vendor/bin/phpunit --group __nogroup__,functional
Never heard of it. I am not even seeing that folder in the phpBB 3.2.1 download.
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Running the "normal" phpBB tests with my extension enabled

Post by RMcGirr83 »

Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
Elsensee
Former Team Member
Posts: 124
Joined: Sat May 07, 2011 11:04 am
Location: Hamburg, Germany
Name: Oliver Schramm
Contact:

Re: Running the "normal" phpBB tests with my extension enabled

Post by Elsensee »

I believe you are better up with asking this question on area51 discussion board. (for the future at least ;) )

Also I don't believe that this is possible. The default test suite doesn't know about extensions. So I believe you have to code your own tests, but there are examples in the repositories of the official extensions by the phpBB Extensions Team.
Former Development Team Member
I don't make bugs - I make features
rxu
Extensions Development Team
Posts: 3712
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Contact:

Re: Running the "normal" phpBB tests with my extension enabled

Post by rxu »

In theory, if you fork phpbb/phpbb repository, put your extension there and run tests, your extension should be enabled during tests (on phpBB installation step) so tests would run with the extension enabled.
It's not guaranteed though as phpBB seems to be handling this in some random way.
User avatar
gothick
Registered User
Posts: 69
Joined: Sat Apr 21, 2007 7:20 am
Name: Matt Gibson
Contact:

Re: Running the "normal" phpBB tests with my extension enabled

Post by gothick »

Thanks for the tips, all. I think it seems like this is an idea I should give up on :) I'll just do my best to cover the places where I think my code could break the system, perhaps copying the core tests I need as I go...

Regards,

Matt
Post Reply

Return to “Extension Writers Discussion”