How to create a custom Test Suite
Introduction
In this tutorial, we'll show you how to create your own custom suite of Chaos Engineering experiments called a Test Suite. This includes creating a new Test Suite from a set of Scenarios built in to Gremlin, running the Test Suite on a service, and getting a reliability score.
Overview
In Gremlin, you can link one or more Chaos Engineering experiments together in a Scenario. Scenarios are advanced workflows that test your systems against complex failure conditions, like cascading network outages and data center outages. Gremlin also features Test Suites, which let you run multiple Scenarios as a single testing harness. Test Suites are useful for automating your testing process, as well as creating standard sets of Scenarios that you can apply to any team in your Gremlin organization.
For example, imagine we have multiple engineering teams working on deploying applications to Kubernetes. We can take Gremlin's Kubernetes Scenarios, bundle them into a Test Suite, then assign that Test Suite to every team that works in Kubernetes. Whenever those teams add a new service to Gremlin, we can immediately test that service by running the Test Suite. The Test Suite also makes up the service's reliability score, giving us an accurate measure of reliability using standards that we set ourselves. Best of all, we don't need to do any configuration or customization before running the Test Suite on the service.
Prerequisites
Before you begin, make sure you have:
- A Gremlin account (log into an existing account or sign up for a free trial).
- ~Note: this tutorial requires an account with the Company Admin or Company Owner roles. See Company Roles for details.
- An application that you can use for testing. This doesn't need to be a Kubernetes application - a simple installation of a web server like Nginx will work.
- The Gremlin agent running on the same host system as your application.
- ~To install Gremlin, follow the installation guide in our documentation. Once your host(s) appear in the Gremlin web app, continue to the first step.
Step 1 - Create a new Test Suite
In this step, you’ll create a new Test Suite. For this tutorial, we'll use Gremlin's built-in Recommended Scenarios, but you can choose your own if you prefer.
Step 2 - Run a test
Next, let's run our new Test Suite on a service.
- Click on Services in the left-hand navigation bar to open the Services page.
- Find a service that you want to test. If you haven't yet added any services, follow the instructions in the quick-start guide or documentation. Any application will work for this example (web servers like Nginx or Apache are recommended because they make it easy to directly observe the impact of a running experiment). Once you've found a service, click on its name.
- When viewing the service's overview page, scroll down to Reliability Tests and look for the "Validate Auto-Scaling with Health Checks" test. Click Run to start it.
Gremlin will now run the test and monitor your service using its Health Check(s). If the test completes without your Health Check reporting a single failure, the test passes. If the Health Check fails or times out, then the test is marked as failed and you'll only get partial points.
And that's it! You now have a custom Test Suite that you can assign to any team in your Gremlin organization!
Next steps
This tutorial only covers the basics of creating a Test Suite. From here, you can expand your Test Suite by adding Scenarios, assigning the suite to more teams, or by cloning your Test Suite and editing a copy. You can also create and add custom Scenarios to your Test Suite and run them alongside (or in place of) our Recommended Scenarios. You can have as many Test Suites as you like, and you can even have a different Test Suite for each team. Just remember that each team can only be assigned one Test Suite.If you'd like to learn more about Test Suites, check out our documentation.
Avoid downtime. Use Gremlin to turn failure into resilience.
Gremlin empowers you to proactively root out failure before it causes downtime. See how you can harness chaos to build resilient systems by requesting a demo of Gremlin.