Skip to content

Commit

Permalink
Merge branch 'release-0.10.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoody committed Sep 18, 2014
2 parents e176c1e + 2aea55b commit 799c44f
Show file tree
Hide file tree
Showing 36 changed files with 571 additions and 453 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,6 @@ script:
- if [[ ( ! -z $XTC_API_TOKEN && `ruby -e 'print RUBY_VERSION'` == '2.1.1' ) ]]; then script/ci/travis/xtc-submit-ci.rb; fi
- script/ci/travis/install-gem-ci.rb
- script/ci/travis/rspec-ci.rb
- script/ci/travis/unit-ci.rb
- script/ci/travis/cucumber-ci.rb --tags ~@no_ci
- script/ci/travis/rake-build-server-ci.rb

Expand Down
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,39 @@
## Contributing

***All pull requests should be based off the `develop` branch.***

The Calabash iOS Toolchain uses git-flow.

See these links for information about git-flow and git best practices.

##### Git Flow Step-by-Step guide

* https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

##### Git Best Practices

* http://justinhileman.info/article/changing-history/

##### git-flow command line tool

We don't use the git-flow tools, but this is useful anyway.

* http://danielkummer.github.io/git-flow-cheatsheet/

## Start a Feature

Start your work on a feature branch based off develop.

```
# If you don't already have the develop branch
$ git fetch origin
$ git co -t origin/develop
# If you already have the develop branch
$ git co develop
$ git pull origin develop
$ git co -b feature/my-new-feature
# Publish your branch and make a pull-request on `develop`
$ git push -u origin feature/my-new-feature
```
117 changes: 89 additions & 28 deletions DEVELOPER_HOWTO.md
Expand Up @@ -38,45 +38,63 @@ The integration tests will overwrite existing calabash-cucumber/staticlib and ca
* https://travis-ci.org/calabash/calabash-ios-server
* Calabash iOS toolchain testing - http://ci.endoftheworl.de:8080/

## Releasing

### How to Release a New Version
### Create the release branch

```
$ git co develop
$ git pull
$ git checkout -b release-<next version> develop
```

No more features can be added. All in-progress features and un-merged pull-requests must wait for the next release.

You can, and should, make changes to the documentation. You can bump the gem version and the minimum server version.

***You may not touch the gemspec.*** If you need to update a dependency, like run-loop, do so before making the release and make sure the change makes it through CI.

### Create a pull request for the release branch

Do this very soon after you make the release branch to notify the team that you are planning a release.

```
$ git push -u origin release-<next version>
```

#### Preflight Checklist
Again, no more features can be added to this pull request. Only changes to documentation are allowed. You can bump the gem version or change the minimum server version. _That's it._

### Pre-Flight Checklist

- [ ] Check CI for possible problems.
- [ ] Double check that the run-loop version you want to target is released.
* https://travis-ci.org/calabash/run_loop
* https://travis-ci.org/calabash/calabash-ios-server
* https://travis-ci.org/calabash/calabash-ios
* http://ci.endoftheworl.de:8080/ # Briar jobs.
- [ ] Double check that the run-loop version you want to target has been released and is available on the RubyGems site.
* https://rubygems.org/gems/run_loop

###### Calabash iOS Server
#### Calabash iOS Server

- [ ] You are on the master branch of `calabash-ios-server`.
- [ ] There are no outstanding changes in your local repo.
- [ ] All the required `calabash-ios-server` pull requests have been merged.

###### Calabash iOS Gem
#### Calabash iOS Gem

- [ ] You are on the master branch of `calabash-ios`.
- [ ] There are no outstanding changes in your local repo.
- [ ] All the required `calabash-ios` pull requests have been merged.
- [ ] lib/calabash-cucumber/version VERSION is correct
- [ ] lib/calabash-cucumber/version MIN_SERVER_VERSION
- [ ] calabash-cucumber.gemspec points to right version of run-loop

#### Release!
#### Test

