Giter VIP home page Giter VIP logo

gitnesse's Introduction

Gitnesse

Gitnesse is an acceptance testing tool, enabling a project to store Cucumber feature stories in a git-based wiki, test them against the code, and then update the wiki with the latest test results.

Because the features are in a wiki, non-programmers can see them more easily, and edit them using the wiki.

Gitnesse provides an awesome bi-directional testing flow between developers and non-developers on a team.

Conceptually influenced by Fitnesse. Thanks, Uncle Bob!

Table Of Contents

Installation

You can add Gitnesse to your project's Gemfile:

gem 'gitnesse'

Or install it manually (recommended):

gem install gitnesse

Now add a gitnesse.rb file to your project. This will be used to configure Gitnesse's behaviour.

An example config file:

# ~/dev/awesome_rails_app/config/
Gitnesse::Config.config do |c|
  c.repository_url = "[email protected]:hybridgroup/gitnesse.wiki.git"
  c.annotate_results = true
  c.identifier = "Uncle Bob's Laptop"
end

A full description of each config option can be found in the Config section.

Dependencies

Gitnesse has a few dependencies it needs to function properly:

  1. Git must be installed
  2. Cucumber must be installed and globally accessible (gem install cucumber)

Config

Gitnesse loads config values from a gitnesse.rb file in your project. The available configuration options are:

  • repository_url - the Git URL to the remote git-based wiki you'd like to use with Gitnesse. We recommend using the SSH url (e.g [email protected]:hybridgroup/gitnesse.wiki.git)
  • features_dir - the local directory Cucumber features are store in. This defaults to features.
  • branch - The git branch of the remote wiki to use. Defaults to master.
  • annotate_results - Boolean, determines if Gitnesse will annotate Cucumber results to wiki pages when gitnesse run is called. Defaults to false.
  • identifier - If annotate_results is true, an identifier to use to indicate who ran the results. e.g. Uncle Bob's Laptop.

Tasks

Gitnesse comes with a few commands:

gitnesse pull
gitnesse push
gitnesse run
gitnesse info
gitnesse help
gitnesse cleanup

All of these commands are also available as Rake tasks, if you've added Gitnesse to your Gemfile:

rake gitnesse:pull
rake gitnesse:push
rake gitnesse:run
rake gitnesse:info
rake gitnesse:cleanup

If you're using Gitnesse with a Rails app, these rake tasks will be hooked up automatically. If you're not using Rails, but still want the rake tasks, add this line to your Rakefile:

require 'gitnesse/tasks'

pull

gitnesse pull pulls features from the remote git wiki, and updates/replaces the relevant local features. It also creates new local features if they don't already exist.

push

gitnesse push pushes local features to the remote git wiki, updating/replacing/creating as necessary. It also adds index pages, so for example if your features folder looked like this:

features
├── purchasing
│   ├── purchasing.feature
└── subscribing
    ├── subscriping_logged_in.feature
    ├── subscribing_logged_out.feature
    └── subscribing_fail.feature

Gitnesse would create these wiki pages:

features.md
features > purchasing.md
features > purchasing > purchasing.feature.md
features > subscribing.md
features > subscribing > subscriping_logged_in.feature.md
features > subscribing > subscribing_logged_out.feature.md
features > subscribing > subscribing_fail.feature.md

run

gitnesse run pulls remote wiki features to local, similarly to gitnesse pull, but then it runs Cucumber on the updated feature. If the annotate_results settings is enabled, it will push annotated Cucumber results for each feature scenario to the remote wiki.

info

gitnesse info prints the current Gitnesse configuration info. Useful for debugging purposes and sanity checking.

cleanup

gitnesse cleanup cleans up the folders Gitnesse creates in ~/.gitnesse to store local copies of remote wikis. It prompts for confirmatino before deleting anything.

~/.gitnesse

To store local copies of your remote wikis, Gitnesse creates a hidden folder in your home folder called ~/.gitnesse. The wikis are stored in the project folder, so for example if you have a project called 'awesome_rails_app', it's wiki would appear in ~/.gitnesse/awesome_rails_app.

Contributing

First of all, thanks! We appreciate any help you can give Gitnesse.

The main way you can contribute is with some code! Here's how:

  1. Fork Gitnesse
  2. Create a topic branch: git checkout -b my_awesome_feature
  3. Push to your branch - git push origin my_awesome_feature
  4. Create a Pull Request from your branch
  5. That's it!

We use RSpec for testing. Please include tests with your pull request. A simple bundle exec rake will run the suite. Also, please try to TomDoc your methods, it makes it easier to see what the code does and makes it easier for future contributors to get started.

(c) 2012-2013 The Hybrid Group

gitnesse's People

Contributors

deadprogram avatar dfischer avatar gary avatar stewart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitnesse's Issues

Allow a single feature to be run through `gitnesse run`

It'd be great if gitnesse allowed the same options as cucumber as far as control over what file should be run (maybe even the line number of that file too).

My use-case would be working on a single feature and wanting to push the annotated result of that feature's pass/fail status to the wiki without having to run our full 5 min suite.

We use a gitnesse backed wiki as acceptance criteria for stake holders to verify features in a staging environment. Shortening that feedback / collaboration cycle would be a big help!

Thanks again for this awesome tool!

First-line tags not pulled

Given the following feature stored in a wiki:

@sometag
Feature: Some feature
  Scenario: Some scenario
    Given the state of things
    When I do this one thing
    Then another thing will happen

Pulling the feature omits the leading tag from the file output.

Gitnesse Crashes When Gherkin Syntax Indicator Is Capitalized

Run gitnesse on a git-wiki entry in which the syntax indicator for gherkin is capitalized results.
Gherkin generates error with trace dump.

Example:

```Gherkin
Feature: Addition

  As a user
  I want add two numbers
  So that I can pass my math test

  Background:
    Given a is "1"
    And b is "1"
    When I add a to b
    Then I should see "2"
```

Results in:

undefined method `[]' for nil:NilClass (NoMethodError)
[Dump follows]

First line tag generates a new tag on each push

When I create a gherkin file in the /features directory with the following:

@wip
Feature: Work in Progress
  In order to avoid silly mistakes
  As a math idiot
  I want to be told the sum of two numbers

  Scenario:
    Given I have entered '7' into the calculator
    And I have entered '5' into the calculator
    When I add the numbers
    Then the result should be '12' on the screen

And I run "gitness push" twice

gitnesse push
gitnesse push

And I go to the Github Wiki page
Then I should only see @wip once:

@wip
Feature: Work in Progress
...

But I see @wip twice:

@wip
@wip
Feature: Work in Progress
...

Support for Bitbucket Wikis

Hi,

This is a nice tool, i been able to successfully push to a Bitbucket project wiki, and is a Grails project.

I just had a little problem, BitBucket syntax for inwiki links is as in the Markdown Text not the [[link]], so i changed the features.md generated by gitnesse.

Would be really nice just to change that small feature.

Gitnesse Crashes Pushing or Pulling Empty Gherkin Tag

Create a feature in the wiki page

```gherkin
```

Execute

gitnesse

Generates the error:

"wiki.rb:54:in `[]': no implicit conversion from nil to integer (TypeError)"

Secondary problem:
The output does not indicate which page is in error. We see the last file processed as "updated" or "didn't change", but no indication that the problem was in the empty feature page.

Scenario outlines break gitnesse run

I've tried twice now to run 'gitnesse run' to annotate my feature files, but unfortunately it's hanging for this scenario outline:

screen shot 2013-10-02 at 12 03 53 pm

The nested feature support works great though! Thanks!

Let me know if you can't reproduce this scenario outline issue and I may be able to help troubleshoot.

Working against gollum wiki

Hi,

I've tried to setup gitnesse against a "locally" installed gollum wiki, but I get this error when trying to do "gitnesse push":

Creating local copy of remote wiki.
/home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/git-1.2.6/lib/git/lib.rb:718:in `command': git clone "--" "http://localhost:4567" "/home/nrkhan/.gitnesse/svn" 2>&1:Initialized empty Git repository in /home/nrkhan/.gitnesse/svn/.git/ (Git::GitExecuteError)
error: while accessing http://localhost:4567/info/refs

fatal: HTTP request failed
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/git-1.2.6/lib/git/lib.rb:69:in clone' from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/git-1.2.6/lib/git/base.rb:55:inclone'
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/git-1.2.6/lib/git.rb:88:in clone' from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/lib/gitnesse/wiki.rb:127:inclone'
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/lib/gitnesse/wiki.rb:114:in clone_or_update' from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/lib/gitnesse/wiki.rb:23:ininitialize'
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/lib/gitnesse/cli/helpers/wiki_helpers.rb:16:in new' from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/lib/gitnesse/cli/helpers/wiki_helpers.rb:16:inclone_wiki'
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/lib/gitnesse/cli/task/push.rb:20:in perform' from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/lib/gitnesse/cli.rb:23:inparse'
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/gems/gitnesse-1.0.0/bin/gitnesse:5:in <top (required)>' from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/bin/gitnesse:23:inload'
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/bin/gitnesse:23:in <main>' from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:ineval'
from /home/nrkhan/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `

'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.