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

Allow plugins to bundle unit tests files #1673

Closed
robocoder opened this issue Sep 4, 2010 · 12 comments
Closed

Allow plugins to bundle unit tests files #1673

robocoder opened this issue Sep 4, 2010 · 12 comments
Assignees
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@robocoder
Copy link
Contributor

Currently it is not possible for plugins to have tests. plugin developers have to put the tests in the piwik/tests/PHPUnit/* folders. This is not practical because the tests cannot be bundled with the plugin.

Goal: give Piwik developers the ability to bundle tests in their plugins. This will provide community with ability to build plugins with high quality and QA standards.

Tasks:

  • Allow plugins to bundle tests in their tests/* directories. Especially unit tests, and integration tests
  • Developers can execute their plugin tests
  • Add basic doc to plugins developer documentation #testing
  • Add console command to create test file and to execute tests for a specific plugin

Out of scope:

@mattab
Copy link
Member

mattab commented Nov 16, 2010

I think it would be ideal to implement this using an Ant task running on our Hudson server.

@robocoder
Copy link
Contributor Author

re: comment:1 That's possible. I'll need to secure the CI environment a bit more than currently (e.g., suhosin, open basedir restriction, etc), and limit integration testing to some pre-approved set of third-party plugins.

The build job would iterate through each plugin in the repository:

  • install Piwik trunk
  • download and install a third-party plugin from the repository
  • check for errors
  • activate plugin
  • check for errors
  • run plugin-specific unit tests

@mattab
Copy link
Member

mattab commented Mar 11, 2013

From #2017: WP has some interesting plugins for checking themes and plugins that we can learn from.

  • Theme Authenticity Checker
  • Exploit Scanner
  • Theme Check

Lots of possibilities: we could run a test before activating a plugin, test plugins submitted to the repository, svn commit hook, or via jenkins.

@tsteur
Copy link
Member

tsteur commented Nov 7, 2013

In 53fc1b9: refs #1673 allow plugins to bundle tests

@tsteur
Copy link
Member

tsteur commented Nov 7, 2013

In bce736f: refs #1673 move it to correct testsuite

@tsteur
Copy link
Member

tsteur commented Nov 7, 2013

In 793c3f8: refs #1673 added a simple test to example plugin, added test generator

@tsteur
Copy link
Member

tsteur commented Nov 7, 2013

Test generator: done. ./console generate:test

Executing a test using ./console tests:run ExamplePlugin

@tsteur
Copy link
Member

tsteur commented Nov 7, 2013

TBD: do we need different options to generate StandardTest (Unit Test), DB Test, Integration Test?

@tsteur
Copy link
Member

tsteur commented Nov 7, 2013

In 9d48059: refs #1673 always add plugins group

@tsteur
Copy link
Member

tsteur commented Nov 7, 2013

In a1c6c2e: refs #1673 automatically attach "Test" to testname if needed, added optional option to define type of test

@mattab
Copy link
Member

mattab commented Jan 23, 2014

In 6156407: Refs #1673 Also allow plugin tests in the /Test folder

@robocoder robocoder added this to the 2.0 - Piwik 2.0 milestone Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…d, added optional option to define type of test
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@mattab mattab added the c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. label Oct 12, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants