Skip to content

Testing on Windows Guide

guangyang edited this page Apr 6, 2013 · 1 revision

This guide assumes that you have already installed a Git client and have downloaded the azure-sdk-for-ruby project to your computer.

Install Ruby and libraries

  1. Install Ruby from Ruby Installer for Windows.

I chose Ruby 1.9.3-p392 (Ruby 2.0.0-p0), and installed to C:\Ruby193 (C:\Ruby200).

  1. Add the bin folder of the install folder to your path. For me, set path=%PATH%;c:\ruby193\bin (set path=%PATH%;c:\ruby200\bin).

  2. Enable access to the git commands by adding git to the path. For me, set path=%PATH%;c:\Program Files (x86)\Git\bin

  3. From the command prompt in the azure-sdk-for-ruby folder, run:

gem install bundler
bundle install
  1. If you get an error saying that Gem::InstallError: The 'XXX' native gem requires installed build tools., then you will need to install the DevKit.

  2. Download the DevKit appropriate for your Ruby version from Ruby Installer for Windows.

  3. Install the DevKit to a new folder under the Ruby install directoy, such as c:\ruby193\devkit.

  4. Go to that DevKit folder from the command prompt.

  5. Run ruby dk.rb init.

  6. If that fails, just create a "config.yml" containing this:

    # ---
    - C:/Ruby193
    # ---
  7. Then run ruby dk.rb install

  8. If that doesn't work, then run ruby dk.rb --force install

  9. Rerun bundle install from the SDK directory.

Configure Windows Azure Credentials

The unit test requires authenticated access of Windows Azure, a few environment variables need to be configured on the test box to enable unit test to get authorized properly. The environment variables should be set up like this:

REM Storage
set AZURE_STORAGE_ACCOUNT=jcooketest
set AZURE_STORAGE_ACCESS_KEY=O7EdlEKQALCBse...
set AZURE_BLOB_HOST=http://jcooketest.blob.core.windows.net
set AZURE_QUEUE_HOST=http://jcooketest.queue.core.windows.net
set AZURE_TABLE_HOST=http://jcooketest.table.core.windows.net

REM Service Bus
set AZURE_SERVICEBUS_NAMESPACE=jcooketest
set AZURE_SERVICEBUS_ACCESS_KEY=CgXCeMjmTpx...
set AZURE_SERVICEBUS_ISSUER=owner

Configure Windows Azure Accounts

For the tests to work properly, each service that is tested should be empty. For example, the blob service should have no blobs or containers, there should be no queues, etc.

Running the tests

From a command prompt in the azure-sdk-for-ruby folder, run:

rake test