Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server version does not match client version in pre-release #275

Closed
AndyKriger opened this issue Jan 6, 2014 · 7 comments
Closed

Server version does not match client version in pre-release #275

AndyKriger opened this issue Jan 6, 2014 · 7 comments

Comments

@AndyKriger
Copy link

Though they appear to play nicely together, the 0.163.pre11 client version has a 0.163.pre10 server version (which was setup using calabash_ios download). In the past I have seen incompatibilities between drastically different client/server versions, but these do work together, so maybe this is just an artifact of using a pre-release version.

However, it seems like good practice to update versions that are supposed to work together in sync with one another (or to have the version of calabash-ios download the correct version, so that if I update to pre12, that gets a pre12 versioned calabash-ios executable which downloads a pre12 server).

@ghost ghost assigned krukow Jan 6, 2014
@jmoody
Copy link
Contributor

jmoody commented Jan 6, 2014

Thanks for reporting.

The problem is that server gets updated infrequently compared to the calabash-ios gem.

Updating the server is disruptive to the testing workflow because it often requires that the existing app is deleted from devices and simulators and/or an Xcode 'deep clean' to remove cached copies of the calabash.framework. We don't want to force a new version with no new features to stay in lock-step with the version of the gem - especially if the only change is a bump in the server number.

The situation is not ideal. We could probably come up with a strategy using the version numbers, but there are other more pressing items.

I have assigned to Karl and will mention it to him when we talk next, but I will probably close this issue.

@jmoody jmoody closed this as completed Jan 13, 2014
@jmoody jmoody reopened this Jan 13, 2014
@jmoody
Copy link
Contributor

jmoody commented Jan 13, 2014

I spoke with Karl about this. It is starting to become an issue for me when answering forum questions.

We talked about pushing a server update every time we do an update.

If we do this, I think that we need to add some mechanism for calabash to check the server version and if it is not in sync, we should raise an error (or a warning).

@jmoody
Copy link
Contributor

jmoody commented Feb 11, 2014

Request For Comments

@AndyKriger
@krukow

The lib/version.rb FRAMEWORK_VERSION variable should be deprecated. It creates an artificial connection between the gem and the framework version.

The gem should ask the server for its version.

It can do this at runtime by either:

  • asking there server for its version if it is running
  • exposing the server version number in the framework and using otool/grep to find the version number

lib/version.rb should define a variable MIN_FRAMEWORK_VERSION that indicates a minimum version of the framework.

Somewhere the framework version should be tested against the MIN_FRAMEWORK_VERSION.

My idea is to check in the Before hook and when calabash-ios console is called. We only need to ask this question once per irb session or cucumber run, so the compatibility should be stored in a runtime variable.

The framework version should adopt the following convention to make checking versions easy:

# prerelease should be used only by gem and server developers and never set in production
< major >.< minor >.< feature/patch >.< prerelease >

@jmoody
Copy link
Contributor

jmoody commented Apr 2, 2014

@krukow

This is what I have so far.

  • symlink that shows current server version for visual confirmation
  • a binary resource that reports the current server version (for automated confirmation)
    • $ calabash.framework/Resources/version ==> 0.9.169
  • the Headers/LPVersionRoute.h also includes the version number
$ tree calabash.framework
calabash.framework
├── Headers -> Versions/Current/Headers
├── Resources -> Versions/Current/Resources
├── Versions
│   ├── 0.9.169 -> A
│   ├── A
│   │   ├── Headers
│   │   │   ├── CalabashServer.h
│   │   │   ├── LPHTTPAsyncFileResponse.h
│   │   │   ├── LPHTTPDataResponse.h
│   │   │   ├── LPHTTPDynamicFileResponse.h
│   │   │   ├── LPHTTPFileResponse.h
│   │   │   ├── LPHTTPResponse.h
│   │   │   ├── LPRoute.h
│   │   │   ├── LPRouter.h
│   │   │   └── LPVersionRoute.h
│   │   ├── Resources
│   │   │   └── version
│   │   └── calabash
│   └── Current -> A
└── calabash -> Versions/Current/calabash

@jmoody jmoody assigned jmoody and unassigned krukow Apr 2, 2014
@jmoody
Copy link
Contributor

jmoody commented Apr 2, 2014

@krukow

On the ruby side, I added:

  # 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.
  #
  # @return [nil] nothing to return
  def check_server_gem_compatibility

which outputs:

WARN: server version is not compatible with gem version
please update your server and gem
server version: '0.9.169.pre1'
   gem version: '0.9.169.pre'

Still a working in progress, but I will have a pull request for review soon.

@jmoody
Copy link
Contributor

jmoody commented Apr 2, 2014

#350

@jmoody
Copy link
Contributor

jmoody commented Jun 4, 2014

fixed in 0.9.169

@jmoody jmoody closed this as completed Jun 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants