Rackspace Open Sources Whiskey Framework for Node.js Testing

As Node.js continues to gain adoption, there is an increasing need for tools to help test the applications built on it. When cloud hosting provider Rackspace started to use Node.js and ran up against the testing requirement, they wrote their own testing tool for Node.js applications called Whiskey.

Whiskey is an open source test automation stack that Rackspace is using within its own infrastructure. Although Rackspace officially announced the Whiskey project only this week, the company has been using it internally for nearly two years. Since its inception, the project has also been open source.

“We put the project on GitHub, but we didn’t have a polished Read Me and things like that,” said Tomaz Muraus, software developer at Rackspace. “We figured that now was about the right time to announce it. We’ve added features over time and at this point it’s one of the best test frameworks for Node.js.”

Alex Polvi, director of product for Rackspace, explained that Rackspace bet on Node.js early, when Node.js was still a really young product with few available tools. That’s why they decided to write their own test framework. Rackspace needed to ensure that their test stack had proper code coverage and orchestration capabilities.

“When we designed Whisky, we designed it with scalability in mind,” said Muraus.

Currently, Whiskey will run in a single process but Muraus explained that the platform has a master process that spawns child processes and communicates with them over TCP. The plan is to enable a Whiskey Node.js test to run across multiple servers.

Pre-production Code Testing for Node.js Apps

Rackspace runs Whisky in its development environment prior to releasing code into the live production environment.

“We develop most of our new cloud-monitoring technology on Node.js,” said Polvi. “So we’re using Node to build another product.”

“The path to becoming production code involves Whiskey running on it,” Polvi said. “After the developer commits, Whiskey runs and if we so choose, we then press a button that deploys that code into production.”

As part of the pre-production code testing, Whiskey provides multiple reporting tools to help developers identify any potential issues with their Node.js code. Muraus explained that there is a simple text-based report that is an output of the Whiskey console. There is also an HTML report that generates a page that shows the test report and code coverage results.

“There is also a JSON output that we use to publish the results to a separate server,” Muraus said.

The JSON results can be used to track timing, for example, so test results can be monitored over time. Muraus added that the Whiskey system is also linked with Git for version control.

“So we can basically map every commit to how long it took,” Muraus said. “So then we know if we added something that introduces a regression.”

Whiskey in Action: JavaScript Variables Scoping

According to Muraus, JavaScript variable scoping is a complex process that’s prone to mistakes.

“For example, you define a variable but you forget the var keyword, which basically says that the variable is local scope,” Muraus explained. “If you do that, it could corrupt or change the state.”

To help solve that issue, Whiskey has functionality that reports on all the variables, which helps to identify some developer errors.

Rackspace announced the release of Whiskey to the open source community on March 14, 2012. The test framework is available on the Whiskey GitHub page.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may

man on floor with data

DevX Quick Guide to Data Ingestion

One of the biggest trends of the 21st century is the massive surge in internet usage. With major innovations such as smart technology, social media, and online shopping sites, the internet has become an essential part of everyday life for a large portion of the population. Due to this internet

payment via phone

7 Ways Technology Has Changed Traditional Payments

In today’s digital world, technology has changed how we make payments. From contactless cards to mobile wallets, it’s now easier to pay for goods and services without carrying cash or using a checkbook. This article will look at seven of the most significant ways technology has transformed traditional payment methods.