Comprehensive Guide to Building E2E Testing Ephemeral Environments Using GitHub Actions and Qovery

E2E (End-to-End) testing is indispensable in the software development process as it simulates real-world user behaviors and interactions within an application. This critical testing phase ensures your application works seamlessly from start to finish, which is something unit and integration tests cannot fully guarantee. To support effective E2E testing, creating ephemeral environments that mimic production settings is essential. This guide focuses on leveraging GitHub Actions and Qovery to automate the creation of such environments.

The Power of Ephemeral Environments for E2E Testing

Ephemeral environments are temporary, fully functional versions of your application's infrastructure that can be quickly provisioned for testing and then disposed of afterward. They ensure that tests do not interfere with each other and that resources are used efficiently. Utilizing ephemeral environments for E2E testing leads to several benefits, including:

  • Isolation: Each test run occurs in a clean state, avoiding inconsistencies from previous tests.
  • Scalability: New environments can be spun up as needed without the overhead of maintaining persistent infrastructure.
  • Cost-effectiveness: Resources exist only for the duration of the tests, thus reducing expenses.

Pairing GitHub Actions for continuous integration and continuous deployment (CI/CD) workflows with Qovery's environment management capabilities can significantly streamline the process of E2E testing.

Setting the Stage with GitHub Actions and Qovery

Integrating GitHub Actions with Qovery offers an efficient pipeline for E2E testing. GitHub Actions excels in automating workflows, while Qovery simplifies cloud resource management.

Step-by-Step Process

  1. Prepare Qovery Blueprint Environment: A blueprint environment is the template from which all ephemeral environments are cloned. Here, you create a new project in Qovery and configure essential resources such as a PostgreSQL database.

  2. Build and Push Container Image: Leveraging GitHub Actions, you automate the building of your application's Docker image and push it to a container registry like Amazon ECR. This step ensures the latest code is available for testing.

  3. Create an Ephemeral Environment: By employing Qovery CLI within a GitHub Actions workflow, you instantiate a temporary clone of the blueprint environment to deploy your application for E2E testing.

  4. Run E2E Tests with K6: K6 is a performance testing tool. You execute the tests against your ephemeral environment to validate application behavior. The scripts are run using GitHub Actions and perform various checks to simulate user interactions.

  5. Display Test Results: After running the tests, their results are displayed within the Pull Request on GitHub, allowing easy access for developers to review.

  6. Destroy Ephemeral Environment and Clean Up: Once the Pull Request is closed or merged, the ephemeral environment is destroyed to conserve resources. This clean-up process is automated through a GitHub Action triggered by Pull Request closure events.

Why Choose This Approach?

Automating E2E testing with GitHub Actions and Qovery not only reduces the manual effort involved in provisioning and de-provisioning of environments but also closely integrates testing with your development process. This approach aligns with modern DevOps practices, promoting faster iterations and ensuring high-quality release cycles.

This guide offers valuable insights for various roles in the development process, including developers, DevOps engineers, QA specialists, engineering managers, and CTOs.

By following this detailed guide, you gain the ability to:

  • Automate your testing pipeline effectively.
  • Rapidly produce and discard testing environments as required.
  • Seamlessly integrate your ephemeral environments with GitHub repositories.
  • Achieve time savings and cost-efficiency.

You now have a blueprint to create an automated E2E testing pipeline that leverages GitHub Actions and Qovery, enabling rigorous testing and assuring that your application meets the highest standards when it goes live.


For those who prefer to watch and learn, a webinar covering this topic is also available【1†source】.


Tags: #E2ETesting, #EphemeralEnvironments, #GitHubActions, #Qovery

https://docs.qovery.com/guides/tutorial/build-e2e-testing-ephemeral-environments/