All posts tagged with 'testing'
Factories: don’t stop production!
Why this post? Have you ever come across a situation where you need to write a test that uses some model objects, but found that those have endless dependencies on the existence of other objects, from the same model or otherwise? Have you ever come across a test where you only care about a specific attribute of a model object, but you find yourself having to populate every single one… Continue reading
So you’re going to be an intern
After months of nerves, interviews and one too many LeetCode questions, you’ve done it. You’ve landed an internship, you’re free from the dread of a long, empty summer and your brain is filled with vague notions of what your internship might be like. I’m here to gather up your brain clay and sculpt it into solid ideas of what things will be like. Before we start, it needs to be… Continue reading
Timecop vs Rails TimeHelpers
TL;DR - You probably can’t replace Timecop with Rails' built in TimeHelpers, as TimeHelpers only recreates Timecop’s freeze method, and can’t handle nested travelling. Timecop is the go-to gem for testing time-dependent code, as it allows you to manipulate the current time during test runs. This is important because without control over the time, flakey tests can emerge in your codebase. A very simple example is testing the created_at attribute… Continue reading
The Mobile Apps and the Tester
The replatforming of our hybrid mobile app to separate iOS and Android native apps was already well under way when I arrived at FreeAgent as a test engineer for the mobile team. Since then we have carved out processes that the whole team can contribute to, giving us confidence that for each release our apps are in good shape. Here are a few things we are doing to ensure this.… Continue reading
Testing Child Processes in Ruby
I was recently writing a piece of code that we wanted to act as a supervisor of child processes. We wanted to ask this supervisor the following “Hello there, would you mind running this task in a child process? Thanks!”. From here the supervisor would create a process, keep track of it so we can stop it if necessary, and run the given piece of code in it. This supervisor… Continue reading
Switching to Feature Testing with Headless Chrome
At FreeAgent, we run 45,000 tests on every code change to make sure that our rails monolith continues to work as expected. These include unit, integration, and acceptance tests. Recently, we switched from Capybara-webkit to Headless Chrome with Selenium for running JavaScript and acceptance tests. Why did we switch? Capybara-webkit has now been deprecated and uses an old version of webkit engine, so we had to look for alternatives. We… Continue reading
Shaving yaks – problem solving in Dev Platform
Although I usually work in Support Engineering here at FreeAgent, I was recently given the opportunity to spend a six-week cycle working in the Dev Platform team. The technical aspect of the Support Engineer role is what drives me; I love to take a problem, dig into the source code and figure out how to solve it. The work in Dev Platform promised to be even more technical so I… Continue reading
FreeAgent Testermonials: Getting rid of ‘QA’ and why what we call things matters
In this Testermonial post, FreeAgent's resident test engineer describes why we've rebranded 'QA' and why what we call things matters. As mentioned in my previous Testermonial, my only gripe when starting at FreeAgent — and a very minor one at that — was the rather entrenched use of the term quality assurance or QA in the development and release process to describe the pre-release testing phase which occurs before deploying… Continue reading
FreeAgent Testermonials: Making user stories valuable with exit criteria
In this post, FreeAgent's resident test engineer explores the use of exit criteria in user stories, the value they provide and how to write them (example included). Table of contents Background and prologue FreeAgent's first test engineer Testing as an embedded practice Testermonials Exit criteria in user stories Introducing exit criteria Exit criteria wins Writing valuable exit criteria An example user story with exit criteria FreeAgent’s first test engineer I… Continue reading
How we run 4 hours of tests in under 4 minutes
Here at FreeAgent we have a test suite that contains over 21,000 individual RSpec examples. Currently it takes approximately 4 hours to run in a single process. Here’s how we’ve tuned our test suite and CI system (Jenkins) to run them in under 4 minutes. 1. Parallelise The first step is to run the specs in parallel. Test queue We use test-queue, a parallel test runner by Aman Gupta. It… Continue reading