Selenium tests in separate repo or together with application code?

1,732 views
Skip to first unread message

KenCK

unread,
Jan 11, 2012, 1:56:47 PM1/11/12
to Selenium Users
We currently have a separate repo for our Selenium tests (in Java).
Wondering if this is the norm or if there are benefits to keeping the
tests in the same repo as the application code?

If you are coupling the tests with the code, do you keep the tests
segregated in a separate folder or do you keep them together with
various routes/directories?

Appreciate any feedback. Thanks!

Ross Patterson

unread,
Jan 11, 2012, 3:08:42 PM1/11/12
to seleniu...@googlegroups.com
We have several Subversion repos, for a variety of reasons, not all of which I agree with. We keep our tests in the same repo as the front-end code (C#, ASP, ASP.NET, JavaScript), on the assumption that most changes that affect tests are in that same repo. We started doing that because it allowed us to commit one changeset that contained both product-changes and test-changes caused by them, but we quickly found that the more common practice is to commit them separately, and for the test changes to lag (i.e., we sometimes see tests break and then fix them afterwards). Our mainstream code is in /trunk/src/main, and the test in /trunk/src/test, but that's just a convenience, and very little of our build system knows or cares about that.

Ross

Dave Justin

unread,
Jan 12, 2012, 11:18:41 AM1/12/12
to Selenium Users
Generally, putting the tests in the same repo as your code base is a
good idea. Keep in mind that you probably don't want the tests in
your web root if you can help it -- it should go in a sibling
directory to your source code.

/myproject
/source
/tests

The main benefit of putting it in the same repo, in a sibling
directory, is that the code and the tests get versioned together.
This way, you never have to wonder which revision of your test
repository corresponds to which revision of your source code. That
also allows you to set up a Continuous Integration server to run your
tests automatically, if you wanted to do that. Also, if you branch
your source code, the tests will get branched along with it -- you
almost always want that.

Just my two cents. Hope that helps!

Paul Grandjean

unread,
Jan 18, 2012, 1:19:14 PM1/18/12
to seleniu...@googlegroups.com
On my last project we put our tests within the same repository as the project.  It worked well for us, simply to have a one-stop place for all the code, test and otherwise, in one place central for the whole team.

To avoid not-yet-ready-tests breaking the build we used cmd-line optinos passed to maven to control whether we skipped tests or not.  

Paul


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


KenCK

unread,
Jan 19, 2012, 7:27:56 PM1/19/12
to Selenium Users
Thanks for the replies everyone!

Tarun Bhadauria

unread,
Jan 20, 2012, 12:09:29 AM1/20/12
to seleniu...@googlegroups.com
I had posted a similar question in SQA forum some time ago, you might find it interesting -

KenCK

unread,
Jan 23, 2012, 3:07:17 PM1/23/12
to Selenium Users
Thanks Tarun, some good points there to consider.

On Jan 19, 9:09 pm, Tarun Bhadauria <tkum...@gmail.com> wrote:
> I had posted a similar question in SQA forum some time ago, you might find
> it interesting -
>
> http://sqa.stackexchange.com/questions/2143/keeping-automation-code-a...
Reply all
Reply to author
Forward
0 new messages