Using testing branches in Git

We have someone (let’s call him Ted) that is responsible for testing new features and bug fixes.

We’re using Git and GitHub. master should be/is always deployable and development is where we commit/merge new features or bug fixes, but only after they have been tested by Ted.

The project is in PHP.

I’d like the testing process to go like this:

  1. A developer wants to work on a new feature (let’s say the feature/bug #123 as Ted documented in the issue tracker), so he pulls origin/development to development on his local repository and creates a new branch (let’s say issue-123) from there.
  2. Once he’s happy with his work, he commits and pushes his new branch to origin.
  3. Ted connects to test.ourproject.com/choose-branch and sees a list of the branches on origin and chooses to switch on issue-123 (it should be doable through the webpage). He then goes on test.ourproject.com, tests the hell out of the web application (he’s really pitiless) and after some back and forth with the developer, he’s happy with the feature.
  4. Ted tells the developer that he can merge issue-123 onto development on origin.
  5. Rinse and repeat.

For the third step, I could hack something that does the job (showing and switching branches from a specific page), but I feel that what I’ve described is a very common pattern.

So my question is:
Is this a good / sustainable / maintainable workflow for branching? Can you back up your answer by citing some examples of other projects following this workflow?

6

The branch workflow sounds a lot like gitflow http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow and there are support tools around it. It is highly recommended.

If there is only one tester, your testing workflow sounds fine, but if there are multiple people then development might move between start and finish, and of course testing should ideally be fully performed after any merge. This is where automated testing can really help or a slow (thorough) tester might never finish!

Another problem is that with many features and branches it becomes temping to mix and match features into a release (or to choose to evict after acceptance and merging) or perhaps if features are dependent on each other. The problem is if you start getting temped to rewrite history (rebase/delete a commit or merge) on a PUBLISHED branch-meaning one which has been pushed to a multidev repo. This is rewriting public history. It can be done for good or evil and even if done for good can cause problems to the unwary, and best practice is to avoid it so the question will never come up. However, some integration branch workflows make this very tempting, so if you have strong protection on such branches (eg gitolite per user branch restrictions) and people expect such activity so always rebase their code on such a branch, proceed–with caution!

I’d also like to recommend reading http://sethrobertson.github.com/GitBestPractices/ which discusses all of these matters and has many good references.

1

I am not sure the switching page itself is a common pattern. Most projects probably simply have the tester check it out with git command.

The general approach definitely sounds reasonable.

Google even wrote Gerrit to support similar style; it’s more about reviewing the code, but approving integration normally involves both review and testing. Usually it is also interconnected with continuous integration server which builds all the submissions first (I am not sure whether they use Jenkins in Google, but I believe I’ve seen appropriate connectors somewhere).

Git itself uses a slight variation on the theme. It’s maintainer has a script that merges all pending submissions into a branch called pu (for “proposed updates” presumably; the branch is deleted and re-created each time as the pending submissions are often rebased). This is than tested by various people. If it’s fine, than the submissions that are considered complete are merged into next (that’s the same as your development). If not, than somebody tests the individual submissions to see which one is broken. This makes it a bit easier for the tester since they don’t have to switch branches most of the time; they simply report whether the test integration works.

If your testing is done automatically rather than manually, I think Travis (a CI system for GitHub) will pretty much do what you want–it automatically runs tests on all pull requests. (More information about this process, including screenshots.)

Note that tests are run not on the branch, but the branch after it’s been merged into master. (i.e. what you would get after merging the branch into master–you’re guaranteed that tests will still run successfully post-merge.)

If commits are added to the branch, tests are re-run. (Though for some reason adding commits to master doesn’t seem to re-run the tests.)

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật