Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making it stable - testing #105

Closed
szepeviktor opened this issue Mar 13, 2017 · 7 comments
Closed

Making it stable - testing #105

szepeviktor opened this issue Mar 13, 2017 · 7 comments

Comments

@szepeviktor
Copy link
Contributor

Please consider adding at least unit tests.
I'll send a PR to run them in TravisCI.

@Chouby
Copy link
Contributor

Chouby commented Mar 15, 2017

There are phpunit tests. I would not call them unit tests but rather integration tests. They are not public at the moment, because they were initially separate from Polylang. They are also wuite messy and I have to arrange them before making them publicly available here.

Some of these tests are testing need 3rd party plugins or specifically need Twenty Fourteen or Twenty Seventeen (so not necessary the default them of the current WordPress version). Is it possible to run them with TravisCI?

@szepeviktor
Copy link
Contributor Author

Is it possible to run them with TravisCI?

Yes. I'll be possibly writing the test scripts.

@szepeviktor
Copy link
Contributor Author

@Chouby
Copy link
Contributor

Chouby commented Mar 15, 2017

OK. Let me some time to arrange things (a bit) and I will include them in this repo.

@Chouby
Copy link
Contributor

Chouby commented Mar 31, 2017

I have created a new branch phpunit https://github.com/polylang/polylang/tree/phpunit to work on this topic.

Some tests need plugins (Yoast SEO, JetPack and WordPress Importer) or themes (Twenty Fourteen, Twenty Seventeen). I put them in separate subdirectories. (NB there is a test for YARPP but the plugin is not needed).

Themes are usually included in WordPress directory, but the current latest version does not include Twenty Fourteen anymore. I added it on my local test suite at its usual place. I made that when WP 4.7 was released to go faster but it's not mantainable in the long term when changing the WordPress version. I put plugins aside the wordpress directory instead of the usual plugins directory.

So my current local test suite directory structure looks lik this:

|-jetpack
|-wordpress
  |-wp-content
    |-themes
      |-twentyfourteen
      |-twentyseventeen
|-wordpress-importer
|-wordpress-seo
|-wordpress-tests-lib

I don't know if it's good for TracisCI. If you can help to setup these tests on TravisCI, that would be very nice.

@szepeviktor
Copy link
Contributor Author

Thank you!

Could you try running WP-CLI? wp scaffold plugin-tests http://wp-cli.org/commands/scaffold/plugin-tests/
It will generate the testing environment with Travis config.

I hope it is easy to adapt.

@Chouby
Copy link
Contributor

Chouby commented Apr 4, 2017

In 0c15773
Travis-CI is now setup to run phpunit tests.

  • I did not went down to PHP 5.2 due to errors (most probably in tests as, until now, I took care to PHP 5.2 in Polylang but not in tests).
  • My attempts to run integration tests with Yoast SEO, WordPress Importer and Jetpack were not conclusive. Not sure why. I may try again later, but will stop here for now and will go on running them locally.

@Chouby Chouby closed this as completed Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants