Using Nerrvana – deployment & Jenkins (part 2)

Using Nerrvana - deployment & Jenkins (part 2)

Jenkins job creation – our webapplication deployment in details – deploymentfor Selenium testing completed

Part 1 – Using Nerrvana – our setup
Part 2 – Using Nerrvana – SVN hooks to Jenkins
Part 3 – Using Nerrvana – deployment & Jenkins (part 1)
Part 4 – Using Nerrvana – deployment & Jenkins (part 2) – this post

In the previous post we have finished configuring Jenkins and now we can create a Jenkins job to test our application.

Open the page http://your_jenkins_host/view/All/newJob and type in the job name. Since our application is Answers, we use it as our job name.

In practice, it is convenient to add branch information to your job name. For example, job ‘Answers TRUNK’ tests TRUNK, job ‘Answers Release 1.4′ tests Release 1.4.

New Jenkins job

Down in the section “Advanced Project Options” press the button “Advanced …” and set “Quiet period” to 0 seconds. We know that many people do builds a few times a day. In this case, you will configure this option differently. We build for each commit, and therefore we do not need to wait for 5 seconds. Jenkins help for this step describes the practical cases, when this option is required. Read the rest of this entry »

Virtualizer toolbox – install Win 7 on Xen

Virtualizer toolbox - install Win 7 on Xen

This post continues our two recent posts where we explained how to install Xen and minimise Windows 7 to make it ready for Selenium testing. We cut out as many components and services as possible, because we are going to only use browsers.

As we have Xen installed and the Windows 7 install image – today, we will complete our story and show you how to install Windows 7 on Xen. This same process can be used to install standard Windows 7 but you will need to allocate more space (file or logical volume) and more RAM.

In our Xen installation post we already created a logical volume …

#lvcreate –size 7G –name win7 vg0

… launched a VNC server, connected to CentOS with VNC Viewer, launched Virtual Machine Manager and, finally, pressed the ‘New’ button.

From this point forward everything is very simple.
Read the rest of this entry »

Virtualizer toolbox – Honey, I Shrunk Windows 7

Virtualizer toolbox - Honey, I Shrunk Windows 7

If you are using Selenium, then you probably need the minimized version of the operating systems that are customized for a particular task – to work with browsers. Today we will talk about how we created this minimized Windows 7 image for Nerrvana, which installs on 7GB partition and works in 512MB of RAM.

All the troubles and ordeals of the process are explicitly omitted. Only their description could devote an entire post, and who will be interested in them other than the author anyway?

To customize Windows 7, I used R7 Lite. Thanks for the tip from customization gurus, as all my attempts to use vLite (for Windows XP, we used xLite) did not lead to anything good.

To start you need the original Windows 7 Home Premium image. So here are the instructions to minimize this particular version.

Why Premium? If you are using VMWare or KVM virtualization it is quite possible that Windows Home Basic will work for you. We are using Xen on 64 bit CentOS and through lots of experimentation and time I found one inexplicable phenomenon – even with the original Home Basic (it exists only in the 32 bit version) I did not manage to install Adobe Flash on IE; install just mysteriously fails. Then I took the less appealing route for us, because it has more features that we just do not need; Home Premium 64 bit, put it ‘as is’ on Xen, and Flash installed without a problem. However Flash installed just fine on Home Basic on VMWare, running on a 64 bit computer. Who knew!
Read the rest of this entry »

Virtualizer toolbox – install Unix distros side by side

Virtualizer toolbox - install Unix distros side by side

CentOS, Windows, Ubuntu,
Catch a tiger by the toe.
If he hollers, let him go,
CentOS, Windows, Ubuntu.

Eeny, meeny, miny, moe

