Page 7 of 8

Re: Simple way to test your ext on TravisCI

Posted: Fri Oct 14, 2016 12:37 pm
by DavidIQ
Ah misread that. Sorry. :oops:

Yes that should have been caught, unless you're not using the function that calls this method in one of your tests. Actually on closer inspection I don't see any tests in your repo.

Re: Simple way to test your ext on TravisCI

Posted: Fri Oct 14, 2016 3:02 pm
by andreask
True, but I only need/want the test on php versions...
And I REALLY do not understand how to test any other thing even by reading the (many) tutorials/wiki it's a big "huh?" for me.

Is there an example of test for my case?

Re: Simple way to test your ext on TravisCI

Posted: Fri Oct 14, 2016 3:18 pm
by DavidIQ
Did you take a look at the Unit Tests portion of the documentation? Travis isn't going to scan through your entire code base and check every line of code to determine what can be run on different versions of PHP. That's not really how unit tests work. Once you've set up unit tests for your extension's functions that you want to test Travis will simply run those tests against the different PHP versions and DBMS types you've specified.

If you need examples of unit tests here's a few:

Re: Simple way to test your ext on TravisCI

Posted: Fri Oct 14, 2016 4:06 pm
by andreask
Thanks David,

That was my misconception, I thought that at least the php functions "validity" per php version would be tested. :oops:


So which test would be appropriate in my case?
The complain was for a simple test in my main_module if (empty($this->request('mark','')) on a submitted form.
I could not find any relevant test.

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 11:26 am
by LukeWCS
Hi

After a long and hard journey I managed to setup Travis CI for a test GH repo. BTW the how-to Continuous integration with Travis CI is outdated and doesn't work, especially regarding EPV.

But now it works for me and I have two questions about it.

Q1

There will be executed 3 tests
  1. code_sniffer
  2. check-image-icc-profiles
  3. EPV
After the first successfully run I understood what test 1 does. I know also what test 3 does. But what does test 2? I found no informations about this.

Q2

And the second question: if I understand the .travis.yml correct:

Code: Select all

matrix:
  include:
    - php: 5.6
      env: DB=none;NOTESTS=1
    - php: 5.6
      env: DB=mysqli
    - php: 5.6
      env: DB=mariadb
    - php: 5.6
      env: DB=postgres
    - php: 5.6
      env: DB=sqlite3
    - php: 7.0
      env: DB=mysqli
    - php: 7.1
      env: DB=mysqli
    - php: 7.2
      env: DB=mysqli
    # - php: hhvm
      # env: DB=mysqli
  allow_failures:
    # - php: hhvm
  fast_finish: true
then all tests (except the first one) are meant for unit tests. If I don't use unit tests, then I can disable all tests after env: DB=none;NOTESTS=1, right?

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 12:15 pm
by DavidIQ
LukeWCS wrote:
Fri May 10, 2019 11:26 am
After a long and hard journey I managed to setup Travis CI for a test GH repo. BTW the how-to Continuous integration with Travis CI is outdated and doesn't work, especially regarding EPV.
This statement would be vastly more useful if you stated what, exactly, is outdated and doesn't work. Otherwise we'd never fix whatever is outdated. ;)

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 12:53 pm
by LukeWCS
If I follow exactly the how-to, then all jobs will executed correctly (I think), except this one:

Code: Select all

    - php: 5.5
      env: DB=mysqli
And in this job the EPV should be executed, if I understand this line correctly:

Code: Select all

- sh -c "if [ '$EPV' != '0' -a '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysqli' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"
And this is the Travis Log for that job:

https://travis-ci.org/LukeWCS/test/jobs/530732854

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 12:56 pm
by DavidIQ
Ok, and what did you do or change to get it to run?

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 12:59 pm
by canonknipser
The error is hidden in the upper part of the log:
Screenshot_20190510_145826.png

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 1:03 pm
by DavidIQ
Showing me what the error is and expecting me to figure out what you changed to fix it is not really what I'm looking for. Ok let's try this then: since you already know where the documentation is (saw you submitted a pull request for something else there) then you're welcome to send a pull request for updating the documentation for this as well. Thanks! :geek:

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 1:08 pm
by LukeWCS
DavidIQ wrote:
Fri May 10, 2019 12:56 pm
Ok, and what did you do or change to get it to run?
I tested the Travis setup from other GH repositorys but none of them worked for me. Last night - and at this point I was really tired and frustrated ^^ - I found a Travis setup which worked perfectly. I can't remember which repo this was, but I can check my browser history at a later point today.

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 1:09 pm
by canonknipser
Oh, sorry, David, the screen shot was meant for Luke.

Just created a pull request as requested ;)

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 1:09 pm
by DavidIQ
Thanks. I'll merge your pr once ci tests finish. 👍

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 1:10 pm
by DavidIQ
canonknipser wrote:
Fri May 10, 2019 1:09 pm
Oh, sorry, David, the screen shot was meant for Luke.
:lol: got you both confused with one another... :roll:

Re: Simple way to test your ext on TravisCI

Posted: Fri May 10, 2019 1:28 pm
by LukeWCS
Um... David, do you still need more informations or is the problem now found?