How to Execute Test Scripts on slave based on the

2019-08-17 00:46发布

SCM - Git, CI - Jenkins

I have configured the Git,Gerrit & Jenkins workflow and configured Automation suite on a jenkins slave.

I am able to run the TestNG suite on the slave machine after a patch set is created on Gerrit.

But currently for any kind of patchset created on Gerrit the same test suite is invoked. What I want to achieve is perform tests based on the file name which was pushed into Gerrit.

eg. If login.jsp is pushed then login tests should be performed not the full test suite.

Any tips on how this can be achieved? The direction in which I am currently thinking is, Is there any way to notify the slave about the name of the pushed file?

1条回答
贪生不怕死
2楼-- · 2019-08-17 01:08

There is various ways of doing this. You can trigger on paths in the later implementations of the Gerrit trigger plugin.

There is an add file path, in the configuration view.

This way you can have different jobs triggering on different paths.

What i have done in past was to have a .information file in directories where i specify which reviewers to add and which test cases to execute if files below this .information file has changed then i execute specific scripts.

You can find the files modified in a commit with git log -1 --name-status

查看更多
登录 后发表回答