[cucumber] Cucumber and CI

On Tue, Feb 24, 2009 at 1:17 AM, Matt W. [email protected] wrote:

See particularly the notes about squashing commits - this allows you to
commit really often in your local branch, then merge these commits together
before you push them into the main source control repository.

You can even use git commit --amend to commit on red (e.g at the end of the
day) and then change that commit later.

Another workflow (which I don’t personally use) is to continually git
commit --amend, changing the commit message each time. This avoids the
rebase step before pushing, but of course you don’t have the
checkpoints.

///ark

On Tue, Feb 24, 2009 at 1:16 PM, Mark W. [email protected] wrote:

Another workflow (which I don’t personally use) is to continually git
commit --amend, changing the commit message each time. This avoids the
rebase step before pushing, but of course you don’t have the
checkpoints.

Egad. Why am I reminded of “Eternal Sunshine of the Spotless Mind?”


Have Fun,
Steve E. ([email protected])
ESCAPE POD - The Science Fiction Podcast Magazine
http://www.escapepod.org

On Tue, Feb 24, 2009 at 10:16 AM, Mark W. [email protected] wrote:

commit --amend, changing the commit message each time. This avoids the
rebase step before pushing, but of course you don’t have the
checkpoints.

Much better to rebase -i to clean up a bunch of little commits, imo.
Gives you all the flexibility in the world when developing, then when
you’re ready to share you can assemble nice independent, meaningful
changes.

Pat

inability to safely request new features as evidence that they did not
specify enough, up-front.

If you redo a product, you have learned what it should look like.
Thus, you can specify much more in advance. Nothing wrong with that,
it came out of the feedback loops.

I’m curious, do you really expect them to go for a rewrite?

These managers knew better than to use classic Waterfall, but they still
didn’t understand that Big Requirements Up Front is essentially
Waterfall’s worst aspect. And so they re-invented Waterfall, yet again,
in yet another form.

That’s because they still have not learned that in order to manage
uncertainty, you have to acknowledge that there is uncertainty, first.

Which is not to say I’m doing a good job at explaining that to my
customer, yet :frowning:

Bye,
Kero.


How can I change the world if I can’t even change myself?
– Faithless, Salva Mea

On Tue, Feb 24, 2009 at 10:56 AM, Pat M. [email protected]
wrote:

Much better to rebase -i to clean up a bunch of little commits, imo.
Gives you all the flexibility in the world when developing, then when
you’re ready to share you can assemble nice independent, meaningful
changes.

Yeah, I use rebase -i almost all of the time, myself. The “continuous
rollup” method is described at
My Git Workflow . I thought it
was worth mentioning, as another way to skin a cat.

///ark

Kero van Gelder wrote:

If you redo a product, you have learned what it should look like.
Thus, you can specify much more in advance. Nothing wrong with that,
it came out of the feedback loops.

Here’s pure Waterfall (phase 2, not 3 of his project):

“7 reasons I switched back to PHP after 2 years on Rails”

His rewrite bombed because he tried accidentally did it Waterfall-style,
so of
course he blamed Rails, and caused a tempest in a teapot in his comments
section. His “2 years on Rails” did not include, say, frequently
deploying it…

My rebuttal:

“Big Requirements Up Front”

I’m curious, do you really expect them to go for a rewrite?

“They” were a dot-com in 1999, so we will never know if it could have
worked… (-:


Phlip

you’re not forcing anyone to do anything. You can push your own
elegant code." (In some places it might even be “I’d better prove to
my manager that I did something today.”)

If you don’t show up for the next 6 weeks or not at all,
that last hour of work of you is not going to matter to anyone. Really.

If you do show up you’re likely worrying too much about the lost
hardware, or your lost house.

I’d say the only person I’d commit unfinished code for, is myself.
Which means I don’t do it at the end of the day, but that should not
prevent you from doing it.

In any case: pushing to the team’s main VCS repository may be a
necessary step for integration, but it doesn’t mean every push has to
trigger an integration. Not if you’ve created a consistent and
well-understood culture of branching.

I’m trying to get that culture going :slight_smile: The understanding is tough…
With the main problem being that most of the co-devs are not
software engineers. So I’ll do the merging of their branches with
the master (they do hg branch and hg push, I do hg pull, hg merge and hg
push).

But I got them to use cucumber! I have to help
a lot, of course, but that’s a price i’m willing to pay.


How can I change the world if I can’t even change myself?
– Faithless, Salva Mea

On Tue, Feb 24, 2009 at 5:58 PM, Kero van Gelder [email protected] wrote:

you’re not forcing anyone to do anything. You can push your own
elegant code." (In some places it might even be "I’d better prove to
prevent you from doing it.

But I got them to use cucumber! I have to help
a lot, of course, but that’s a price i’m willing to pay.

It’s all about little wins. Great work on getting them to use Cucumber!


Zach D.
http://www.continuousthinking.com

2009/2/24 aslak hellesoy [email protected]

going to amend it first thing tomorrow morning.

Because the longer you wait, the more your code will diverge from your
teammates’. If you don’t commit often you rob them of the opportunity
to reduce merge hell.

This is the money line for me.

There’s a lovely CI pattern I’ve seen in the centralised SCM world (with
Java, but that’s less important) that I’m surprised hasn’t been
mentioned.
Before I describe it I’d like to take this back to first principles.

The point of continuous integration is to keep each individual
integration
small and avoid less frequent big integrations, because that’s where
the
pain happens. Syncing up once per story or feature, which could easily
be
several days work, strikes me as a retrograde step. The fact that DSCMs
like
git or hg allow you to do this doesn’t make it a good thing. There are
many
fantastic reasons to use DSCM - modelling IBM Rational ClearCase “best
practice” usage patterns shouldn’t be one of them.

Anyhoo, it seems to me the problem we are discussing is the coupling
between
checking in an unfinished scenario and failing the build. The solution
I’ve
seen - scaling to projects with tens of developers and thousands of
scenarios - is to separate in-progress features from finished ones, and
build everything.

If an in-progress scenario fails then the build carries on. If a
completed
scenario fails it causes the build to fail. There is a nice corollary to
this whereby you fail the build if an in-progress scenario accidentally
*
passes*. This is because you usually want a human to find out why. In
cuke-land you would do this at a feature level rather than a scenario
level
since the convention is to have one feature (with multiple scenarios)
per
file.

Marking a feature as done can be as simple as moving it between two
directories (called in-progress and done), renaming the feature (from
openid_login.in-progress to openid_login.feature) or having an
:in_progresstag on a feature until it’s done.

In Java-land I prefer the first model because I can point the same junit
task at either the in-progress or done directories and just change the
failOnError flag.

In any case, I would strongly encourage changing the build so you can
integrate continuously - i.e. git push as frequently as you normally
would -
knowing the build will remain clean as long as you mark your unfinished
work
as in-progress. Lightweight, cheap branches are great for local spikes,
exploration of unfamiliar code and any number of other incidental
activities, but I’m deeply sceptical that they should form part of your
core
workflow.

No doubt once this becomes the norm and Rational are laughing up their
sleeves I’ll live to regret saying that :slight_smile:

Aslak

Cheers,
Dan

On Wed, Mar 4, 2009 at 6:25 AM, Dan N. [email protected] wrote:

Marking a feature as done can be as simple as moving it between two
directories (called in-progress and done), renaming the feature (from
openid_login.in-progress to openid_login.feature) or having an :in_progress
tag on a feature until it’s done.

I started out with using an in-process directory, but now I prefer to
use a pending step:

Given …
And …
And the rest of this scenario is pending: see ticket number #1234, in
progress (2009.03.04)
When I …
And …
Then …

That way, the build won’t break even if some of the steps have already
been implemented (e.g. for other scenarios), and I can organize my
scenarios according to their final destination (dir and feature file),
without needing to worry as much about current status. But I do need
to make sure I insert the appropriate “pending” steps prior to “svn
commit” / “bzr push”,

Great writing. Thanks

On 4 Mar 2009, at 11:25, Dan N. wrote:

While I think commit --amend is very useful, I’m not sure why you’d
There’s a lovely CI pattern I’ve seen in the centralised SCM world
use DSCM - modelling IBM Rational ClearCase “best practice” usage
nice corollary to this whereby you fail the build if an in-progress
In Java-land I prefer the first model because I can point the same
junit task at either the in-progress or done directories and just
change the failOnError flag.

Thanks for your thoughts, Dan. Cucumber 0.2 tags are ideal for this
sort of filtering. I’m going to look at adding a ‘two tier’ feature
run to our build.

Matt W.
http://blog.mattwynne.net