Page MenuHomePhabricator

api-testing tests break for GrowthExperiments
Closed, ResolvedPublic

Description

Following https://gerrit.wikimedia.org/r/c/mediawiki/core/+/818604, all GrowthExperiments builds for api-testing tests are failing with:

11:05:51   2 failing
11:05:51 
11:05:51   1) /transform/ endpoint
11:05:51        wt2html
11:05:51          should return a request too large error when just over limit (post wt):
11:05:51      Error: expected 413 "Payload Too Large", got 200 "OK"
11:05:51       at Test._assertStatus (node_modules/supertest/lib/test.js:270:12)
11:05:51       at Test._assertFunction (node_modules/supertest/lib/test.js:285:11)
11:05:51       at Test.assert (node_modules/supertest/lib/test.js:175:21)
11:05:51       at localAssert (node_modules/supertest/lib/test.js:133:12)
11:05:51       at /workspace/src/node_modules/supertest/lib/test.js:130:5
11:05:51       at Test.Request.callback (node_modules/superagent/lib/node/index.js:894:12)
11:05:51       at IncomingMessage.<anonymous> (node_modules/superagent/lib/node/index.js:1127:20)
11:05:51       at Unzip.<anonymous> (node_modules/superagent/lib/node/unzip.js:53:12)
11:05:51       at endReadableNT (internal/streams/readable.js:1317:12)
11:05:51       at processTicksAndRejections (internal/process/task_queues.js:82:21)
11:05:51 
11:05:51   2) /transform/ endpoint
11:05:51        html2wt
11:05:51          should return a request too large error when just over limit:
11:05:51      Error: expected 413 "Payload Too Large", got 200 "OK"
11:05:51       at Test._assertStatus (node_modules/supertest/lib/test.js:270:12)
11:05:51       at Test._assertFunction (node_modules/supertest/lib/test.js:285:11)
11:05:51       at Test.assert (node_modules/supertest/lib/test.js:175:21)
11:05:51       at localAssert (node_modules/supertest/lib/test.js:133:12)
11:05:51       at /workspace/src/node_modules/supertest/lib/test.js:130:5
11:05:51       at Test.Request.callback (node_modules/superagent/lib/node/index.js:894:12)
11:05:51       at IncomingMessage.<anonymous> (node_modules/superagent/lib/node/index.js:1127:20)
11:05:51       at Unzip.<anonymous> (node_modules/superagent/lib/node/unzip.js:53:12)
11:05:51       at endReadableNT (internal/streams/readable.js:1317:12)
11:05:51       at processTicksAndRejections (internal/process/task_queues.js:82:21)
11:05:51

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
kostajh triaged this task as High priority.
kostajh edited projects, added Growth-Team (Current Sprint); removed Growth-Team.
kostajh moved this task from Incoming to In Progress on the Growth-Team (Current Sprint) board.
kostajh added a project: ci-test-error.

Change 843419 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] WIP: Debug restart php fpm service

https://gerrit.wikimedia.org/r/843419

kostajh added a subscriber: hashar.

@hashar somehow QUIBBLE_APACHE environment variable isn't set in the api-testing context. We probably have some cleanup work to do there, in integration/config and/or Quibble.

My workaround for this task is to remove the QUIBBLE_APACHE check code in our api-testing code, see https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/843419

Change 843421 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[integration/config@master] jjb: Deployed version of Quibble has QUIBBLE_APACHE flag

https://gerrit.wikimedia.org/r/843421

Change 843422 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[integration/quibble@master] api-testing: Set QUIBBLE_APACHE flag

https://gerrit.wikimedia.org/r/843422

Change 843421 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[integration/config@master] jjb: Deployed version of Quibble has QUIBBLE_APACHE flag

https://gerrit.wikimedia.org/r/843421

! In T320935#8320478, @gerritbot wrote:

Change 843422 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[integration/quibble@master] api-testing: Set QUIBBLE_APACHE flag

https://gerrit.wikimedia.org/r/843422

These are both cleanup patches. The main problem is that this code in mediawiki/tools/api-testing doesn't seem to carry over the environment variables when npm test is invoked:

if [ -z "${QUIBBLE_APACHE-}" ]; then
  export API_TESTING_CONFIG_FILE=quibble.json
else
  export API_TESTING_CONFIG_FILE=quibble.apache.json
fi

npm install --no-package-lock
npm test

We know that QUIBBLE_APACHE is set in the if/else statement, because quibble.apache.json is loaded and port 9143 appears in the log. But then npm test which wraps npm run lint && mocha --parallel does not receive the QUIBBLE_APACHE environment variable.

Change 843419 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] api-testing: Skip the QUIBBLE_APACHE environment check

https://gerrit.wikimedia.org/r/843419

Change 843422 merged by jenkins-bot:

[integration/quibble@master] api-testing: Set QUIBBLE_APACHE flag

https://gerrit.wikimedia.org/r/843422

Change 849037 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/quibble@master] release: Quibble 1.4.7

https://gerrit.wikimedia.org/r/849037

Change 849037 merged by jenkins-bot:

[integration/quibble@master] release: Quibble 1.4.7

https://gerrit.wikimedia.org/r/849037

Change 849116 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] dockerfiles: update to Quibble 1.4.7

https://gerrit.wikimedia.org/r/849116

Change 849116 merged by jenkins-bot:

[integration/config@master] dockerfiles: update to Quibble 1.4.7

https://gerrit.wikimedia.org/r/849116

Mentioned in SAL (#wikimedia-releng) [2022-10-25T16:33:44Z] <hashar> Updating Jenkins jobs for Quibble 1.4.7 # T320935 T318029

I have updated Quibble on CI to version 1.4.7. It now injects QUIBBLE_APACHE=1 in the environment when running the api-testing stage.

Change 843421 merged by jenkins-bot:

[integration/config@master] jjb: Deployed version of Quibble has QUIBBLE_APACHE flag

https://gerrit.wikimedia.org/r/843421

Hi @kostajh, can you kindly point me in the direction of the API test runs for GrowthExperiments?

Hi @kostajh, can you kindly point me in the direction of the API test runs for GrowthExperiments?

@EUdoh-WMF on any patch (E.g. https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/859460) look for mediawiki-quibble-apitests-vendor-php74-docker , and if you click through to that and click on "Full Log" at the top of the page (e.g. https://integration.wikimedia.org/ci/job/mediawiki-quibble-apitests-vendor-php74-docker/5796/consoleFull) then go to the "Run API-Testing" section (https://integration.wikimedia.org/ci/job/mediawiki-quibble-apitests-vendor-php74-docker/5796/consoleFull#console-section-10), you'll see the output from GrowthExperiments api-testing tests.

I see it, thanks a lot. The tests are not failing with the earlier identified error anymore.

I see it, thanks a lot. The tests are not failing with the earlier identified error anymore.

Cool. Then I will mark this as resolved.