Page 2 of 8

Re: Simple way to test your ext on TravisCI

Posted: Thu Dec 11, 2014 1:19 pm
by Wolfsblvt
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.

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 08, 2015 2:29 pm
by Paul
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.

Re: Simple way to test your ext on TravisCI

Posted: Wed Jan 14, 2015 9:50 pm
by M.Gaetan89
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 ;-)

Re: Simple way to test your ext on TravisCI

Posted: Sat Jan 24, 2015 6:13 am
by rxu
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

Re: Simple way to test your ext on TravisCI

Posted: Sat Jan 24, 2015 5:58 pm
by nickvergessen
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

Re: Simple way to test your ext on TravisCI

Posted: Sun Jan 25, 2015 5:48 pm
by combuster
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?

Re: Simple way to test your ext on TravisCI

Posted: Sun Jan 25, 2015 10:46 pm
by M.Gaetan89
Did anyone managed to configure coveralls.io on an extension? For me it's complaining that the source folder is not found ...

build
configuration

Re: Simple way to test your ext on TravisCI

Posted: Tue Jan 27, 2015 7:12 pm
by M.Gaetan89
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...

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 29, 2015 11:10 am
by gothick
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

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 29, 2015 1:55 pm
by DavidIQ
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

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 29, 2015 2:19 pm
by gothick
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...

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 29, 2015 2:58 pm
by nickvergessen
I'm working on a script for that.
Once I'm finished, I will also put it here in the forum

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 29, 2015 3:05 pm
by gothick
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 :)

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 29, 2015 4:32 pm
by Wolfsblvt
What kind of script if I may ask?
That would be interesting for me too.

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 29, 2015 8:49 pm
by bonelifer
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.