Jon,
From the looks of it, you may be invoking the tests from your host OS, not
the Vagrant-managed VM. Trying logging in to the VM using `vagrant ssh` and executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd /vagrant/mediawiki/tests/phpunit vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
If you still have problems with it, feel free to come grab me and we can troubleshoot it further.
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be great to have you, or someone else on the mobile team, vet the improvements.
Cheers, Dan
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be great to have you, or someone else on the mobile team, vet the improvements.
Dan and I (mostly Dan!) have all the browser tests for VisualEditor now running green for Firefox on a Vagrant instance under the visualeditor role. The mobilefrontend role is next for browser test support.
Other suggestions for improvements to vagrant are welcome...
-Chris
Yes, sorry Chris. Emphasis on my absent 'we'.
To clarify further: Chris is doing most of the browser-test work. I'm working on improving the mediawiki-vagrant environment. Teamwork makes dream work, as they say.
Cheers, Dan
On Fri, Jun 13, 2014 at 11:55 AM, Chris McMahon cmcmahon@wikimedia.org wrote:
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be great to have you, or someone else on the mobile team, vet the improvements.
Dan and I (mostly Dan!) have all the browser tests for VisualEditor now running green for Firefox on a Vagrant instance under the visualeditor role. The mobilefrontend role is next for browser test support.
Other suggestions for improvements to vagrant are welcome...
-Chris _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Hey Dan, Yeh that was the problem.
I would like to run the phpunit tests from inside my host OS though... I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
Jon,
From the looks of it, you may be invoking the tests from your host OS, not the Vagrant-managed VM. Trying logging in to the VM using `vagrant ssh` and executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd /vagrant/mediawiki/tests/phpunit vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
If you still have problems with it, feel free to come grab me and we can troubleshoot it further.
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be great to have you, or someone else on the mobile team, vet the improvements.
Cheers, Dan
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Hey Jon,
I would like to run the phpunit tests from inside my host OS though...
I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
We might be able to get that working by ensuring the includes added by mediawiki-vagrant use relative paths—in fact, after a second look, this should be considered a bug in mediawiki-vagrant. With that usage, however, you won't benefit from any of the automatic provisioning that Vagrant provides; you'll have to ensure you have all the right dependencies set up in your host OS.
A workaround that I might suggest trying first would be to make your commits from within the VM, the big downside here being that you'll have to duplicate your user-level git configuration from your host. Another workaround (albeit more complicated) might be to configure your pre-commit hook to execute the tests on the VM over ssh.
Let me know if you'd like to try either of the two suggestions, and I can help you out. Meanwhile, I'll see about fixing the include issue.
Cheers, Dan
On Fri, Jun 13, 2014 at 12:49 PM, Jon Robson jdlrobson@gmail.com wrote:
Hey Dan, Yeh that was the problem.
I would like to run the phpunit tests from inside my host OS though... I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
Jon,
From the looks of it, you may be invoking the tests from your host OS,
not
the Vagrant-managed VM. Trying logging in to the VM using `vagrant ssh`
and
executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd /vagrant/mediawiki/tests/phpunit vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
If you still have problems with it, feel free to come grab me and we can troubleshoot it further.
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be great to have you, or someone else on the mobile team, vet the improvements.
Cheers, Dan
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Jon Robson
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Fri, Jun 13, 2014 at 1:13 PM, Dan Duvall dduvall@wikimedia.org wrote:
I would like to run the phpunit tests from inside my host OS though...
I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
We might be able to get that working by ensuring the includes added by mediawiki-vagrant use relative paths—in fact, after a second look, this should be considered a bug in mediawiki-vagrant. With that usage, however, you won't benefit from any of the automatic provisioning that Vagrant provides; you'll have to ensure you have all the right dependencies set up in your host OS.
A workaround that I might suggest trying first would be to make your commits from within the VM, the big downside here being that you'll have to duplicate your user-level git configuration from your host. Another workaround (albeit more complicated) might be to configure your pre-commit hook to execute the tests on the VM over ssh.
The super-easy workaround is to just create a /vagrant symlink on the host OS, pointing to the directory hosting the virtual machine. Running the tests in a different environment than the one where the system itself is running seems like a bad idea, though.
On Fri, Jun 13, 2014 at 12:49 PM, Jon Robson jdlrobson@gmail.com wrote:
I would like to run the phpunit tests from inside my host OS though... I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
I use a horrible hack, essentially we run the tests from a pre-commit hook with `make phpunit`, but we redefine make as:
make() { if is_vagrant; then vagrant ssh -- cd /vagrant/mediawiki/extensions/Flow '&&' sudo su www-data -c "'make $*'" || exit 1 else /usr/bin/env make $* || exit 1 fi }
where the is_vagrant function duplicates the vagrant functionality of looking at all parent directories for a Vagrantfile
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
Jon,
From the looks of it, you may be invoking the tests from your host OS,
not
the Vagrant-managed VM. Trying logging in to the VM using `vagrant ssh`
and
executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd /vagrant/mediawiki/tests/phpunit vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
If you still have problems with it, feel free to come grab me and we can troubleshoot it further.
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be great to have you, or someone else on the mobile team, vet the improvements.
Cheers, Dan
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Jon Robson
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
I use a horrible hack, essentially we run the tests from a pre-commit hook with `make phpunit`, but we redefine make as:
This might be naive of me, given I don't know specifically how you maintain your hooks, but why not modify the pre-commit hook to conditionally execute over the vagrant ssh tunnel instead of hijacking make?
Also, instead of crawling parent directories for the Vagrantfile, you could use `if (which vagrant && vagrant status) &> /dev/null; then ...`.
Cheers, Dan
On Fri, Jun 13, 2014 at 2:35 PM, Erik Bernhardson < ebernhardson@wikimedia.org> wrote:
On Fri, Jun 13, 2014 at 12:49 PM, Jon Robson jdlrobson@gmail.com wrote:
I would like to run the phpunit tests from inside my host OS though... I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
I use a horrible hack, essentially we run the tests from a pre-commit hook with `make phpunit`, but we redefine make as:
make() { if is_vagrant; then vagrant ssh -- cd /vagrant/mediawiki/extensions/Flow '&&' sudo su www-data -c "'make $*'" || exit 1 else /usr/bin/env make $* || exit 1 fi }
where the is_vagrant function duplicates the vagrant functionality of looking at all parent directories for a Vagrantfile
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
Jon,
From the looks of it, you may be invoking the tests from your host OS,
not
the Vagrant-managed VM. Trying logging in to the VM using `vagrant ssh`
and
executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd /vagrant/mediawiki/tests/phpunit vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
If you still have problems with it, feel free to come grab me and we
can
troubleshoot it further.
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be
great
to have you, or someone else on the mobile team, vet the improvements.
Cheers, Dan
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Jon Robson
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Fri, Jun 13, 2014 at 3:04 PM, Dan Duvall dduvall@wikimedia.org wrote:
I use a horrible hack, essentially we run the tests from a pre-commit
hook
with `make phpunit`, but we redefine make as:
This might be naive of me, given I don't know specifically how you maintain your hooks, but why not modify the pre-commit hook to conditionally execute over the vagrant ssh tunnel instead of hijacking make?
would probably work as well. When i wrote this script i already had the
make() stuff in my .bashrc so i could also use make from the command line. The pre-commit script[1] was written based off that, just looks at the commit to figure out which make commands to run, then calls make.
[1] https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/scripts/p...
Also, instead of crawling parent directories for the Vagrantfile, you could
use `if (which vagrant && vagrant status) &> /dev/null; then ...`.
would also work, but on my system just `vagrant status` takes >1s which is not horrible, but is noticeable when run so often. For that reason i went for a check that could operate without booting ruby and loading all the vagrant code.
Cheers,
Dan
On Fri, Jun 13, 2014 at 2:35 PM, Erik Bernhardson < ebernhardson@wikimedia.org> wrote:
On Fri, Jun 13, 2014 at 12:49 PM, Jon Robson jdlrobson@gmail.com
wrote:
I would like to run the phpunit tests from inside my host OS though... I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
I use a horrible hack, essentially we run the tests from a pre-commit
hook
with `make phpunit`, but we redefine make as:
make() { if is_vagrant; then vagrant ssh -- cd /vagrant/mediawiki/extensions/Flow '&&' sudo su www-data -c "'make $*'" || exit 1 else /usr/bin/env make $* || exit 1 fi }
where the is_vagrant function duplicates the vagrant functionality of looking at all parent directories for a Vagrantfile
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
Jon,
From the looks of it, you may be invoking the tests from your host
OS,
not
the Vagrant-managed VM. Trying logging in to the VM using `vagrant
ssh`
and
executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd /vagrant/mediawiki/tests/phpunit vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
If you still have problems with it, feel free to come grab me and we
can
troubleshoot it further.
On a related note, I'll be working on improving the mediawiki-vagrant browser tests setup for MobileFrontend in the coming weeks. It'd be
great
to have you, or someone else on the mobile team, vet the
improvements.
Cheers, Dan
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Jon Robson
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Fri, Jun 13, 2014 at 3:27 PM, Erik Bernhardson < ebernhardson@wikimedia.org> wrote:
[1] https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/scripts/p...
should have been https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/scripts/p...
would also work, but on my system just `vagrant status` takes >1s which is not horrible, but is noticeable when run so often. For that reason i went for a check that could operate without booting ruby and loading all the vagrant code.
Great point.
We've been discussing further improvements we might make to mediawiki-vagrant, with the primary focus being easier TDD workflows. I'd love any other feedback on how to make things more efficient/less painful. I'm hoping to fix `vagrant run-tests [extension]` and implement a new `vagrant run-browser-tests` in the near future, so if anyone has special use cases, let me know.
On Fri, Jun 13, 2014 at 3:27 PM, Erik Bernhardson < ebernhardson@wikimedia.org> wrote:
On Fri, Jun 13, 2014 at 3:04 PM, Dan Duvall dduvall@wikimedia.org wrote:
I use a horrible hack, essentially we run the tests from a pre-commit
hook
with `make phpunit`, but we redefine make as:
This might be naive of me, given I don't know specifically how you
maintain
your hooks, but why not modify the pre-commit hook to conditionally
execute
over the vagrant ssh tunnel instead of hijacking make?
would probably work as well. When i wrote this script i already had the
make() stuff in my .bashrc so i could also use make from the command line. The pre-commit script[1] was written based off that, just looks at the commit to figure out which make commands to run, then calls make.
[1]
https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/scripts/p...
Also, instead of crawling parent directories for the Vagrantfile, you could
use `if (which vagrant && vagrant status) &> /dev/null; then ...`.
would also work, but on my system just `vagrant status` takes >1s which is not horrible, but is noticeable when run so often. For that reason i went for a check that could operate without booting ruby and loading all the vagrant code.
Cheers,
Dan
On Fri, Jun 13, 2014 at 2:35 PM, Erik Bernhardson < ebernhardson@wikimedia.org> wrote:
On Fri, Jun 13, 2014 at 12:49 PM, Jon Robson jdlrobson@gmail.com
wrote:
I would like to run the phpunit tests from inside my host OS
though...
I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
I use a horrible hack, essentially we run the tests from a pre-commit
hook
with `make phpunit`, but we redefine make as:
make() { if is_vagrant; then vagrant ssh -- cd /vagrant/mediawiki/extensions/Flow '&&' sudo
su
www-data -c "'make $*'" || exit 1 else /usr/bin/env make $* || exit 1 fi }
where the is_vagrant function duplicates the vagrant functionality of looking at all parent directories for a Vagrantfile
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall dduvall@wikimedia.org wrote:
Jon,
From the looks of it, you may be invoking the tests from your host
OS,
not
the Vagrant-managed VM. Trying logging in to the VM using `vagrant
ssh`
and
executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd /vagrant/mediawiki/tests/phpunit vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$ php phpunit.php
If you still have problems with it, feel free to come grab me and
we
can
troubleshoot it further.
On a related note, I'll be working on improving the
mediawiki-vagrant
browser tests setup for MobileFrontend in the coming weeks. It'd be
great
to have you, or someone else on the mobile team, vet the
improvements.
Cheers, Dan
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Jon Robson
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Sat, Jun 14, 2014 at 1:10 AM, Dan Duvall dduvall@wikimedia.org wrote:
would also work, but on my system just `vagrant status` takes >1s which
is
not horrible, but is noticeable when run so often. For that reason i went for a check that could operate without booting ruby and loading all the vagrant code.
Great point.
We've been discussing further improvements we might make to mediawiki-vagrant, with the primary focus being easier TDD workflows. I'd love any other feedback on how to make things more efficient/less painful. I'm hoping to fix `vagrant run-tests [extension]` and implement a new `vagrant run-browser-tests` in the near future, so if anyone has special use cases, let me know.
One thing to keep in mind is non Unixy (read: Windows) hosts. It might not always be easy for Windows hosts to run PHP-unit with a symlink. I must say I haven't invested more than an hour or two in getting things to work, and I'm absolutely *terrible* when it comes to administration tasks, but the only way I could get the test suite running was with the Pear PHP-unit version from the guest system, and wasn't able to run the full test-suite due to OOM conditions (I increased guest memory up to 3 GB).
--Martijn
On Fri, Jun 13, 2014 at 3:27 PM, Erik Bernhardson < ebernhardson@wikimedia.org> wrote:
On Fri, Jun 13, 2014 at 3:04 PM, Dan Duvall dduvall@wikimedia.org
wrote:
I use a horrible hack, essentially we run the tests from a pre-commit
hook
with `make phpunit`, but we redefine make as:
This might be naive of me, given I don't know specifically how you
maintain
your hooks, but why not modify the pre-commit hook to conditionally
execute
over the vagrant ssh tunnel instead of hijacking make?
would probably work as well. When i wrote this script i already had
the
make() stuff in my .bashrc so i could also use make from the command line. The pre-commit script[1] was written based off that, just looks at the commit to figure out which make commands to run, then calls make.
[1]
https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/scripts/p...
Also, instead of crawling parent directories for the Vagrantfile, you
could
use `if (which vagrant && vagrant status) &> /dev/null; then ...`.
would also work, but on my system just `vagrant status` takes >1s which
is
not horrible, but is noticeable when run so often. For that reason i went for a check that could operate without booting ruby and loading all the vagrant code.
Cheers,
Dan
On Fri, Jun 13, 2014 at 2:35 PM, Erik Bernhardson < ebernhardson@wikimedia.org> wrote:
On Fri, Jun 13, 2014 at 12:49 PM, Jon Robson jdlrobson@gmail.com
wrote:
I would like to run the phpunit tests from inside my host OS
though...
I have pre-commit hook I rely on to run phpunit tests before submitting... how can I do that now?
I use a horrible hack, essentially we run the tests from a pre-commit
hook
with `make phpunit`, but we redefine make as:
make() { if is_vagrant; then vagrant ssh -- cd /vagrant/mediawiki/extensions/Flow '&&'
sudo
su
www-data -c "'make $*'" || exit 1 else /usr/bin/env make $* || exit 1 fi }
where the is_vagrant function duplicates the vagrant functionality of looking at all parent directories for a Vagrantfile
On Fri, Jun 13, 2014 at 11:45 AM, Dan Duvall <
dduvall@wikimedia.org>
wrote:
Jon,
From the looks of it, you may be invoking the tests from your
host
OS,
not
the Vagrant-managed VM. Trying logging in to the VM using
`vagrant
ssh`
and
executing the tests from there.
master x ~/git/vagrant $ vagrant ssh ... vagrant@mediawiki-vagrant:~$ cd
/vagrant/mediawiki/tests/phpunit
vagrant@mediawiki-vagrant:/vagrant/mediawiki/tests/phpunit$
php
phpunit.php
If you still have problems with it, feel free to come grab me and
we
can
troubleshoot it further.
On a related note, I'll be working on improving the
mediawiki-vagrant
browser tests setup for MobileFrontend in the coming weeks. It'd
be
great
to have you, or someone else on the mobile team, vet the
improvements.
Cheers, Dan
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Jon Robson
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-- Dan Duvall Automation Engineer Wikimedia Foundation http://wikimediafoundation.org _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org