15 November 2014

Merging branches on two different remotes GIT

Steps to merge branches located on two different remotes.

In this example lets consider we have a repo on both and Github & BitBucket :

Step 1: Clone the repo which you want finally to hold all the changes.

I will choose Github
git clone <repo URL>

Step 2: Add remote for Bitbucket or other repo into the cloned repo
git remote add origin_bitbucket <url>

Step 3: Checkout the branch from Bit Bucket remote 
git checkout origin_bitbucket/<branch name>

Step 4: Check out the branch you want to merge into
git checkout origin/master

Step 5: Merge BitBucket branch into it
git merge origin_bitbucket/<branch name>

08 June 2014

Git fatal reference error on deployment or submodule update

Sometimes we face this issue with GIT
fatal: reference is not a tree: d80ee5f27b06e84d40a7d2758525b682aaba7d72
This is because the module has not been pushed to the main repo or the branch has not been pulled on the machine the command is being executed.

Branch issues 
git checkout master
git fetch origin

Submodule issues

git submodule update

Best Jenkins Plugins I use !

1. Compress Artifacts Plugin

Keeps build artifacts compressed to save disk space on the master. 

2. Copy To Slave Plugin

This plugin allows copying files located somewhere on the master node into the jobs' workspaces, whether their builds take place on the master node or on slave nodes. 

3. Cucumber Reports Plugin

This plugin creates pretty cucumber-jvm html reports on jenkins 

4. Delete log

This plugin add action delete log to build page. If the build is build of matrix job, the action delete log for all its configurations too. 

5. Green Balls

Because green is better than blue! For color blind support configure user property. 

6. HTML Publisher plugin

This plugin publishes HTML reports. 

7. Jenkins disk-usage plugin

This plugin counts disk usage. 

8. Jenkins Gravatar plugin

This plugin shows Gravatar avatar images for Jenkins users. 

9. Timestamper

Adds timestamps to the Console Output. 

10. embeddable-build-status

This plugin adds the embeddable build status badge to Jenkins so that you can easily hyperlink/show your build status from elsewhere. 

Using Frank with Rubymotion

Writing acceptance tests for iOS application in Rubymotion

Steps involved

1) Add the motion-frank gem to the Gemfile
2) Run the initializer rake frank:init_features
3) Now you have the features directory.
4) Write a sample test

Feature: Navigating around the app / smoke test
  As a user
  I want to be able to get to all parts of the app
  So I can use it and not get confused or lost
  Given I launch the app
  Given I am on the search Screen with empty search
Scenario: Search
  Given I am on the search screen
  Then I should see a navigation bar with label text "Search"
  When I fill in a search term
  Then I should see a navigation bar with label text "Results"
5) Save this as a xyz.feature file
6) Run rake frank to see this test fail
7) Add the step definition file in the features/step_definitions named something like xyz_steps.rb
8) Add step methods describing the steps and what should happen on the simulator to match the test. 

Given(/^I am on the search Screen with empty search$/) do
  wait_for_element_to_exist_and_then_touch_it("textField placeholder:'Search by name'")

Given(/^I am on the search screen$/) do
  check_element_exists("textField placeholder:'Search by name'")

and go on ....

Go through the sameple steps and implementation in the frank-cucumber library to get hold of more methods to test the UI.

Also you can use rake frank:symbiote to get the list of UI elements accessible for testing in a simulator.

Run "rake frank:symbiote" in the Rubymotion directory and once the simulator is up with the application open the browser and navigate to "localhost:37265" 

Quick Tips : 

1) For ruby code which like occurs in multiple step file , write ruby files in the support folder such as
def check_search_bar
  check_element_exists("textField placeholder:'Search by name'")
Now you can use this check_search_bar method in any step definition file & reduce the amount of code you write to get your code working.

Happy Testing with cucumber !! Its fun.