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

eg: 
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
Background:
  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. 

eg.
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'")
end

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

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'")
end
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. 











30 April 2013

Starting With Rubymotion



Rubymotion

 RubyMotion is a revolutionary toolchain for iOS.
It lets you quickly develop and test native iOS applications for iPhone or iPad, all using the awesome Ruby language you know and love.

29 March 2013

TCS RSS Feed Reader 123


TCS RSS Feed
This is an iOS application build using

Running on Simulator/Device

You will need Rubymotion installed on your Mac.
  1. Clone repo git clone git@github.com:upadhyay-ashish/TCSRssReader.git
  2. Bundle gems bundle install
  3. Setup cocoapods pod setup
  4. Setup Developer license reference in the Rakefile
  5. To run on simulator rake else to run on a Device rake device
  6. To create a distribution IPA rake archive:distribution

25 February 2013

Replacing master with a branch GIT



This will help us to overwrite the master branch with a new branch incase the new branch is in a better state than the master


  • git checkout seotweaks
  • git merge -s ours master
  • git checkout master
  • git merge seotweaks



Thanks