简体   繁体   中英

Execute file specific tests on Git,Gerrit,Jenkins workflow

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?

You can use Git to find the files modified by the commit being tested (or the files modified compared to the tip of the branch, whatever is most appropriate). For example,

git diff-tree -r --name-only HEAD~1 HEAD

lists the paths of the files modified in the currently checked out commit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM