Commits from different machines cause conflicts in Git

We have a developer machine where tested are being created and executed first.
Then these tests are being pushed to Bitbucket.
From Bitbucket we pull these changes (commits) to another machine where the tested get executed daily.
Expected behavior: users should be able to execute the same test suites at different times and orders on several machines and still be able to commit > push >pull the code successfully.

Actual behavior: once tests are executed separately on a remote machine > it creates a different time stamp in the test suite ’ .ts’ file and this and may be also something else cause the ‘non-fast-forward’ error in Git when pushing the code.

Steps to reproduce:

  1. On 1 machine: create a set of test cases and create a test suite for them
  2. Run the test suite on the machine 1
  3. Do the first commit or commit the changes to Git
  4. On the machine 2 > clone the project from Git
  5. On the machine 2 remove some test cases from the test suite
  6. On the machine 2 save changes > run the test suite > commit changes to the same remote branch in Git
  7. On the machine 1 > modify the test suite > run the modified test suite > commit and push changes to the same remote branch
  8. On the machine 2 > pull changes committed from machine 2
  9. make sure everything works well and no conflicts are being created
1 Like

We have a developer machine where tested are being created and executed first.
Then these tests are being pushed to Bitbucket.
From Bitbucket we pull these changes (commits) to another machine where the tested get executed daily.
Expected behavior: users should be able to execute the same test suites at different times and orders on several machines and still be able to commit > push >pull the code successfully.

Actual behavior: once tests are executed separately on a remote machine > it creates a different time stamp in the test suite ’ .ts’ file and this and may be also something else cause the ‘non-fast-forward’ error in Git when pushing the code.

Steps to reproduce:

  1. On 1 machine: create a set of test cases and create a test suite for them
  2. Run the test suite on the machine 1
  3. Do the first commit or commit the changes to Git
  4. On the machine 2 > clone the project from Git
  5. On the machine 2 remove some test cases from the test suite
  6. On the machine 2 save changes > run the test suite > commit changes to the same remote branch in Git
  7. On the machine 1 > modify the test suite > run the modified test suite > commit and push changes to the same remote branch
  8. On the machine 2 > pull changes committed from machine 2
  9. make sure everything works well and no conflicts are being created

Hi Alex Brohin,

This issue can only be resolved by how you configure Git repository itself. When you execute a test suite, ‘Last Run’ value of that test suite will always be modified to map with the time you publish execution command. Therefore current local Git repository will detect modified timestamp in .ts file as local changes and will have a high chance of conflicting upon pull or push flow.

Katalon Studio does necessary changes to its local files after execution. Any conflicts or ‘non-fast-forward’ errors come later as part of integration to Git repository needs to be resolved by how your team configures Git repository:

https://help.github.com/articles/dealing-with-non-fast-forward-errors/
https://githowto.com/resolving_conflicts

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

Hello Oliver,

we tried fetching, pulling, pushing, configuring the gitignore file but nothing helps. Every time we run test suites on different machines and commit changes (or pulling changes submitted earlier) we get either conflicts or non-fast-forward messages.

Is there a specific way to configure properly git that you could suggest ? We ran out of ideas.

Thank you!

Alex

Hi Alex Robin,

I follow the instruction from this page:

1. Create/Open gitattributes file:
/.gitattributes (will be committed into repo)
OR
/.git/info/attributes (won’t be committed into repo)

2. Add a line defining the files to be filtered:
*.ts filter=gitignore, i.e. run filter named gitignore on all *.rb files
Define the gitignore filter in your gitconfig:

3. After the final step, your gitignore filter will look like:
$ git config --global filter.gitignore.clean "sed ‘//g’ ", i.e. delete these lines
$ git config --global filter.gitignore.smudge cat, i.e. do nothing when pulling file from repo

Thanks

____________________
Thank you for choosing Katalon Studio as your automation solution.
Your feedback is needed to make Katalon Studio a better tool, take the survey at: https://goo.gl/S25NVO

1 Like

The topic is closed due to inactiveness. Feel free to open a new one if you have any concerns.

I wrote this:

In this post, I described why conflicts occurs, and how to prevent the conflict.
Please have a look.

1 Like

Thank you so much! Very helpful! Right on!

Related discussion: [Suggestion] [Katalon Studio] Last Run info could be saved in a separate fille (not in the .ts file).