[go: up one dir, main page]

Page MenuHomePhabricator

Turn RESTBase tests for /html and /transform endpoints into api-testing integration tests
Open, MediumPublic

Description

Current RESTBase tests for the endpoints powering VE are already written in a fashion very similar to what api-testing tool is doing. In order to make changes with confidence, we can convert relevant tests into api-testing framework and reuse them when building PHP infrastructure for VE.

Event Timeline

This is going to be an experiment to figure out if this is viable. In the beginning, let's try tests/features/transform/transform.js

These tests are integration tests and they rely on the fact that some pages exist on beta wiki. For now we should just keep those pages hard-coded - in future we will start using api-testing lib to create these pages on demand, after we move these tests into MW.

api-testing is heavily geared towards testing MediaWiki, so we might need to put some bogus unused configuration in there to satisfy it. The changes pretty much would be switching existing tests from using preq for HTTP requests to using api-testing machinery for HTTP requests.

I'm not yet sure this is a viable and valuable idea, let's see how it goes with the first file converted.

I have pushed a PR for this task here where I was able to replace preq with the api-testing REST client within 11 out of 13 tests.

The two tests that are failing when I switch them to client.post are;

  1. The html2wt with scrub_wikitext test fails with error 400 whenever the scrub_wikitext: 1 parameter is added.
  1. The supports stashing content test fails at the second client.post.

Could there be something I am missing that is causing these two tests to fail?

Pchelolo removed kevinbazira as the assignee of this task.
Pchelolo added a subscriber: kevinbazira.

The experiment was a success imho, so we need to actually do it now.

Adding Platform Engineering project tag as tasks need to be discoverable and as the current PET Clinic Duty tag got archived in T266534