```
1. Test (see notes below)
2. [calabash-ios] update the lib/calabash-cucumber/version VERSION
3. [calabash-ios] update lib/calabash-cucumber/version MIN_SERVER_VERSION
4. [run-loop] make sure that correct version has been released
5. [calabash-ios] check that the run-loop dependency is correct in the gemspec
6. [calabash-ios] push your version and gemspec changes to master
7. Optional: Run a briar-toolchain-masters job on Jenkins [1]
8. [calabash-ios] $ rake build_server
9. [calabash-ios] $ rake release
```
Optional: Run a briar-toolchain-masters job on Jenkins [1]

- [1] http://ci.endoftheworl.de:8080/job/briar-toolchain-masters/

#### Testing

The integration tests delete and regenerate the `staticlib` and `dylibs` directories. Please keep this in mind.

Ideally you should run the rspec _and_ integration tests. The integration tests re-run a sub-set of the rspec tests; some tests are not stable on Travis CI because of the simulator environment.
Expand Down Expand Up @@ -114,24 +132,21 @@ These tests will protect you from obvious mistakes, but they are incomplete. Le
# rspec - runs fewer tests than $ be rake spec
8. script/ci/travis/rspec-ci.rb
# unit tests - deprecated; these will be removed soon
9. script/ci/travis/unit-ci.rb
# clone the calabash-ios-server and build libraries
10. script/ci/travis/rake-build-server-ci.rb
9. script/ci/travis/rake-build-server-ci.rb
# cucumber against all simulators; includes 1 test with sim_launcher
11. script/ci/travis/cucumber-ci.rb --tags ~@no_ci
# cucumber against many simulators; includes 1 test with sim_launcher
10. script/ci/travis/cucumber-ci.rb --tags ~@no_ci
# run some dylib tests! woot! dylibs!
12. script/ci/travis/cucumber-dylib-ci.rb
11. script/ci/travis/cucumber-dylib-ci.rb
```

##### XTC Tests

_This test is not part of the script/ci/travis/local-run-as-travis.rb or the Travis CI build._
_This test is not part of the script/ci/travis/local-run-as-travis.rb_

This test requires some configuration to run.
This test _is_ part of the Travis CI jobs.

```
[calabash-ios] $ export XTC_API_TOKEN=token
Expand All @@ -150,3 +165,49 @@ XTC_WAIT_FOR_RESULTS=0
```

_The .env is gitignore'd. Don't check in your .env file._

#### rake release

Make sure all pull requests have been merged to `develop`

```
# Check CI!
# * https://travis-ci.org/calabash/run_loop
# * https://travis-ci.org/calabash/calabash-ios-server
# * https://travis-ci.org/calabash/calabash-ios
# * http://ci.endoftheworl.de:8080/ # Briar jobs.
# Get the latest develop.
$ git co develop
$ git pull origin develop
# Get the latest master.
$ git co master
$ git pull origin master
# Get the latest release.
$ git fetch
$ git co -t origin/release-<next version>
# Merge release into master, run the tests and push.
$ git co master
$ git merge release-<next version>
$ be rake rspec
$ git push
# Merge release into develop, run the tests and push.
$ git co develop
$ git merge release-<next version>
$ be rake rspec
$ git push
# Delete the release branch
$ git push origin :release-<next version>
$ git br -d release-<next version>
# All is well!
$ git co master
$ gem update --system
$ rake build_server
$ rake release
```
2 changes: 1 addition & 1 deletion calabash-cucumber/calabash-cucumber.gemspec
Expand Up @@ -65,7 +65,7 @@ Gem::Specification.new do |s|
# match the xamarin-test-cloud dependency
s.add_dependency('bundler', '~> 1.3')
s.add_dependency('awesome_print', '~> 1.2.0')
s.add_dependency('run_loop', '~> 1.0.0')
s.add_dependency('run_loop', '~> 1.0.3')

s.add_development_dependency 'rake', '~> 10.3'
s.add_development_dependency 'rspec', '~> 3.0'
Expand Down
75 changes: 59 additions & 16 deletions calabash-cucumber/lib/calabash-cucumber/launcher.rb
Expand Up @@ -6,7 +6,6 @@
require 'calabash-cucumber/actions/playback_actions'
require 'run_loop'
require 'cfpropertylist'
require 'calabash-cucumber/version'
require 'calabash-cucumber/utils/logging'
require 'calabash/dylibs'

Expand Down Expand Up @@ -554,7 +553,20 @@ def relaunch(args={})
end

if run_with_instruments?(args)
args[:uia_strategy] ||= :preferences
# Patch for bug in Xcode 6 GM + iOS 8 device testing.
# http://openradar.appspot.com/radar?id=5891145586442240
#
# RunLoop::Core.run_with_options can reuse the SimControl instance. Many
# of the Xcode tool calls, like instruments -s templates, take a long time
# to execute. The SimControl instance has XCTool attribute which caches
# the results of many of these time-consuming calls so they only need to
# be called 1 time per launch.
# @todo Use SimControl in Launcher in place of methods like simulator_target?
args[:sim_control] = RunLoop::SimControl.new
uia_strategy = default_uia_strategy(args, args[:sim_control])
args[:uia_strategy] ||= uia_strategy
calabash_info "Using uia strategy: '#{args[:uia_strategy]}'" if debug_logging?

self.run_loop = new_run_loop(args)
self.actions= Calabash::Cucumber::InstrumentsActions.new
else
Expand All @@ -574,6 +586,37 @@ def relaunch(args={})
end
end

# @!visibility private
#
# Choose the appropriate default UIA strategy based on the test target.
#
# This is a temporary (I hope) fix for a UIAApplication bug in
# setPreferencesValueForKey on iOS 8 devices in Xcode 6 GM.
#
# rdar://18296714
# http://openradar.appspot.com/radar?id=5891145586442240
def default_uia_strategy(launch_args, sim_control)
# Preferences strategy works on Xcode iOS Simulators.
if RunLoop::Core.simulator_target?(launch_args, sim_control)
:preferences
else
target_udid = launch_args[:device_target]
target_device = nil
sim_control.xctools.instruments(:devices).each do |device|
if device.udid == target_udid
target_device = device
break
end
end
# Preferences strategy works for iOS < 8.0, but not for iOS >= 8.0.
if target_device.version < RunLoop::Version.new('8.0')
:preferences
else
:host
end
end
end

# @!visibility private
def detect_device_from_args(args)
if args[:app] && File.directory?(args[:app])
Expand Down Expand Up @@ -911,13 +954,13 @@ def server_version_from_server
@@server_version = self.device.server_version
end

# checks the server and gem version compatibility and generates a warning if
# @!visibility private
# Checks the server and gem version compatibility and generates a warning if
# the server and gem are not compatible.
#
# WIP: this is a proof-of-concept implementation and requires _strict_
# equality. in the future we should allow minimum framework compatibility.
# @note This is a proof-of-concept implementation and requires _strict_
# equality. in the future we should allow minimum framework compatibility.
#
# @!visibility private
# @return [nil] nothing to return
def check_server_gem_compatibility
app_bundle_path = self.launch_args[:app]
Expand All @@ -932,18 +975,18 @@ def check_server_gem_compatibility
return nil
end

server_version = Calabash::Cucumber::Version.new(server_version)
gem_version = Calabash::Cucumber::Version.new(Calabash::Cucumber::VERSION)
min_server_version = Calabash::Cucumber::Version.new(Calabash::Cucumber::MIN_SERVER_VERSION)
server_version = RunLoop::Version.new(server_version)
gem_version = RunLoop::Version.new(Calabash::Cucumber::VERSION)
min_server_version = RunLoop::Version.new(Calabash::Cucumber::MIN_SERVER_VERSION)

if server_version < min_server_version
msgs = []
msgs << 'server version is not compatible with gem version'
msgs << 'please update your server and gem'
msgs << " gem version: '#{gem_version}'"
msgs << "min server version: '#{min_server_version}'"
msgs << " server version: '#{server_version}'"

msgs = [
'The server version is not compatible with gem version.',
'Please update your server.',
'https://github.com/calabash/calabash-ios/wiki/B1-Updating-your-Calabash-iOS-version',
" gem version: '#{gem_version}'",
"min server version: '#{min_server_version}'",
" server version: '#{server_version}'"]
calabash_warn("#{msgs.join("\n")}")
else
if full_console_logging?
Expand Down

0 comments on commit 799c44f

Please sign in to comment.