Simple way to test your ext on TravisCI

Discussion forum for Extension Writers regarding Extension Development.
User avatar
Wolfsblvt
Registered User
Posts: 634
Joined: Sun Oct 26, 2014 9:12 pm
Location: Solingen, Germany
Contact:

Re: Simple way to test your ext on TravisCI

Post by Wolfsblvt » Thu Dec 11, 2014 1:19 pm

Aaaah, that makes it clearer, thank you.

Yes, I removed them cause my extension requires php 5.4. So I should just change '5.3.3' to '5.4'.
I'll try that later.
If you have a specific extension request and you are willing to pay for, you can write me a PM.
My extensions (Trending: @Mention SystemAdvanced PollsUser Online Time)

»Du kamst zu uns. Deine Stimme kam. Du zeigtest uns die Sterne. Sie funkelten. Wir konnten sehen.«

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25229
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Simple way to test your ext on TravisCI

Post by Paul » Thu Jan 08, 2015 2:29 pm

The reason why we only run them on 1 of them in the matrix is actually very simple, the test will always pass or fail depending on the env, and it would be useless CPU time to run them on all in the matrix.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
M.Gaetan89
Registered User
Posts: 39
Joined: Sun Apr 21, 2013 12:36 pm
Location: Divonne-les-Bains
Name: Gaëtan
Contact:

Re: Simple way to test your ext on TravisCI

Post by M.Gaetan89 » Wed Jan 14, 2015 9:50 pm

I was about to start thinking about test configuration of my project, when I found this topic.
Works like a charm! Easy to setup and full of useful tools! :-D

One think: I thought git update-index --chmod=+x travis/prepare-phpbb.sh would actually set the execute permission, but I had to run chmod +x travis/prepare-phpbb.sh myself first. Not a big deal, but it might be useful to add it in the documentation ;-)

rxu
Extensions Development Team
Posts: 2946
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: Simple way to test your ext on TravisCI

Post by rxu » Sat Jan 24, 2015 6:13 am

If you add the following section into .travis.yml right before the install: section, then you don't need to permanently have the travis/prepare-phpbb.sh and phpunit.xml.dist files in your repo.

Code: Select all

before_install:
  - sudo mkdir travis
  - git clone "https://github.com/nickvergessen/phpbb-ext-acme-demo.git"
  - sudo cp phpbb-ext-acme-demo/phpunit.xml.dist ./
  - sudo cp phpbb-ext-acme-demo/travis/prepare-phpbb.sh travis
  - sudo rm -rf phpbb-ext-acme-demo

User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: Simple way to test your ext on TravisCI

Post by nickvergessen » Sat Jan 24, 2015 5:58 pm

rxu wrote:If you add the following section into .travis.yml right before the install: section, then you don't need to permanently have the travis/prepare-phpbb.sh and phpunit.xml.dist files in your repo.

Code: Select all

before_install:
  - sudo mkdir travis
  - git clone "https://github.com/nickvergessen/phpbb-ext-acme-demo.git"
  - sudo cp phpbb-ext-acme-demo/phpunit.xml.dist ./
  - sudo cp phpbb-ext-acme-demo/travis/prepare-phpbb.sh travis
  - sudo rm -rf phpbb-ext-acme-demo
While this works, I'd not recommand to do this.
Just add the two files and remove them on packaging.
There is no harm in doing so, while it brings the safty, that it does not break when I (re)move my sample extension
No Support via PM

combuster
Registered User
Posts: 342
Joined: Sun Oct 26, 2008 11:58 pm

Re: Simple way to test your ext on TravisCI

Post by combuster » Sun Jan 25, 2015 5:48 pm

What do I need to do, when I want to test db using my own table that is created via migrations-file? The example only shows fixtures for phpbb config table, but now how to setup an own table. How do I create it before the test?

User avatar
M.Gaetan89
Registered User
Posts: 39
Joined: Sun Apr 21, 2013 12:36 pm
Location: Divonne-les-Bains
Name: Gaëtan
Contact:

Re: Simple way to test your ext on TravisCI

Post by M.Gaetan89 » Sun Jan 25, 2015 10:46 pm

Did anyone managed to configure coveralls.io on an extension? For me it's complaining that the source folder is not found ...

