My team is working on building a bunch of automated tests for our project. Each automated test targets a "customization" our client ordered to modify an existing website.
The current flow is:
checkout development
git pull
checkout -b unique-customization-test-branch
- magic code stuffs
git commit && git push
- create pull request into dev
Each automated test makes use of a FooBar.groovy
library that I'm constantly updating, creating various functions to streamline the process of building these tests. Sometimes one of my teammates will need a new function added to FooBar.groovy
, e.g. verify no duplicate rows exist in a table, and ask me to add that for them to use in their current branch / automated test.
Of note: there's a no-pushing-to-dev policy in place, so right now what we're doing is:
- I checkout a new
FooBar
branch - add function to the
FooBar.groovy
lib - commit, push, and PR into dev
- my teammates run
git checkout origin/development -- FooBar.groovy
to get the latest changes
But then they have to either
- discard the pulled changes to
FooBar.groovy
any time they switch branches to avoid conflicts and mucking the history, which is a hassle for the git savvy and nigh impossible without help for the git novices and often leads toFooBar.groovy
accidentally getting committed in their test branch or - commit
FooBar.groovy
to their branch and just try to ensure that they've pulled the most recent version of it into their branch before creating the PR so as to not overwrite newer code
There has to be a better way. This seems super not-optimal. Any advice?
FooBar
for the branch name andFooBar.groovy
for the lib name where appropriategit checkout test-branch && git rebase development
?