'jmeter guidelines for Git version control

In our organization we have being using jmeter since 4 years. In this time we created, manage and execute our jmx scripts through a network drive to share and work in the scripts with our partners.

Currently, we want to upgrade this procedure with Git, to use the advantages of version control like branches, pull-request, merge, conflict resolutions,...

However, we don't know how to approach to Git with jmx files. The main doubt that we have is how to compare jmeter scripts in a pull-request if this scripts are compared as XML files, and how to merge both jmx scripts if they are XML files and there are some conflicts on theme.

I found some forums where people use Git with jmeter to upload their own scripts, however they don't describe a guideline or process for a multiple people working on the same scripts.

Is there any guideline or considerations to make when trying to use a version control over jmeter scripts?



Solution 1:[1]

JMeter .jmx scripts are basically XML files which are not too VCS friendly so letting the VCS to perform automatic merge may result into malformed XML files.

So the only guideline I can provide is to be very careful and maybe consider adding an XML validator as a part of a post-commit/post-merge hook so Git would roll back the commit if the result doesn't look like a valid XML

Alternatively you can go for another way of authoring/modifying a JMeter test like:

Solution 2:[2]

Some best practices that should help:

  • Add comments explaining what has been done in each commit
  • Ignore spaces in diff, this is possible in all IDEs
  • Add a XML validator as part of source management that would work on post commit

Solution 3:[3]

Intellij is the best tool as far as my experience to version control your Jmeter .JMX files. Simply import the folder where you have all your jmx files into intellij and go to your Git hub or any version-controlled website that your company is using and create a repo for the jmeter scripts. Now come back to your Intellij and Commit and Push to the Repository that you have created so that the files won't be corrupted and remain as .jmx rather than changing to .xml. Any changes made by other people can be pushed to git with the same process

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T
Solution 2 UBIK LOAD PACK
Solution 3 dinesh pasala