build
configuration

User avatar
M.Gaetan89
Registered User
Posts: 39
Joined: Sun Apr 21, 2013 12:36 pm
Location: Divonne-les-Bains
Name: Gaëtan
Contact:

Re: Simple way to test your ext on TravisCI

Post by M.Gaetan89 » Tue Jan 27, 2015 7:12 pm

Seems like Coveralls is is not reading my .coveralls.yml file. Whatever I used for the value src_dir does not impact the resulting error on Travis.
I'm not sure yet if I'm setting the wrong path to .coveralls.yml and I'm not getting any error about that or if I didn't configure something properly...

User avatar
gothick
Registered User
Posts: 69
Joined: Sat Apr 21, 2007 7:20 am
Name: Matt Gibson
Contact:

Re: Simple way to test your ext on TravisCI

Post by gothick » Thu Jan 29, 2015 11:10 am

nickvergessen wrote: While this works, I'd not recommand to do this.
Just add the two files and remove them on packaging.
There is no harm in doing so, while it brings the safty, that it does not break when I (re)move my sample extension
Is there a standard way of packaging an extension? I'm looking to remove a couple of files that are useful for development but shouldn't be in a release (and are causing warnings from the EPV, of course.)

Thanks,

Matt

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17031
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Simple way to test your ext on TravisCI

Post by DavidIQ » Thu Jan 29, 2015 1:55 pm

gothick wrote:Is there a standard way of packaging an extension? I'm looking to remove a couple of files that are useful for development but shouldn't be in a release (and are causing warnings from the EPV, of course.)

Thanks,

Matt
https://www.phpbb.com/extensions/rules- ... extensions
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
gothick
Registered User
Posts: 69
Joined: Sat Apr 21, 2007 7:20 am
Name: Matt Gibson
Contact:

Re: Simple way to test your ext on TravisCI

Post by gothick » Thu Jan 29, 2015 2:19 pm

Ah, sorry, I meant an actual *method*, rather than the rules. Like some standard script (that could presumably be executed by Travis before extension validation, too) that would take extension files from a repository and package it before testing, so I don't get warned about files that the EPV doesn't recognise.

I just thought there might be something already written, as an extension developer might well want to keep consistency between packaging for testing on Travis and packaging for a release...

User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: Simple way to test your ext on TravisCI

Post by nickvergessen » Thu Jan 29, 2015 2:58 pm

I'm working on a script for that.
Once I'm finished, I will also put it here in the forum
No Support via PM

User avatar
gothick
Registered User
Posts: 69
Joined: Sat Apr 21, 2007 7:20 am
Name: Matt Gibson
Contact:

Re: Simple way to test your ext on TravisCI

Post by gothick » Thu Jan 29, 2015 3:05 pm

nickvergessen wrote:I'm working on a script for that.
Once I'm finished, I will also put it here in the forum
Brilliant, thanks, I had a feeling it was something that someone would be doing :)

User avatar
Wolfsblvt
Registered User
Posts: 634
Joined: Sun Oct 26, 2014 9:12 pm
Location: Solingen, Germany
Contact:

Re: Simple way to test your ext on TravisCI

Post by Wolfsblvt » Thu Jan 29, 2015 4:32 pm

What kind of script if I may ask?
That would be interesting for me too.
If you have a specific extension request and you are willing to pay for, you can write me a PM.
My extensions (Trending: @Mention SystemAdvanced PollsUser Online Time)

»Du kamst zu uns. Deine Stimme kam. Du zeigtest uns die Sterne. Sie funkelten. Wir konnten sehen.«

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3471
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: Simple way to test your ext on TravisCI

Post by bonelifer » Thu Jan 29, 2015 8:49 pm

On Github you could use a .gitattributes file and then use git-archive

Code: Select all

.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
README.md export-ignore
composer.lock export-ignore
composer.phar export-ignore
phpunit.xml.dist export-ignore
/travis export-ignore
On phpBBModders, I posted a windows batch/Linux shell script with example dot-files. You could use and modify those for your own use at https://phpbbmodders.net/board/viewtopi ... 132&t=8179 Do read the first post carefully.
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

Post Reply

Return to “Extension Writers Discussion”