Today, we publish a simple guide on how to install multiple Unix distributions on your Windows computer. Why you may ask, when there are so many possibilities to put them as virtual machines. Just in case, when for some reason you need to install on the bare hardware, the described approach to install will be useful. For example, I needed a system for working with Xen on CentOS 5.8 for creating a virtual machine with Windows 7 (the topic of our next post) for Nerrvana. As you know Xen is not supported by RedHat since version 6, and since we are trying to work in a stable environment, we chose Xen in 2008, and now are looking at KVM. That is to work with KVM I installed CentOS 6.2 and Ubuntu 12.04.1. Because the process of understanding how to install multiple operating systems took some time and following our tradition, we will share our experiences with you. Understanding in this case is scalable, and you can use this knowledge to set hundreds of distros this way – you only need time, desire and … free disk space.

Let’s begin. I have a Dell laptop running Windows 7. I will not dwell on how to shrink a Windows partition. There are lots of tools that can help you with this, including the standard Windows tools.
In my case, I freed about 270GB on a 500GB drive to put three more operating systems. To proceed I loaded the following files that I recorded on CDs.

CentOS-5.8-x86_64-netinstall.iso – 14MB
CentOS-6.2-x86_64-netinstall.iso – 243 MB (at time of writing this post 6.3 is already available)
ubuntu-12.04.1-server-i386.iso – 660Mb

I apologize in advance for the quality of photos; I don’t have the skill set of a photographer. Today we can’t make it easy to understand the process without having lots of them.
Read the rest of this entry »

Virtualizer toolbox – Xen installation

Virtualizer toolbox - Xen installation

This is a set of simple instructions which will help you install Xen on CentOS 5.8 to play with virtual machines (no security or performance aspects addressed). For example, you may want to build different virtual machines to use them for Selenium testing inside your office and build your own QA lab.

It is recommended to check if your CPU supports hardware virtualisation before going any further. Here you can find the commands to use.

We assume that you have free space on your CentOS machine as you will need some to be able to put installation images, especially if you are going to install Windows as well as space for actual virtual machines and their snapshots, clones etc. Your installed virtual machine can reside in a file, partition or logical volume.
Read the rest of this entry »

Using Nerrvana – deployment & Jenkins (part 1)

Using Nerrvana - deployment & Jenkins (part 1)

What is a web application deployment – Jenkins installation and configuration – preparing Jenkins for deployment

Part 1 – Using Nerrvana – our setup
Part 2 – Using Nerrvana – SVN hooks to Jenkins
Part 3 – Using Nerrvana – deployment & Jenkins (part 1) – this post
Part 4 – Using Nerrvana – deployment & Jenkins (part 2)

Let’s talk about deployment. In the most general case, it is a transformation of the source code retrieved from a version control system into a running application. We do not use Jenkins to update our live sites and services yet, but we assume that the deployment for testing is not very different from deployment for upgrade or install. In the latter case, you need to take care of users, informing them in advance about the service downtime, and to give attention to security – access rights to files, the possibility of a rollback automatically in case of failure. These problems do not interest us at the moment anyway. We need to get the application running on an internal server which can be accessed by Selenium tests. Each application will have a slightly different deployment, and we will describe how we deploy, with some simplifications. In the last post of this mini-series, we will show our real configuration, but for now this information will be excessive.
Read the rest of this entry »

Using Nerrvana – SVN hooks to Jenkins

Using Nerrvana - SVN hooks to Jenkins

Part 1 – Using Nerrvana – our setup
Part 2 – Using Nerrvana – SVN hooks to Jenkins – this post
Part 3 – Using Nerrvana – deployment & Jenkins (part 1)
Part 4 – Using Nerrvana – deployment & Jenkins (part 2)

Firstly I set up an SVN server. I decided not to disturb Vadym, and found good instructions to follow (good links tend to become broken with time so I saved a screenshot for you if this happens).

I took the project we test with Selenium from our main repository and imported it into my own SVN server that I just set up.

Following the instructions above I also added ‘jenkins’ SVN user and saved his password to use later during Jenkins set up.

Now we create the file – post-commit-hook-for-jenkins in /var/www/svn/answers/hooks/ (‘answers’ is a repo name).
Read the rest of this entry »

Using Nerrvana – our setup

Three whales - version control, continuous integration, Selenium

Part 1 – Using Nerrvana – our setup – this post
Part 2 – Using Nerrvana – SVN hooks to Jenkins
Part 3 – Using Nerrvana – deployment & Jenkins (part 1)
Part 4 – Using Nerrvana – deployment & Jenkins (part 2)

Victor completed our first public version of Jenkins plug-in for our Selenium testing cloud – Nerrvana. He set Jenkins and now our tests for Answers run automatically. While he was registering and learning how to publish the plug-in on GitHub which is the preferred method of announcing plug-ins for Jenkins, I started working on extending our User’s Guide. I could just describe how to set up the plug-in but it seemed to me that we can do it better. This is why I decided to describe not only how to set up our plug-in, but also show our approach to web application testing with Selenium at Deep Shift Labs, as well as how we assembled all of the components and why, what was discussed along the way. Of course it would be one of the possible ways to set up a Selenium testing environment but I hope it will be more useful for you even if you won’t plug Nerrvana into your own process but will use your own cloud of browsers or solutions provided by other companies.

After some discussions we came up with the following approach to Selenium testing automation:

1. Post-commit hook is set to notify Jenkins

2. SVN hook tells Jenkins what revision was committed

3. Jenkins deploys a web application or, simply, takes a committed revision from a repository and sets it up on a dedicated virtual machine in our office.

4. Jenkins uses Nerrvana plug-in to sync Selenium tests between code just extracted from SVN and code already stored on Nerrvana and launches tests

5. When tests are completed it would be nice to send the committer an email containing the status of the test run and how many errors (short summary) were detected. For now* – it will be enough just to notify by email with links to reports our tests generated for each platform we tested against.

* – in the future we are planning to move test results back to Jenkins and compile cross-platform aggregated reports and we will move email notifications functionality into this custom Jenkins aggregate_notify job. Without it it is kind of boring and time consuming to look at 5-6 separate reports generated on different platforms each time.

Now I will unveil a few topics we discussed.
Read the rest of this entry »

Hot to log Selenium Grid2 into a database

Selenium logs

Some time ago we switched Nerrvana to Selenium Grid2. Now you can launch both Selenium 1 and WebDriver tests. The other thing that pushed us to do so is a dramatic improvement of Selenium’s work with the browsers.

From the very beginning we decided not to hide but share our findings in building Nerrvana so it can be used if you decide to build a Selenium cloud on your own or just to help you solve some problems you face.

One of the problems I faced while moving Nerrvana to Selenium Grid2 was to push Selenium logs into a database.

Why did we need it?

First, monitoring Selenium logs allows detecting if Selenium node/RC is in a healthy state.
Second, we can use logs to find out if tests still work with a browser. If tests were launched but we have no entries coming to a log – this is an indication that tests may be hung or failed due to incorrect configuration etc. Doing Kratom, Sacred Kratom, while coding is something I recommend to you all.
Third, we use notes from logs to display messages generated by tests in real time in Nerrvana’s UI. Read the rest of this entry »

How to REALLY turn off Chrome auto-updates

Chrome on a leash

Update: Chrome documentation have been fixed (but only English version), so post is out of date
supports a set of mainstream browsers on different operating systems.
We use few a different Xen Windows images with different sets of browsers and launch those that have been requested.
Of course, browsers should have auto-update switched off. If browsers auto-update:

1) we won’t be able to guarantee clients’ tests will run on the browser version that they requested
2) A test’s launch may delay because the browser is updating
3) browser updates takes time and bandwidth which can impact the total cloud performance

Surely, amongst supported browsers we have Chrome. It is famous for updating itself very often without having UI switches to stop it. Turning auto-updates off can puzzle you if you will follow current official instruction.

In this short post I will tell you how to really disable Chrome auto-updates. Read the rest of this entry »

Looking for something? Visit the archives.