Wikimedia Developer Support

Best way to pass the test using the classes in vendor directory

Hello, I am working for T237609 to implement extension PageViewInfo to support Google Analytics as its backend. I added a require clause for Google SDK in composer.json and some lines like use Google_Service_AnalyticsReporting; to the top of the new PHP files. The patch set I created is 549426.

After uploading the patch, jenkins-bot has informed me the main test build failed. The failures seem to be caused by calls to methods from undeclared class. I compared my code to extension Elastica using Elastica SDK and tried to modify my code, but It didn’t work.

And I have noticed project-templates for PageViewInfo and Elastica defined in integration/config/zuul/layout.yaml differ, but I don’t know if it could be the cause.

- name: mediawiki/extensions/PageViewInfo
  template:
    - name: extension-quibble
    - name: extension-phan
    - name: extension-seccheck
    - name: extension-coverage
- name: mediawiki/extensions/Elastica
  template:
    - name: extension-quibble
    - name: extension-phan
    - name: extension-seccheck
    - name: extension-gate

I do not know how do I solve this problem, please advise me.
Thanks.

Could anyone explain the difference between extension-coverage and extension-gate?

extension-coverage is used for calculating if a patch increases/decreases the code coverage provided by tests in a patch. extension-gate are the jobs run after a patch is +2’ed.

kostajh: Thank you. It is so helpful for me a lot!

I saved a last failure log: https://gist.github.com/lens0021/2f02be813dc727bac6b9df594e572bb4#file-gistfile1-txt-L997-L1187