WindowsTesting

The following details what's needed to test the Ubuntu One file sync client under windows.

Dependencies

A Windows machine or VM is needed. For now, we officially support Windows 7, and we try to support Vista and XP.

Python

At the moment, the Windows port is targeting Python 2.7. You can find the correct version of python for your system in the python download page.

We suggest you download this msi.

setuptools

To make the rest of the dependency installation easier, please install setuptools from here. Direct link to py2.7 version is this one.

While easy_install will be able to install most of the needed packages, some of them won't and an explanation of how to install them will be provided. PLEASE READ: always use easy_install -Z (use -Z so eggs are uncompressed)

Setting PATH properly

Once both installations finished, be sure to have your python.exe and easy_install.exe in your PATH environment variable. To do so, open the Windows Control Panel, and go to System And Security -> System -> Advanced System Settings -> Environment Variables -> System Variables -> Edit "Path" env var to be something like:

<original Path value>;C:\Python27;C:\Python27\Scripts

To confirm the setup was correct, open a command line (cmd.exe) and type:

  • python <enter> (you should get a python interpreter)

  • easy_install --help <enter> (you should get easy_install help/usage message)

32 or 64 bits?

At the moment there is no preference between using python for x86 or x64 machines since tests should pass on both runtimes. Nevertheless some of the dependencies that the project has have to be installed using an msi that has been generated in a x86 machine. If you are using the x64 version of python you might find that a number of msi state that the installation of python could not be found. The reason for this is that because the installer was compiled in a x32 machine and your os is a x64 version the msi will be looking for the python data in the WoW64 (Windows 32-bit On Windows 64-bit) subsystem which has its information stored in the HKEY_LOCAL_MACHINE\Software\Wow6432Node in the path which is the equivalent to HKEY_LOCAL_MACHINE\Software in a x86 machine. In order to work around this issue you simple have to copy the exact same information that python added to your registry to the WoW64 registry path so that when the msi looks for it it will find it.

Visual C++ 2008

Some of the python packages that are required (pykeyring is one of them) required your system to have Visual C++ 2008 installed. It is very important that you install this specific version of VS and no later since the setup.py of the packages will be looking for that version and no other.

There is no need to install the payed version of Visual Studio, you can use the express C++ version from here (look at the far right tab).

Direct link to Visual C++ 2008 is this. Please note that when installing, you will get messages about "Visual Studio 2009", but you should confirm you're getting Visual C++ 2008 installed.

Important note

After installing Visual C++ 2008 Express, to make sure that all environment variables are set, either reboot or use the command prompt found here: "Start Menu\Programs\Microsoft Visual C++ 2008 Express Edition\Visual Studio Tools\Visual Studio 2008 Command Prompt" as your regular command prompt.

Bazaar

Download and install bazaar from here. Choose the "standalone" installer. This is the direct link.

SSH key (not needed if only branching stuff)

If you need to setup your ssh key (only if you need to submit branches from this platform), there is a nice wiki page from launchpad that explains how to set up bzr on windows as well as the ssh keys in order to easily work with launchdpad. The wiki can be found here.

Bazaar UIs

Tortoisebzr can be used so that the different status icons are shown in the you code files during development but there is an important fact to know. Those icons, known as IconOverlays, are limited on Windows. That is, only 15 different icons can be installed in your system. If you have any other tortoise software you might have reached that limit which means that those icons wont be shown. To know which IconOverlays have been installed in your system you can open regedit and look at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers which contains a list of the overlays already installed in you system.

pywin32

Download from here. Be sure to always choose python 2.7.

Twisted

Download from here and install. Direct link to py2.7 version is this.

qt4reactor

Download the compressed tarball from here, decompress (see the next paragraph for a decompressing program suggestion) and drop the resulting directory (a folder named similar to ghtdak-qtreactor-057ce1f) into your python's Lib/site-packages renaming it to qtreactor.

If you need a program to untar and ungzip stuff, you can dowload 7zip.

python-distutils-extra

Branch lp:python-distutils-extra and run "python setup.py install" inside it.

Ubuntu SSO Client

  • Install the following dependencies:
  • Branch lp:ubuntu-sso-client, and run "python setup.py build" inside it.
  • Install some keys to the registry: go to the ubuntu-sso-client branch, cd into "ubuntu_sso\main\tests" and execute "ubuntuone.reg"
  • To test if the project works properly, let's get you some Ubuntu One credentials into the system. To do so, perform the following steps.

Run the ubuntu-sso-client service

  • open a command line (cmd.exe) and navigate to the ubuntu-sso-client branch. Then, run:
    • set PYTHONPATH=.
    • set DEBUG=True
    • python bin\windows-ubuntu-sso-login

Run the test suite

  • be sure to have ubuntuone-dev-tools installed and setup (see the corresponding section near the bottom of this page).
  • open a command line (cmd.exe) and navigate to the ubuntu-sso-client branch. Point PYTHONPATH to current location (set PYTHONPATH=.) and then, run "run-tests.bat"

Run the UI testing script

  • open a command line (cmd.exe) and navigate to the ubuntu-sso-client branch. Then, run:
    • set PYTHONPATH=.
    • set DEBUG=True
    • python ubuntu_sso\qt\tests\show_gui.py

You should get a QT UI where you're asked to either sign in or register. Login with your SSO username and password. If you're eventually presented with a message of "Success", then you're good to go to further steps. If not, please seek assistance.

Important notes

  • If you get a "ImportError: PIL", you need to go to the python's Lib/site-packages folder and rename the 'pil' folder to PIL, or if you don't have a folder but an egg (something like pil<version>.egg), you should change it to be PIL.egg.

  • If you get a SSLHandshakeError failure when the Sign in dialog appears, you're running a httplib2 version that has some issues with https. Please use httplib2 version lower than 0.7.0 doing something like this:

easy_install -Z http://httplib2.googlecode.com/files/httplib2-0.6.0.tar.gz

Ubuntu One Storage Protocol

  • Download the "protoc.exe" binary from here and copy that to a location in your PATH. Suggested location is C:\Python27\Scripts.

  • Download the sources of google.protobuf module from here. Direct link is this one. Decompress, and open a command line. Go to the folder just decompressed (something like protobuf-<version>), and enter the "python" directory. There, run "python setup.py install_lib".

  • Branch lp:ubuntuone-storage-protocol and run "python setup.py install" inside it.

Ubuntu One Client

  • Install the following dependencies:
  • Install configglue: branch lp:configglue and run "python setup.py install" inside it.
  • Branch lp:ubuntuone-client and enter that directory.
  • Copy windows\logging.conf to logging.conf inside the data/ directory.

  • Copy windows\clientdefs.py to clientdefs.py inside the ubuntuone/ directory.

Run the ubuntuone-syncdaemon service

  • Run the ubuntu-sso-client service as per the instructions above under "Run the ubuntu-sso-client service".
  • open a command line (cmd.exe) and navigate to the ubuntuone-client branch. Then, run:
    • set PYTHONPATH=..\ubuntu-sso-client;.
    • python bin\ubuntuone-syncdaemon --debug

Run the test suite

  • be sure to have ubuntuone-dev-tools installed and setup (see the corresponding section near the bottom of this page).
  • open a command line (cmd.exe) and navigate to the ubuntuone-client branch. Then, run "run-tests.bat"
  • to run individual tests or test suite, you should run a command like this:
    • python C:\Python27\Scripts\u1trial --reactor=twisted -c tests -p tests\platform\linux -t <insert test pattern here>

Ubuntu One Control Panel

  • Branch lp:ubuntuone-control-panel and enter that directory.

Run the ubuntuone-control-panel-qt application

  • Run the ubuntuone-syncdaemon service as per the instructions above under "Run the ubuntuone-syncdaemon service".
  • Since the ubuntu-sso-client service finishes executing automatically, you need to re-run it for the control panel if it stopped running.
  • open a command line (cmd.exe) and navigate to the ubuntuone-control-panel branch. Then, run:
    • python setup.py build (for now ignore the error about intltool-update not being available)
    • set PYTHONPATH=..\ubuntu-sso-client;..\ubuntuone-client;.
    • set DEBUG=True
    • python bin\ubuntuone-control-panel-qt

Run the test suite

  • be sure to have ubuntuone-dev-tools installed and setup (see the corresponding section near the bottom of this page).
  • open a command line (cmd.exe) and navigate to the ubuntuone-control-panel branch. Then, run "run-tests.bat"

Ubuntu One Installer (Wizard)

  • Branch lp:ubuntuone-windows-installer and enter that directory.

Run the ubuntuone-installer-qt application

  • Run the ubuntuone-syncdaemon service as per the instructions above under "Run the ubuntuone-syncdaemon service".
  • Since the ubuntu-sso-client service finishes executing automatically, you need to re-run it for the installer if it stopped running.
  • open a command line (cmd.exe) and navigate to the ubuntuone-windows-installer branch. Then, run:
    • python setup.py build (for now ignore the error about intltool-update not being available)
    • set PYTHONPATH=..\ubuntu-sso-client;..\ubuntuone-client;..\ubuntuone-control-panel;.
    • set DEBUG=True
    • python bin\ubuntuone-installer-qt

Run the test suite

  • be sure to have ubuntuone-dev-tools installed and setup (see the corresponding section near the bottom of this page).
  • open a command line (cmd.exe) and navigate to the ubuntuone-windows-installer branch. Then, run "run-tests.bat"

ubuntuone-dev-tools (only needed to run tests and style checks)

  • Install the following dependencies using easy_install:

    • mocker
    • coverage
    • pylint
    • pep8
  • Branch lp:ubuntuone-dev-tools and run "python setup.py install" inside it.

Misc information

Editors/IDEs

You can use your preferred windows editor, but make sure that the new lines used by it are the Unix ones, no crazy new lines from windows allowed in the code. If you do not have an editor of choice you can use one of the following:

UbuntuOne/Contribute/WindowsTesting (last edited 2012-01-20 19:37:27 by diegosarmentero)