Page 5 of 8

Re: Simple way to test your ext on TravisCI

Posted: Sat Jan 23, 2016 8:17 pm
by 3Di
pierredu wrote:OK, thanks, I did'nt know this command.
Because you did not read this topic, at least the very first post. ;)

Re: Simple way to test your ext on TravisCI

Posted: Sat Jan 23, 2016 9:07 pm
by pierredu
Indeed.
You know, when you're getting too much information at one time, on a weak background, that is what happens.
I'm now cleaning the white space problems and the braces not beginning on a newline.
I expected more interesting information. Anyway, the exercise is interesting.

Re: Simple way to test your ext on TravisCI

Posted: Sun Jan 24, 2016 8:20 am
by pierredu
No more errors in the code, but still this:
The command "sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi"" exited with 1.

Any idea?
Thanks in advance.

Re: Simple way to test your ext on TravisCI

Posted: Mon Jan 25, 2016 12:04 am
by 3Di
You can pass on it IMHO.

BTW, re-read the first post of this topic. You'll find you are missing another file for the Travis thinghy to add to your repository. ;)

Re: Simple way to test your ext on TravisCI

Posted: Thu Jan 28, 2016 1:40 pm
by gn#36
I don't know if anybody is interested, but I have written a small script to use the phpbb language validator to also check all the translations of an extension based upon the english version. It can probably be improved still (for example, it currently sets a fixed plural rule that has the maximum number of array elements that I actually need, this may be too small for some translations), but maybe it is still useful to someone:
  1. Add the following to your travis configuration (Full example, including epv and tests):

    Code: Select all

    # Section "install" before cd ../../phpBB, e.g. after  - travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
     - travis/prepare-langtest.sh $EXTNAME $PHPBB_BRANCH
    # Section "script"
    # You can also use any other PHP Version if you wish, I simply chose 5.4 over 5.3 because that will also be present for phpBB 3.2.
    - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ] && [ '$DB' = 'mysqli' ]; then ../langtest/travis/test-lang.sh; fi"
    
  2. Add these two scripts to your travis folder:
  3. Add the translation validator as a dev-dependency to your extensions composer.json:

    Code: Select all

    "require-dev" : {
    		"phpbb/translation-validator" : "1.3.*"
    	},
This should cause your build to fail if any of the translations does not provide the same language keys as english, is missing email files or similar, just as the regular translation validator will on a full language pack. Here you can see a build of my hookup extension failing due to missing files and language keys in the french translation (Job details).

If the language you develop your extension in is not english, you can use a different language as the base for comparison as well, if you wish.

If you have any comments, please let me know.

Re: Simple way to test your ext on TravisCI

Posted: Sat Jan 30, 2016 6:30 pm
by Sajaki
The language check looks quite useful. i package 4 languages in my ext to be.
But the job failed. do you have any idea why ?
https://travis-ci.org/bbDKP/bbGuild/jobs/105911961

Code: Select all

The command "sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.3.3' ] && [ '$DB' = 'mysqli' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"" exited with 0.

0.00s$ sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ] && [ '$DB' = 'mysqli' ]; then ../langtest/travis/test-lang.sh; fi"

sh: 1: ../langtest/travis/test-lang.sh: Permission denied

The command "sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ] && [ '$DB' = 'mysqli' ]; then ../langtest/travis/test-lang.sh; fi"" exited with 126.

Re: Simple way to test your ext on TravisCI

Posted: Sat Jan 30, 2016 8:34 pm
by 3Di
3Di wrote:You should set executable perms also in the repo (local).

In win file properties, then Run git update-index --chmod=+x travis/test-lang.sh from the git bash then commit/push it to the github repo.
I believe is the case, not tried though.

Re: Simple way to test your ext on TravisCI

Posted: Sun Jan 31, 2016 12:21 am
by gn#36
I would also assume that is the case:
sh: 1: ../langtest/travis/test-lang.sh: Permission denied

Re: Simple way to test your ext on TravisCI

Posted: Sat Apr 30, 2016 12:37 pm
by Skouat
Hi guys,

Since a couple of days, TravisCI seems to permanently fail with PHP 5.3.3 and EPV.
After some research, I saw that VSE has migrated the EPV test in PHP 5.5.

Perhaps it would be interesting to update this topic and repo demo acme?

Re: Simple way to test your ext on TravisCI

Posted: Sat Apr 30, 2016 11:07 pm
by VSE
Running EPV (Extension Pre Validator) on Travis Tests:

Here are updated instructions to enable EPV testing of your extension on Travis-ci.

Take a look a the phpbb-acme-demo .travis.yml to see how.

Basically you need to:

1. Add to the env/global:

Code: Select all

- EPV="1"              # Should we run EPV (Extension Pre Validator) on your code?
2. Add to the end of the install:

Code: Select all

- sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.5' ] && [ '$DB' = 'mysqli' ]; then cd phpBB; composer require phpbb/epv:dev-master --dev --no-interaction; cd ../; fi"
3. Add to the end of the script:

Code: Select all

- sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.5' ] && [ '$DB' = 'mysqli' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
Note: If you were using the old way of testing EPV described earlier in this thread, you can not use that technique anymore. You should undo the changes recommended by the old way, including reverting any changes to .travis.yml, composer.json and removing or updating your composer.lock file (EPV should not be a dependency of your extension). All that is needed now are the three lines above added to your .travis.yml file.

Re: Simple way to test your ext on TravisCI

Posted: Sun May 01, 2016 12:24 am
by 3Di
At this very point could be an option to just run EPV locally, instead.

Re: Simple way to test your ext on TravisCI

Posted: Wed Aug 31, 2016 11:29 am
by Ger
I'm having trouble getting started with Travis.

My repository: https://github.com/GerB/cmbb
As you can see, there is a .travis.yml file in the root of my extension folder. Yet Travis says:
WARNING: We were unable to find a .travis.yml file.
And than start testing for Ruby, which totally fails of course.

I suspect this has to do with the fact that I have full path in my repository: phpBB3/ext/ger/cmbb and the Travis stuff resides there. What is the best approach now? I would like to hold that path like that since I have a local setup with phpBB and the extension in it's correct place. I've ignored everything but my extension folder for Git so that should not be a problem. However, it is a problem for Travis, it seems.

Re: Simple way to test your ext on TravisCI

Posted: Wed Aug 31, 2016 12:10 pm
by Paul
You need it in the root of your repo, if you include the complete directory structure in your repo (Which most extension authors don't)

Re: Simple way to test your ext on TravisCI

Posted: Wed Aug 31, 2016 1:15 pm
by Ger
Well, I've updated the folder structure, omitting the complete phpBB path. Still no dice. It seems like Travis still can't find my travis.yml file. It now says:
Branch "1.0.0-dev" not included per configuration.
There was a setting "Build only if .travis.yml is present" which I've had on for a few minutes, but I quickly turned it off again.
When I go to http://lint.travis-ci.org/GerB/cmbb it still says
failed to fetch .travis.yml
Yet it is there. I'm unsure how to proceed.

Quite annoying I must say. Now I realise I'm probably doing something wrong, but than again it's not really straightforward either.

Re: Simple way to test your ext on TravisCI

Posted: Wed Aug 31, 2016 2:10 pm
by Sajaki
you need to setup your github webhook for travis for that repository too.

github repo -> preferences -> webhooks & services -> add service -> choose travis CI.