Simple way to test your ext on TravisCI

Discussion forum for Extension Writers regarding Extension Development.
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
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 » Fri Oct 14, 2016 12:37 pm

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.
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.

andreask
Registered User
Posts: 518
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: Simple way to test your ext on TravisCI

Post by andreask » Fri Oct 14, 2016 3:02 pm

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?
Last edited by andreask on Fri Oct 14, 2016 3:18 pm, edited 1 time in total.
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
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 » Fri Oct 14, 2016 3:18 pm

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:
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.

andreask
Registered User
Posts: 518
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: Simple way to test your ext on TravisCI

Post by andreask » Fri Oct 14, 2016 4:06 pm

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.
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!

User avatar
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Simple way to test your ext on TravisCI

Post by LukeWCS » Fri May 10, 2019 11:26 am

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?
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
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 » Fri May 10, 2019 12:15 pm

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. ;)
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
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Simple way to test your ext on TravisCI

Post by LukeWCS » Fri May 10, 2019 12:53 pm

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
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
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 » Fri May 10, 2019 12:56 pm

Ok, and what did you do or change to get it to run?
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
canonknipser
Registered User
Posts: 1963
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Simple way to test your ext on TravisCI

Post by canonknipser » Fri May 10, 2019 12:59 pm

The error is hidden in the upper part of the log:
Screenshot_20190510_145826.png
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
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 » Fri May 10, 2019 1:03 pm

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:
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
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Simple way to test your ext on TravisCI

Post by LukeWCS » Fri May 10, 2019 1:08 pm

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.
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)

User avatar
canonknipser
Registered User
Posts: 1963
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Simple way to test your ext on TravisCI

Post by canonknipser » Fri May 10, 2019 1:09 pm

Oh, sorry, David, the screen shot was meant for Luke.

Just created a pull request as requested ;)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
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 » Fri May 10, 2019 1:09 pm

Thanks. I'll merge your pr once ci tests finish. 👍
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
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
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 » Fri May 10, 2019 1:10 pm

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:
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
LukeWCS
Registered User
Posts: 146
Joined: Mon Dec 08, 2014 12:32 pm
Location: Germany

Re: Simple way to test your ext on TravisCI

Post by LukeWCS » Fri May 10, 2019 1:28 pm

Um... David, do you still need more informations or is the problem now found?
May the backup be with you. Always.

My extensions: Monospace font for Posting Editor (phpbb.de)
My extension forks: LF who was here (phpbb.de / phpbb.com), ModBreak eXtended (phpbb.com)

Post Reply

Return to “Extension Writers Discussion”