Mailing List Archive

Selenium tests with two instances of Mediawiki
Hello,

I would like to push my tests in Jenkins/Gerrit. For the moment, I test manually and with Selenium IDE my extensions :
https://www.mediawiki.org/wiki/Extension:PushAll
https://www.mediawiki.org/wiki/Extension:NamespaceData
https://www.mediawiki.org/wiki/Extension:LinkedWiki

I need to have two instances of Mediawiki with these extensions because I need to test transferring pages from a private wiki to a public wiki.
For the moment in local, I use two docker containers with Mediawiki (and with Centos7 because I install/compile also specific databases)

I have the time to do this task properly.
How would you do it if you had to?

Thanks in advance.
Karima
_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Re: Selenium tests with two instances of Mediawiki [ In reply to ]
Le 02/07/2021 à 10:39, karima.rafes@gmail.com a écrit :
> Hello,
>
> I would like to push my tests in Jenkins/Gerrit. For the moment, I test manually and with Selenium IDE my extensions :
> https://www.mediawiki.org/wiki/Extension:PushAll
> https://www.mediawiki.org/wiki/Extension:NamespaceData
> https://www.mediawiki.org/wiki/Extension:LinkedWiki
>
> I need to have two instances of Mediawiki with these extensions because I need to test transferring pages from a private wiki to a public wiki.
> For the moment in local, I use two docker containers with Mediawiki (and with Centos7 because I install/compile also specific databases)
>
> I have the time to do this task properly.
> How would you do it if you had to?

Hello Karima,

We unfortunately do not have support to spawn multiple MediaWiki at this
time. Not that it is impossible but we just don't have the code to be
able to define those instances and boot them.

On CI the tests are run in a single container. In it, MediaWiki is being
setup and installed using Quibble: https://doc.wikimedia.org/quibble/ It
is a home made tool that roughly:

* clone a set of repositories defined in CI and get patches from Gerrit
* install the composer dependencies
* run unit test commands
* Spawn a database and web server
* run the rest of tests such as the Selenium ones

It is all done serially and Quibble only supports setting up and
spawning a single MediaWiki instance. In the ideal world we would rely
on something like docker-composer to spawn a set of containers and then
run tests in that environment, but that doesn't exist yet.

Maybe some of those tests could be written via PHPUnit? I don't know how
to simulate two MediaWiki instances in there though :-\

--
Antoine "hashar" Musso
_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
Re: Selenium tests with two instances of Mediawiki [ In reply to ]
Am 02.07.21 um 12:31 schrieb Antoine Musso:
>
> Maybe some of those tests could be written via PHPUnit? I don't know how to
> simulate two MediaWiki instances in there though :-\

I have long wanted that, and I have recently worked on making this possible as a
personal side project. However, the devil is in the details...

Have a look at https://phabricator.wikimedia.org/T261848
<https://phabricator.wikimedia.org/T261848> if you are interested.

--
Daniel Kinzler
Principal Software Engineer, Core Platform
Wikimedia Foundation
Re: Selenium tests with two instances of Mediawiki [ In reply to ]
Thanks

> We unfortunately do not have support to spawn multiple MediaWiki at this
> time. Not that it is impossible but we just don't have the code to be
> able to define those instances and boot them.

Ok.

Is it possible to send a http request [2] after a new merge in the master
branch of my extensions ?
If yes, I can probably use GitHub Actions to spawn multiple MediaWiki at
this time [1] and execute my tests after each merge.

What do you think about this method ?

[1]
https://github.com/peter-evans/docker-compose-actions-workflow/blob/master/README.md
[2]
https://dev.to/rikurouvila/how-to-trigger-a-github-action-with-an-htt-request-545

Le ven. 2 juil. 2021 à 12:32, Antoine Musso <hashar@free.fr> a écrit :

> Le 02/07/2021 à 10:39, karima.rafes@gmail.com a écrit :
> > Hello,
> >
> > I would like to push my tests in Jenkins/Gerrit. For the moment, I test
> manually and with Selenium IDE my extensions :
> > https://www.mediawiki.org/wiki/Extension:PushAll
> > https://www.mediawiki.org/wiki/Extension:NamespaceData
> > https://www.mediawiki.org/wiki/Extension:LinkedWiki
> >
> > I need to have two instances of Mediawiki with these extensions because
> I need to test transferring pages from a private wiki to a public wiki.
> > For the moment in local, I use two docker containers with Mediawiki (and
> with Centos7 because I install/compile also specific databases)
> >
> > I have the time to do this task properly.
> > How would you do it if you had to?
>
> Hello Karima,
>
> We unfortunately do not have support to spawn multiple MediaWiki at this
> time. Not that it is impossible but we just don't have the code to be
> able to define those instances and boot them.
>
> On CI the tests are run in a single container. In it, MediaWiki is being
> setup and installed using Quibble: https://doc.wikimedia.org/quibble/ It
> is a home made tool that roughly:
>
> * clone a set of repositories defined in CI and get patches from Gerrit
> * install the composer dependencies
> * run unit test commands
> * Spawn a database and web server
> * run the rest of tests such as the Selenium ones
>
> It is all done serially and Quibble only supports setting up and
> spawning a single MediaWiki instance. In the ideal world we would rely
> on something like docker-composer to spawn a set of containers and then
> run tests in that environment, but that doesn't exist yet.
>
> Maybe some of those tests could be written via PHPUnit? I don't know how
> to simulate two MediaWiki instances in there though :-\
>
> --
> Antoine "hashar" Musso
>