Best way to test plugin?

47 views
Skip to first unread message

Kenny Ho

unread,
Nov 20, 2015, 3:52:47 PM11/20/15
to Repo and Gerrit Discussion
Hi,

I am trying to add test to my plugin, but I am having a lot of trouble setting up all the dependencies.  Does anyone have any advice on this subject?  Being in the plugin development environment, I don't have access to some of the test utilities in the main project.  I noticed the Replication plugin uses EasyMock but I don't think it does integration test simulate server events (I don't think.)  What are the best practices?  Do I need to duplicate some of the test utilities like the acceptance test framework from the main project in order to test the plugin?

Regards,
Kenny

Kenny Ho

unread,
Nov 24, 2015, 1:30:09 PM11/24/15
to Repo and Gerrit Discussion
Oh... I just saw this older commit log for the acceptance framework (https://gerrit.googlesource.com/gerrit/+/947b5e53ac75f8085fd9dd5c3bd05dbf284ee288)  Looks like plugins should be able to include the acceptance framework for testing similar to jgit.junit.  (Too bad it's only available from 2.12-rc0... I really should upgrade my server...)

Marco Miller

unread,
Nov 25, 2015, 12:49:05 PM11/25/15
to Repo and Gerrit Discussion
Hi,

You can also refer to gerrit/plugins/cookbook-plugin's CookbookIT class,
which introduces usage of PluginDaemonTest as parent
(below acceptance.AbstractDaemonTest).

And these open changes are bringing http support once merged:
[1] https://gerrit-review.googlesource.com/#/q/topic:http-plugin-IT

The events-log plugin is also currently being changed based on [1]:
[2] https://gerrit-review.googlesource.com/#/q/topic:events-log-IT

/Marco

Kenny Ho

unread,
Nov 25, 2015, 1:22:07 PM11/25/15
to Repo and Gerrit Discussion
Sweet, thanks!
Reply all
Reply to author
Forward
0 new messages