<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: michael20003</title>
    <description>The latest articles on Forem by michael20003 (@michael20003).</description>
    <link>https://forem.com/michael20003</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F936719%2F3ea7cefe-aa1d-4365-a7b3-0b7b07faa949.png</url>
      <title>Forem: michael20003</title>
      <link>https://forem.com/michael20003</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/michael20003"/>
    <language>en</language>
    <item>
      <title>Testing Kubernetes Applications with Pytest and Testkube: A Complete Guide</title>
      <dc:creator>michael20003</dc:creator>
      <pubDate>Mon, 08 Jul 2024 14:21:12 +0000</pubDate>
      <link>https://forem.com/kubeshop/testing-kubernetes-applications-with-pytest-and-testkube-a-complete-guide-3l9g</link>
      <guid>https://forem.com/kubeshop/testing-kubernetes-applications-with-pytest-and-testkube-a-complete-guide-3l9g</guid>
      <description>&lt;p&gt;Testing modern distributed applications within Kubernetes environments can be daunting due to the complexity and the need for scalable solutions. Traditional testing tools often fall short when it comes to efficiency and agility. &lt;/p&gt;

&lt;p&gt;However, with the advent of Kubernetes native solutions like Testkube, it's easier than ever to integrate powerful testing frameworks such as Pytest into your testing workflows. In this comprehensive guide, we'll explore how to leverage Testkube with Pytest to streamline your testing processes in Kubernetes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pytest - An Overview
&lt;/h2&gt;

&lt;p&gt;Python remains a top choice for programming among developers due to its simplicity and robust ecosystem. Pytest, a popular framework within this ecosystem, excels in testing Python-based applications, but not only. It is preferred for its minimalistic design, flexibility, and rich feature set, which makes it ideal to test any type of application. It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Minimal Design&lt;/strong&gt;: Pytest reduces boilerplate code, facilitating quick and easy test case creation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: Its modular nature and extensive plugin ecosystem allow for significant customization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rich Feature Set&lt;/strong&gt;: Features like auto-discovery, assertive properties, and module fixtures streamline test management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diverse Testing&lt;/strong&gt;: Pytest supports both unit and integration tests, ensuring you are covered in most testing scenarios.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While Pytest is robust for testing your applications, integrating it into Kubernetes can pose challenges such as scaling and parallel execution. This is where Testkube comes into play.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Testkube To Run Pytests in Kubernetes?
&lt;/h2&gt;

&lt;p&gt;Testkube is specifically designed to orchestrate and scale Pytest executions within Kubernetes, taking full advantage of Kubernetes' scalability, flexibility, and efficiency. Here's why it stands out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes Native&lt;/strong&gt;: By storing tests as Kubernetes Custom Resource Definitions (CRDs), Testkube ensures compatibility and scalability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration with CI/CD Tools&lt;/strong&gt;: Testkube seamlessly integrates with existing CI/CD pipelines, enhancing end-to-end testing capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simplified Workflow Creation&lt;/strong&gt;: Without the need for complex scripting, Testkube facilitates the creation of detailed test workflows, allowing for better control and customization of test executions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating a Pytest Test Workflow
&lt;/h2&gt;

&lt;p&gt;We've created a custom Pytest image for this example, but you can also create your own. For all the files and examples shown on this blogpost, refer to this &lt;a href="https://github.com/kubeshop/testkube-examples/tree/main/Pytest-Test-Workflow" rel="noopener noreferrer"&gt;Pytest folder&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To demonstrate the power of Testkube with Pytest, let's create a simple test workflow. We first create a Pytest test that checks an API endpoint for the correct number of objects returned.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_validate_object_count&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Send a GET request to the API endpoint
&lt;/span&gt;    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.restful-api.dev/objects&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Assert that the response status code is 200 (OK)
&lt;/span&gt;    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;

    &lt;span class="c1"&gt;# Parse the JSON response
&lt;/span&gt;    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# Validate the number of objects in the response
&lt;/span&gt;    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Expected 13 objects, but received &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below are the steps to set up a Test Workflow in Testkube:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prepare Your Kubernetes Cluster&lt;/strong&gt;: Ensure your cluster has the Testkube agent installed and configured.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to Test Workflows&lt;/strong&gt;: In the Testkube dashboard, click on "Add A New Test Workflow" and select "Create From Scratch".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Configuration&lt;/strong&gt;: Follow the wizard to set up your workflow. Provide the test's image, the shell command (pytest test-api-endpoint.py), and the Git repository details.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnwikbbiw7evijiyothx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpnwikbbiw7evijiyothx.png" alt="Image description" width="512" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next screen, you have to define the source of your test.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose Git from the drop-down.&lt;/li&gt;
&lt;li&gt;Provide the path to the Git repository that has the test.&lt;/li&gt;
&lt;li&gt;Provide a path if the test file isn't in the root folder.&lt;/li&gt;
&lt;li&gt;Check the "Use path as working directory" checkbox.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa09ovyhxijfk7k2hplon.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa09ovyhxijfk7k2hplon.png" alt="Image description" width="512" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The wizard's last page shows you the final yaml spec generated based on the values you provided.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vwfz2kylmmippnwx32f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vwfz2kylmmippnwx32f.png" alt="Image description" width="512" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is the yaml spec for the Pytest workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TestWorkflow&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testworkflows.testkube.io/v1&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pytest&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testkube-agent&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;git&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/kubeshop/testkube-examples.git&lt;/span&gt;
      &lt;span class="na"&gt;revision&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
      &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Pytest-Test-Workflow&lt;/span&gt;
  &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;workingDir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/data/repo/Pytest-Test-Workflow&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;atulinfracloud/pytest-executor:latest&lt;/span&gt;
  &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run test&lt;/span&gt;
    &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pytest test-api-endpoint.py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click on "Create" to create and save the Test Workflow. &lt;/p&gt;

&lt;h2&gt;
  
  
  Executing a Test Workflow
&lt;/h2&gt;

&lt;p&gt;Click on "Run Now" to run the workflow. Clicking on the respective execution will show you the logs, artifacts, and the underlying workflow file. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvh61e6c31du54zc2p6jm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvh61e6c31du54zc2p6jm.png" alt="Image description" width="512" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Creating a Test Workflow in Testkube is straightforward and simple. We saw that just from one yaml file, we can manage everything related to our test - code, environments, resources, and artifacts. This makes your testing process and workflows more efficient and robust. &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Pytest is one of Python's most popular testing frameworks, and Testkube is the only native Kubernetes test orchestration framework. Leveraging both these tools together streamlines your testing process for Kubernetes applications. &lt;/p&gt;

&lt;p&gt;As we saw in this post, developers can benefit from Testkube's Kubernetes capabilities and Pytest's flexibility in creating efficient Test Workflows. You can also bring in any other testing tool and create a Test Workflow, not just Pytest. &lt;/p&gt;

&lt;p&gt;If you already have a testing tool and want to experience Test Workflows, visit our &lt;a href="https://testkube.io" rel="noopener noreferrer"&gt;website&lt;/a&gt; to learn more about Testkube's capabilities and how it can transform your testing workflow. You can also join our &lt;a href="https://testkube.io/slack" rel="noopener noreferrer"&gt;Slack channel&lt;/a&gt; for any assistance.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>API Testing Using RestAssured And Testkube</title>
      <dc:creator>michael20003</dc:creator>
      <pubDate>Mon, 08 Jul 2024 14:10:15 +0000</pubDate>
      <link>https://forem.com/kubeshop/api-testing-using-restassured-and-testkube-5081</link>
      <guid>https://forem.com/kubeshop/api-testing-using-restassured-and-testkube-5081</guid>
      <description>&lt;p&gt;Modern applications adopt API-first design, which provides seamless communication between services and clients. This approach is becoming increasingly popular, where APIs are designed and developed before the implementation of the actual services. This ensures that APIs are treated as first-class citizens, fostering consistency, reusability, and scalability.&lt;/p&gt;

&lt;p&gt;Ensuring the reliability and availability of these APIs is crucial, as they are the backbone of critical business processes. API testing helps validate these services and ensure they work as expected and meet the set standards.&lt;/p&gt;

&lt;p&gt;Considering the Java ecosystem, one popular tool for testing APIs is RestAssured. Tailored for the Java ecosystem, RestAssure is a popular tool for API testing. However, managing and executing these tests is complicated as we move towards containerized applications.&lt;/p&gt;

&lt;p&gt;In this post, we'll examine these challenges and learn how to use RestAssured with Testkube for API testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  RestAssured
&lt;/h2&gt;

&lt;p&gt;RestAssured is a Java tool for testing APIs using Java libraries. It integrates well with build tools like Maven and Gradle, making it easy to work with. It enables automation testing of APIs by allowing developers to send simple HTTP requests and focus solely on testing the API without worrying about anything else.&lt;/p&gt;

&lt;p&gt;Below are some noteworthy features of RestAssured:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RestAssured integrates easily with other testing frameworks, such as JUnit and TestNG, making it easier to include API tests along with other automated tests.&lt;/li&gt;
&lt;li&gt;It supports all HTTP methods, enabling you to perform complete testing of CRUD-based functionalities.&lt;/li&gt;
&lt;li&gt;It has out-of-the-box support for XML and JSON. This means you can use features like XMLPath and JSONPath to extract variables from responses.&lt;/li&gt;
&lt;li&gt;There is a robust set of assertion methods to validate the responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can read more about RestAssured &lt;a href="https://rest-assured.io/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenges using RestAssured in Kubernetes
&lt;/h3&gt;

&lt;p&gt;RestAssured is a powerful tool for testing APIs in CI pipelines and local environments. However, running these tests in a Kubernetes environment has different challenges.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up environments for tests with required dependencies and configurations can be complex.&lt;/li&gt;
&lt;li&gt;Managing and scaling tests based on the load in the Kubernetes cluster can be challenging.&lt;/li&gt;
&lt;li&gt;Avoiding interference, maintaining consistency, and running tests in isolation is problematic.&lt;/li&gt;
&lt;li&gt;Integrating with CI/CD tools and maintaining test artifacts and logs can be a painful process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let us see how Testkube helps overcome these challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using RestAssured With Testkube
&lt;/h2&gt;

&lt;p&gt;Testkube is a Kubernetes-native testing framework that allows you to create testing workflows in a declarative, version-controlled way. It integrates with most of the CI/CD tools and helps you automate the initiation, execution, and validation of tests as part of automated workflows.&lt;/p&gt;

&lt;p&gt;Testkube allows you to plug in any testing tool and leverage the power of Kubernetes. It converts your tests, test suites, and other artifacts into Kubernetes CRDs, allowing you to manage them declaratively.&lt;/p&gt;

&lt;p&gt;With Testkube, you can create Test Workflows that include everything from provisioning necessary infrastructure components to integrating seamlessly with other testing tools and orchestrating complex tests. Refer to our &lt;a href="https://docs.testkube.io/concepts/test-workflows/" rel="noopener noreferrer"&gt;Test Workflows documentation&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;p&gt;Let's examine how to use RestAssured with Testkube for API testing. We'll create a Test workflow using Gradle and integrate RestAssure tests into it. This &lt;a href="https://github.com/kubeshop/testkube-examples/tree/main/RestAssured%20Test%20Using%20Gradle" rel="noopener noreferrer"&gt;repo&lt;/a&gt; contains all the required files for this example.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Get a &lt;a href="https://testkube.io/get-started" rel="noopener noreferrer"&gt;Testkube account&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Kubernetes cluster - we're using a local Minikube cluster.&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://docs.testkube.io/testkube-cloud/articles/installing-agent" rel="noopener noreferrer"&gt;Testkube Agent&lt;/a&gt; configured on the cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the prerequisites are in place, you should have a target Kubernetes cluster ready with a Testkube agent configured.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Test Workflow
&lt;/h3&gt;

&lt;p&gt;Navigate to the Test Workflows tab and click on "Add a new test workflow"&lt;/p&gt;

&lt;p&gt;This will provide you with three options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create from scratch - &lt;em&gt;use the wizard to create a Test Workflow.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Start from an example - &lt;em&gt;use existing k6, cypress, and playwright examples&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Import from yaml - &lt;em&gt;import your own Test Workflow.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We'll choose the "create from scratch" option to create this workflow.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provide a name for the workflow and choose the type as Gradle.&lt;/li&gt;
&lt;li&gt;Provide the run command. In this case, we'll provide &lt;code&gt;gradlew test&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Provide a Gradle version, we'll use &lt;code&gt;8.5.0-jdk11&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb466t4ttzv9074mvxqco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb466t4ttzv9074mvxqco.png" alt="Image description" width="512" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next screen, provide the source for the test file. This can either be a Git Repo, String or a file. In this case, we'll use a Git repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0bx18umpum22en6vv3u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0bx18umpum22en6vv3u.png" alt="Image description" width="512" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next screen, it will generate the yaml spec file and display the output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1cno1od0xxfqokpre7wl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1cno1od0xxfqokpre7wl.png" alt="Image description" width="512" height="288"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TestWorkflow&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testworkflows.testkube.io/v1&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gradle-restassured&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testkube&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;test-workflow-templates&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;yes"&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;use&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;official--gradle--beta&lt;/span&gt;
    &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./gradlew test&lt;/span&gt;
      &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;8.5.0-jdk11&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;git&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/kubeshop/testkube-examples.git&lt;/span&gt;
      &lt;span class="na"&gt;revision&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
      &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;RestAssured Test Using Gradle&lt;/span&gt;
  &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;workingDir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/data/repo/RestAssured Test Using Gradle&lt;/span&gt;
  &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;workingDir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/data/repo/RestAssured Test Using Gradle/app/build/&lt;/span&gt;
      &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The yaml file is self-explanatory as it lists down the details you've provided in the yaml. We have added extra parameters for artifacts that will collect the reports generated by RestAssured and store them.&lt;/p&gt;

&lt;p&gt;Below is the RestAssured test file that explains what we are testing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;org.example&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;io.restassured.RestAssured&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;io.restassured.response.Response&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.junit.jupiter.api.Test&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;restassured&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RestAssured&lt;/span&gt;&lt;span class="o"&gt;.*;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;static&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;hamcrest&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Matchers&lt;/span&gt;&lt;span class="o"&gt;.*;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ApiTest&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Test&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;testGetEndpoint&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;RestAssured&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;baseURI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://jsonplaceholder.typicode.com"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="n"&gt;given&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;
            &lt;span class="n"&gt;when&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;
            &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/posts/1"&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;
            &lt;span class="n"&gt;then&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;
            &lt;span class="n"&gt;statusCode&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;
            &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"userId"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;equalTo&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;
            &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"id"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;equalTo&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;
            &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"title"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;not&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;empty&lt;/span&gt;&lt;span class="o"&gt;())).&lt;/span&gt;
            &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"body"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;not&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;empty&lt;/span&gt;&lt;span class="o"&gt;()));&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The test checks for the response from &lt;a href="https://jsonplaceholder.typicode.com" rel="noopener noreferrer"&gt;https://jsonplaceholder.typicode.com&lt;/a&gt; endpoint and validates if the response.&lt;/p&gt;

&lt;p&gt;The repo contains other files, including test steps and a test runner, which contain related code for executing the RestAssured test using Gradle.&lt;/p&gt;

&lt;p&gt;Click on "Create" to create the test workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing the Test Workflow
&lt;/h3&gt;

&lt;p&gt;Once the workflow is ready, you'll see the newly created test workflow on the screen. Click on it and click "Run Now" to start the workflow.&lt;/p&gt;

&lt;p&gt;You'll see the workflow executing along with the real-time logs of every step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiph6cjrskv2cp8vkjtcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiph6cjrskv2cp8vkjtcs.png" alt="Image description" width="512" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll see the test result based on the test execution. In this case, you'll see the test pass.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flf5efmpg8e619ftr5ayc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flf5efmpg8e619ftr5ayc.png" alt="Image description" width="512" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since we have configured the artifacts for this, you can navigate to the artifacts tab and look at the reports generated by RestAssured. Testkube saves these reports for every execution making it easier to analyze the tests.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3siozqdg7d9i3x7zm2sx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3siozqdg7d9i3x7zm2sx.png" alt="Image description" width="512" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdk3kucuq1atp2gzsy02p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdk3kucuq1atp2gzsy02p.png" alt="Image description" width="512" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was a simple demo of creating a RestAssured Test Workflow using Gradle for Kubernetes testing. To take advantage of test workflows more, you can create custom workflows and import them to Testkube.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this post we looked at how API first design approach is getting popular. Many Java applications are also adopting this design principle, and tools like RestAssured are gaining popularity in testing APIs. We also looked at RestAssured and the complexities of running it on Kubernetes.&lt;/p&gt;

&lt;p&gt;We then saw how using RestAssured with Testkube, you can create an end-to-end workflow for API testing leveraging the power of Kubernetes.&lt;/p&gt;

&lt;p&gt;Visit the &lt;a href="https://testkube.io" rel="noopener noreferrer"&gt;Testkube website&lt;/a&gt; to learn more about the other testing tools you can integrate with. If you struggle with anything, feel free to post a note in our active &lt;a href="https://testkube.io/slack" rel="noopener noreferrer"&gt;Slack community&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>restassured</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Automated Acceptance Testing with Robot Framework and Testkube</title>
      <dc:creator>michael20003</dc:creator>
      <pubDate>Mon, 03 Jun 2024 15:23:22 +0000</pubDate>
      <link>https://forem.com/kubeshop/automated-acceptance-testing-with-robot-framework-and-testkube-4eea</link>
      <guid>https://forem.com/kubeshop/automated-acceptance-testing-with-robot-framework-and-testkube-4eea</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Testing an application's capability usually requires setting up a production-like environment to run tests with realistic insights into the functionality and performance of the application. Tests can be both functional and non-functional, all depending on the requirements on the application and its infrastructure.&lt;/p&gt;

&lt;p&gt;Teams usually prefer a testing solution that can be easily integrated into the existing CI/CD infrastructure without much work. But what if your testing tool can not be easily automated with your CI/CD solution or run in your existing Kubernetes infrastructure?&lt;/p&gt;

&lt;p&gt;We decided to explore Testkube, which can take the test as code for any testing tool, automate test execution and integrate with CI/CD, and generate artifacts in Kubernetes. This would allow us to perform testing seamlessly and leverage the benefits of Kubernetes. So let's learn in this blog about acceptance testing with the Robot Framework and how to automate it with Testkube.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Acceptance Testing?
&lt;/h2&gt;

&lt;p&gt;Acceptance testing is a phase in software development where the software is tested to determine if it meets the requirements specified by the client or stakeholders. It's usually performed after system testing and before deployment. Acceptance tests are typically written from a user's perspective and aim to verify that the system behaves as expected in real-world scenarios.&lt;/p&gt;

&lt;p&gt;Acceptance testing also allows you to ensure software complies with legal and regulatory requirements. This reduces the risk of legal consequences or penalties due to non-compliance, especially in certain industries, such as healthcare or finance.&lt;/p&gt;

&lt;p&gt;Other testing practices, such as API, load, etc., contribute to different aspects of software quality, such as performance, reliability, and interoperability, and are usually done before acceptance testing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://robotframework.org/"&gt;The Robot Framework&lt;/a&gt; is an acceptance testing tool that is easy to write and manage due to its key-driven approach. Let us learn more about the Robot Framework to enable acceptance testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acceptance Test with Robot Framework
&lt;/h2&gt;

&lt;p&gt;Robot Framework is an open-source, keyword-driven test automation framework that supports Python, Java, and .NET and is widely used for acceptance testing, acceptance test-driven development (ATDD), and robotic process automation (RPA). It provides a highly readable, tabular syntax for writing test cases in a plain-text format, making it accessible to both technical and non-technical users.&lt;/p&gt;

&lt;p&gt;Robot Framework stands out for the following reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keyword-Driven Approach&lt;/strong&gt;: In Robot Framework, test cases are defined using keywords that represent the validation. These keywords are organized into test suites, which are further structured into test cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test Data and Variables&lt;/strong&gt;: Test cases in Robot Framework are written in a tabular format using plain-text files, typically in files with the &lt;code&gt;.robot&lt;/code&gt; extension. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built-in and Custom Keywords&lt;/strong&gt;: Robot Framework offers a set of built-in keywords for performing common actions such as clicking buttons, entering text, verifying text, etc. It also allows users to define their custom keywords.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Library Support&lt;/strong&gt;: Robot Framework supports integration with external libraries written in Python, Java, .NET, and other languages, allowing users to extend its functionality as needed. These libraries can provide additional keywords for interacting with specific technologies, such as web browsers, APIs, databases, and more.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Test cases written in Robot Framework can be executed using the &lt;code&gt;robot&lt;/code&gt; command-line tool or through various integrated development environments (IDEs) and continuous integration (CI) systems. During execution, Robot Framework generates detailed reports and logs, highlighting the status of each test case and providing insights into test results and any encountered issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Acceptance tests in Kubernetes
&lt;/h2&gt;

&lt;p&gt;While running Robot Framework tests against legacy/non-containerized applications is usually straight-forward, there are several challenges associated with running these tests against a containerized application infrastructure built on Kubernetes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resource Management&lt;/strong&gt;: Kubernetes manages containerized applications, including their resource allocation and scaling. However, scaling requires ensuring optimal resource utilization for Robot Framework test execution. This would be challenging to deal with, especially in case of varying test workloads and resource requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test Isolation&lt;/strong&gt;: Ensuring proper isolation for individual test executions can be complex while running multiple tests concurrently. It will require careful consideration to avoid resource conflict and interference between tests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Persistent Data Handling&lt;/strong&gt;: Robot Framework may require access to persistent data, such as test artifacts, test data files, or external dependencies. Managing persistent data in a Kubernetes environment, including storage provisioning, volume mounting, and data synchronization, can be challenging, especially when dealing with distributed test executions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Secure Access&lt;/strong&gt;: Access to applications or components running in Kubernetes can be severely constrained for security reasons, making it difficult to run tests against them with tools that are not running in the cluster themselves. Relaxing network policies for the sake of testing is not always an option.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thus, when using the Robot Framework for acceptance testing of your containerized applications, you will require a test-execution framework that eases the life of a developer and can orchestrate Robot Framework tests with all the above caveats in mind. Fortunately,there is such a framework specifically targeted at running any kind of testing tool, including the Robot Framework, in a containerized application infrastructure: Testkube.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acceptance Testing with Testkube
&lt;/h2&gt;

&lt;p&gt;Testkube is a test orchestration platform that supports the execution of any testing tool in a containerized application infrastructure. It leverages Kubernetes to provide a scalable and consistent execution environment for all your tests, and includes a unified dashboard for test definition, reporting, and troubleshooting.&lt;/p&gt;

&lt;p&gt;To run tests in Testkube, one defines Test Workflows for managing the execution lifecycle of individual test(s), which will then be executed in your Kubernetes environment using the corresponding testing tool image. Let us understand more about the Test Workflows feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Workflows
&lt;/h3&gt;

&lt;p&gt;Test Workflows provide a declarative approach for defining test execution lifecycles. It leverages Kubernetes-native capabilities to orchestrate and execute tests, collect real-time artifacts, and display them on the Testkube dashboard. A Test Workflow is defined as a single YAML configuration that is stored as a custom resource in your Kubernetes cluster(s), &lt;a href="https://testkube.io/learn/getting-started-with-test-workflows-for-kubernetes-testing"&gt;Test Workflows&lt;/a&gt; allow integration with existing testing tools and GitOps pipelines, and also provide &lt;a href="https://docs.testkube.io/articles/test-workflow-templates/"&gt;templates&lt;/a&gt; for standardized testing configurations adaptable to various needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Execute Acceptance Testing in Testkube
&lt;/h3&gt;

&lt;p&gt;To run a Robot Framework acceptance test with Testkube, you will need to define a corresponding TestWorkflow that uses a prepackaged Robot container image to run the test cases that you have defined - let's have a look at how that works.  &lt;/p&gt;

&lt;p&gt;We will see two demos here using the Robot Framework in Testkube using the sample example, &lt;a href="https://docs.robotframework.org/docs/examples/restfulbooker"&gt;Restful Booker&lt;/a&gt;, provided by Robot Framework.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Basic&lt;/strong&gt;: In the basic execution we will run the sample test case by Restful Booker. In this test case, we will get bookings for a user, create a booking for a user, and verify that the application performs the required action. All these user details are hardcoded in the test case. We will execute the test in the Testkube dashboard and collect artifacts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Advanced&lt;/strong&gt;: We will update the above test case to use variables instead of hard coding user details and make use of parameters to provide values. This will give us the flexibility to test different scenarios. In Testkube we will make use of parameters to process these parameterized inputs.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So let us see Testkube in action performing an acceptance test using Robot Framework. Before we get started, let us verify the following prerequisites.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisites
&lt;/h3&gt;

&lt;p&gt;To follow along, you will need to set up the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Testkube Pro account (free plan is fine)&lt;/li&gt;
&lt;li&gt;A Kubernetes cluster - we're using a local Minikube cluster (&lt;a href="https://minikube.sigs.k8s.io"&gt;https://minikube.sigs.k8s.io&lt;/a&gt;)
&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://docs.testkube.io/testkube-cloud/articles/installing-agent"&gt;Testkube Agent&lt;/a&gt; is configured on the cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the prerequisites are in place, you should have a target Kubernetes cluster ready with a Testkube agent configured.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Execution
&lt;/h3&gt;

&lt;p&gt;In the basic execution, we will run the &lt;a href="https://docs.robotframework.org/docs/examples/restfulbooker"&gt;example&lt;/a&gt; Restful Booker test code in Testkube using Test Workflows. We have pushed the test case to a &lt;a href="https://github.com/cerebro1/robot-framework-test/tree/main"&gt;GitHub repository&lt;/a&gt;. These files will by default be mounted by Testkube to the '/data/repo' directory when the test executes. Let us get started.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Select Test Workflows from the menu and click on the 'Add a new test workflow' button to start setting up the workflow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the options to 'Create a Test Workflow', select 'Create from scratch'.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe3ofu4uex7qh5ehq9ltj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe3ofu4uex7qh5ehq9ltj.png" width="512" height="212"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter the following details to create a new workflow.&lt;br&gt;
a. &lt;strong&gt;Name&lt;/strong&gt;: Set the name of the workflow as 'basic-acceptance-test'&lt;br&gt;
b. &lt;strong&gt;Type&lt;/strong&gt;: Select the type of test as 'Other'&lt;br&gt;
c. &lt;strong&gt;Image&lt;/strong&gt;: Enter the name of the &lt;a href="https://docs.robotframework.org/docs/using_rf_in_ci_systems/docker#popular-docker-images-for-robot-framework"&gt;Docker Container Image for Robot Framework&lt;/a&gt;. We are using 'ppodgorsek/robot-framework'&lt;br&gt;
d. &lt;strong&gt;Tag&lt;/strong&gt;: Search for the stable tag on &lt;a href="https://hub.docker.com/r/ppodgorsek/robot-framework/tags"&gt;Docker Hub&lt;/a&gt; for the image and enter it here. We have been using &lt;a href="https://hub.docker.com/layers/ppodgorsek/robot-framework/7.1.0/images/sha256-064a9ac5e4223456e1e18133cca593359677db6afa2fd6d846a653b4733b31d7?context=explore"&gt;7.1.0&lt;/a&gt; since it was recently released.&lt;br&gt;
e. &lt;strong&gt;Shell command&lt;/strong&gt;: By default, the repository that has the &lt;a href="https://github.com/cerebro1/robot-framework-test/blob/main/test-restful.robot"&gt;test case&lt;/a&gt; is mounted to the &lt;code&gt;/data/repo&lt;/code&gt; directory. We will use the &lt;code&gt;robot&lt;/code&gt; command line tool to execute the test, and using the –outputdir option, we will save the output to a specific location. Here is the shell command: 'robot --outputdir /data/repo/output /data/repo/test-restful.robot'.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmlbhzfttilnafh4um4z3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmlbhzfttilnafh4um4z3.png" alt="Image description" width="441" height="512"&gt;&lt;/a&gt;Create a test workflow with your custom details.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the Source as Git from the drop-down menu and enter the repository details.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the final step, the UI will create the YAML for our Test Workflow. Let us go ahead and add the path where the artifacts will be stored in &lt;code&gt;spec.steps&lt;/code&gt;. Here is what the final configuration looks like.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TestWorkflow&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testworkflows.testkube.io/v1&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
 &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;basic-acceptance-test&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
 &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
   &lt;span class="na"&gt;git&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
     &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/cerebro1/robot-framework-test.git&lt;/span&gt;
 &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
   &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ppodgorsek/robot-framework:7.1.0&lt;/span&gt;
 &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
   &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run test&lt;/span&gt;
     &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;robot --outputdir /data/repo/output /data/repo/test-restful.robot&lt;/span&gt;
 &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
   &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
     &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/data/repo/output/*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click on Create and your 'basic-acceptance-test' workflow is ready:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmyuvgd6zwnwnncv4c0a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmyuvgd6zwnwnncv4c0a.png" alt="Image description" width="512" height="251"&gt;&lt;/a&gt;Test Workflow created in Testkube&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on 'Run this Test Workflow now' to execute the workflow. Once the Test Workflow executes successfully, you will see the Test Workflow in the 'Recent executions' list.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ntae538aqlvtksk3alp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ntae538aqlvtksk3alp.png" alt="Image description" width="512" height="153"&gt;&lt;/a&gt;Test Workflow execution is complete and successful.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the Test Workflow to view the details. You can see each step has been executed successfully in the following image. This is helpful for debugging in case something goes wrong or you need more insights. Test Workflow has a separate section for Log Output, Artifacts, and Workflow.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9ebf03znu7wtsh1anr1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9ebf03znu7wtsh1anr1.png" alt="Image description" width="512" height="227"&gt;&lt;/a&gt;Test Workflow Log Output shows each step execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on 'Run shell command' to view the details of the test cases executed. The execution shows that all the tests have passed successfully.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxlj77ec4nn7yiuzyrif.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxlj77ec4nn7yiuzyrif.png" alt="Image description" width="512" height="273"&gt;&lt;/a&gt;Robot Framework test cases executed in Test Workflow&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the Artifacts tab to view the artifacts processed. You can download the artifacts generated by the Robot Framework here.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspx3u0hv31yms18gf63g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspx3u0hv31yms18gf63g.png" alt="Image description" width="512" height="205"&gt;&lt;/a&gt;Test Workflow successfully processes the artifacts.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thus, with the help of Test Workflow, we were able to run a Robot Framework test seamlessly without any setup required on the local machine. The output shows all the tests have passed. Testkube has processed the artifacts and provided them for download.&lt;/p&gt;

&lt;p&gt;Now, let us suppose, this Robot Framework test has some parameterized values to be passed with the test. Don't worry! Testkube has got you covered. In the Test Workflows, you can pass the parameters and provide custom values. Let us understand this in detail in the coming section.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advanced Execution with Parameters
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Variables in Robot Framework
&lt;/h4&gt;

&lt;p&gt;In Robot Framework, you can define the parameters as variables, and the values can be passed at the time of execution. The default values to these parameters can be set in the Robot Framework test configuration as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*** Variables ***
${my_var} my_default_value

*** Test Cases ***
Test Case 1
    Log ${my_var}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While using the &lt;code&gt;robot&lt;/code&gt; command line utility, these variables can be passed as parameters as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ robot --variable my_var:my_value test.robot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Robot Framework Variables in Test Workflows
&lt;/h4&gt;

&lt;p&gt;Test Workflows allows you to define configuration parameters for your workflows, which can be passed to the Robot Framework as input. Let's add parameters for the &lt;code&gt;firstname&lt;/code&gt;, &lt;code&gt;lastname&lt;/code&gt; and &lt;code&gt;totalprice&lt;/code&gt; parameters to our workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TestWorkflow&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testworkflows.testkube.io/v1&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;basic-acceptance-test&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testkube&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;firstname&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
      &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Jim&lt;/span&gt;
    &lt;span class="na"&gt;lastname&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;  
      &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Henderson&lt;/span&gt;
    &lt;span class="na"&gt;totalprice&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
      &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;100"&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;git&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
      &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/cerebro1/robot-framework-test.git&lt;/span&gt;
  &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ppodgorsek/robot-framework:7.1.0&lt;/span&gt;
  &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run test&lt;/span&gt;
      &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;robot --variable firstname:{{ config.firstname }} --variable lastname:{{config.lastname }} --variable totalprice:{{ config.totalprice }} --outputdir /data/repo/output-{{config.firstname}}-{{config.lastname}} /data/repo/advanced-test-restful.robot&lt;/span&gt;    
  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/data/repo/output-{{config.firstname}}-{{config.lastname}}/*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see we have defined three config variables which we then pass to the robot command, and use in the naming of the output folder. When we new try to run this test we are first prompted to provide values for our variables:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk03kl7devgf59smaj1g7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk03kl7devgf59smaj1g7.png" alt="Image description" width="512" height="346"&gt;&lt;/a&gt;Just pressing the run button uses the default values provided as you can see in the log output:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7j2rnzrk0ah1awbg86m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7j2rnzrk0ah1awbg86m.png" alt="Image description" width="512" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Testkube with CI/CD
&lt;/h2&gt;

&lt;p&gt;Although it is useful to run tests directly from the Testkube Dashboard as shown above, you will most likely want to start these tests from your existing CI/CD pipelines. Fortunately, Testkube makes this really easy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the CI/CD Integration tab for your Test Workflow (see below)&lt;/li&gt;
&lt;li&gt;Select the CI/CD tool you are using from the menu to the left - a corresponding example will be shown to the right that you can copy/paste directly into your tool
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyjl03egwievl81wzx8k.png" alt="Image description" width="512" height="322"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Using Test Workflows, we were able to easily configure the execution of our Robot Framework test, and also pass custom variables to Robot Framework in a seamless way, and automate the execution of our tests from our CI/CD system. The configuration is easy to understand and manage, which not only reduces the efforts of developers but also increases the maintainability of the configuration.&lt;/p&gt;

&lt;p&gt;For a scalable approach to test execution in a Kubernetes environment, Testkube is the solution. It takes any testing tool, provides a template, or allows you to start from scratch and automate your tests. Teams can manage the entire test life cycle in an optimized way from a single dashboard. This not only empowers them with the feasibility of scaling but also standardizes the testing process.&lt;/p&gt;

&lt;p&gt;In this tutorial, we have seen how acceptance testing with Robot Framework could be done using Test Workflows in Testkube. Similarly, teams can create multiple test workflows to manage unit, load, API, acceptance, etc., tests from the same platform. &lt;/p&gt;

&lt;p&gt;We invite you to try Test Workflows. Visit &lt;a href="https://testkube.io/"&gt;Testkube website&lt;/a&gt; to get started. If you find yourself struggling with anything, feel free to drop a note in our active &lt;a href="https://join.slack.com/t/testkubeworkspace/shared_invite/zt-2arhz5vmu-U2r3WZ69iPya5Fw0hMhRDg"&gt;Slack community&lt;/a&gt;, and someone will help you out.&lt;/p&gt;

</description>
      <category>acceptancetesting</category>
      <category>robotframework</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Stop Using Docker in Docker for Testing</title>
      <dc:creator>michael20003</dc:creator>
      <pubDate>Mon, 03 Jun 2024 13:17:53 +0000</pubDate>
      <link>https://forem.com/kubeshop/stop-using-docker-in-docker-for-testing-kmc</link>
      <guid>https://forem.com/kubeshop/stop-using-docker-in-docker-for-testing-kmc</guid>
      <description>&lt;h3&gt;
  
  
  Embrace Kubernetes to Improve Performance, Scalability, and Ease of Configuration for your Tests
&lt;/h3&gt;

&lt;p&gt;Testing applications is becoming increasingly difficult as they grow in size and complexity. For someone responsible for testing an application of that scale, simply running tests within individual containers doesn't help much. Hence, there is a need for a scalable and flexible approach that allows for more efficient and effective testing to catch those pesky bugs.&lt;/p&gt;

&lt;p&gt;One technique that gained popularity for testing distributed applications was using Docker-in-Docker or DinD. The idea was to run a Docker daemon inside a Docker container itself and then use that inner Docker environment to orchestrate the full application stack on a single machine.&lt;/p&gt;

&lt;p&gt;Initially, it provided a seemingly straightforward way to create realistic multi-container environments for integration testing. However, as the applications grew, teams realized their substantial drawbacks and limitations, from resource constraints and overheads to inconsistencies.&lt;/p&gt;

&lt;p&gt;If you're responsible for testing in your organization, you can relate to the above scenario very well. Testing in Docker in Docker comes with its issues, and for large applications, it can become a nightmare. In this blog post, we'll look at the challenges with Docker in Docker approach and why you should embrace Kubernetes for Testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker in Docker 101 (DinD)
&lt;/h2&gt;

&lt;p&gt;But before we further delve into this blog post, a short primer on Docker in Docker (DinD) is necessary. As the name suggests, it's running a docker container inside a docker container. The approach &lt;a href="https://www.docker.com/blog/docker-can-now-run-within-docker/"&gt;first surfaced in late 2013&lt;/a&gt;, and it soon gained popularity.&lt;/p&gt;

&lt;p&gt;One common use case of DinD is continuous integration (CI) pipelines. The CI system could start up a DinD container as part of the build process. This inner Docker is then used to pull application images, start their containers, and run tests within that isolated environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foia113q8tedl37lafj5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foia113q8tedl37lafj5i.png" alt="Image description" width="512" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While DinD can be convenient for certain workflows as mentioned above, it introduces a range of complexities and limitations. Let us discuss them in the following section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problems with Running Docker In Docker
&lt;/h2&gt;

&lt;p&gt;Docker-in-Docker seemed like a convenient solution for testing distributed applications initially, but the reality is that this approach has significant drawbacks that become more evident as your applications grow in complexity. From a testing standpoint, DinD introduces several challenges that can undermine the very goals you're trying to achieve.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inefficient Performance
&lt;/h3&gt;

&lt;p&gt;One of the major drawbacks of the DinD approach is its sub-optimal or inefficient performance, especially at scale. The DinD testing approach hogs your resources if not managed correctly. Because each docker daemon reserves a set of resources, including CPU, RAM, networking, etc, on a system with limited resources, this overhead can quickly lead to performance bottlenecks and instability while testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inability to Mirror Production Setup
&lt;/h3&gt;

&lt;p&gt;Testing an application in a production-like environment is vital. However, the DinD environment fails to accurately mimic your actual production setup. The nested container environment may exhibit different behavior due to different storage, networking, and security configurations that may not be similar to your production environment. For instance, your production containers may run on a different Docker runtime (containerd, crio etc) compared to what DinD provides by default.&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Security Concerns
&lt;/h3&gt;

&lt;p&gt;When you have applications dealing with sensitive data, you need to be extremely cautious when testing with the DinD approach, as it can open up new vulnerabilities and security risks if not configured properly. By default, the Docker daemon runs with root privileges, if not configured correctly, it could expose your application data or increase security loopholes. Furthermore, concerning multi-cluster/tenant setup, there are security concerns of isolation between the different nested Docker instances, potentially allowing cross-tenant data leaks and vulnerabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Scalability Concerns
&lt;/h3&gt;

&lt;p&gt;With DinD, you end up with limited resources available on a single host machine. Even if multiple DinD instances are utilized, efficiently utilizing resources and automating scaling becomes a difficult process without an orchestrator. The lack of out-of-the-box scaling options severely limits the ability to conduct rigorous integration, load, and performance tests. Teams struggle to accurately model real-world scale, resiliency scenarios, and sophisticated deployment requirements.&lt;/p&gt;

&lt;p&gt;From performance overheads to security and scaling concerns, the technical debt of using DinD stacks up rapidly, and continued usage of this approach may lead to maintenance overhead. However, the major concern is that DinD severely restricts your ability to conduct comprehensive integration, load, and other performance tests on a large scale.&lt;/p&gt;

&lt;p&gt;Even the creator of DinD asks you to &lt;a href="https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/"&gt;think twice before using DinD for your CI or testing environment.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Embrace Kubernetes For Testing?
&lt;/h2&gt;

&lt;p&gt;As testing needs evolve, the Docker in Docker testing approach fails to provide the scalability, flexibility, and resilience that modern distributed systems demand. This realization led us to explore Kubernetes as a more robust solution for modeling and testing our cloud-native applications. Let us look at how embracing Kubernetes for Testing overcomes the issues with DinD.&lt;/p&gt;

&lt;h3&gt;
  
  
  Built-in Scalability
&lt;/h3&gt;

&lt;p&gt;Kubernetes comes with built-in orchestration capabilities that enable on-demand scaling, which is impossible with the DinD approach. It provides mechanisms like horizontal pod autoscaling, cluster autoscaling, and the ability to automatically schedule containers across a pool of nodes. This allows you to model realistic load scenarios by scaling application components using simple commands or auto-scaling rules based on CPU/memory consumption.&lt;/p&gt;

&lt;h3&gt;
  
  
  Consistent Production-Mirrored Environments
&lt;/h3&gt;

&lt;p&gt;The core goal of any testing process is to ensure testing takes place in an environment that closely resembles the production environment. Today, Kubernetes is dubbed the OS of the cloud and has become a standard for deploying and managing applications on the cloud. This allows your test clusters to accurately mirror your production environment, leading to effective testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simplified and Efficient
&lt;/h3&gt;

&lt;p&gt;Kubernetes is known to be a complex tool to master and involves a steep learning curve at the start. However, as you progress through the Kubernetes journey, things become simpler. The rise of cloud-native CI/CD solutions built specifically for Kubernetes has further contributed to standardizing testing workflows. Instead of building custom pipelines, teams can leverage pre-built integrations for spinning up test clusters, running test suites within live environments, collecting telemetry data, and more.&lt;/p&gt;

&lt;p&gt;These were just a few reasons why we should embrace Kubernetes for testing. It brings in a lot of advantages that make your testing processes more efficient. However, one of the challenges when it comes to testing in Kubernetes is the lack of Kubernetes native testing tools and frameworks, which limits your ability to take full advantage of Kubernetes. This is where Testkube comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run Your Tests in Kubernetes With Testkube
&lt;/h2&gt;

&lt;p&gt;Being the only Kubernetes native test execution and orchestration framework, Testkube takes your testing efforts to the next level. It helps you to build and optimize your test workflows for Kubernetes. It has a suite of advantages, some of which are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You can plug in any testing tool to Testkube, make it Kubernetes-native and take full advantage of Kubernetes. Check the complete list of &lt;a href="https://testkube.io/integrations"&gt;Testkube integrations&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With Testkube you can easily create and manage complex test scenarios across multiple environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Testkube &lt;a href="https://testkube.io/learn#ci-cd"&gt;integrates with a suite of CI/CD tools &lt;/a&gt;to enhance your DevOps pipelines by enabling complete end-to-end testing of your applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Moving your testing framework from DinD to Kubernetes might seem intimidating, but with Testkube, it's a breeze. As mentioned earlier, Testkube offers a &lt;a href="https://testkube.io/pricing#features"&gt;suite of features&lt;/a&gt; along with tools and integrations that streamline test deployment, execution and monitoring within Kubernetes ensuring your tests are as close to the production environment as possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Testkube Test Workflows
&lt;/h3&gt;

&lt;p&gt;Testkube allows you to create end-to-end test workflows using your favorite testing tool. It also streamlines your testing process by decoupling test execution from your CI pipeline. This democratizes the testing process, allowing teams to execute tests on-demand without disrupting the CI workflow. By separating test execution from the CI pipeline, Testkube offers greater flexibility and control over the testing process.&lt;/p&gt;

&lt;p&gt;In this section, we'll examine how to create a test workflow using Testkube. We'll create one for Postman, but you can configure a workflow for virtually any testing tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating A Test Workflow Using Postman
&lt;/h3&gt;

&lt;p&gt;In order to create a test workflow, you need to have a cluster running along with the Testkube agent. When you have this running, you can log in to the Testkube dashboard, click on Test Workflows and "Add A New Test Workflow" and choose "Start From An Example"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyzqde75d74shwkg2vl6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyzqde75d74shwkg2vl6f.png" alt="Image description" width="512" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, a k6 test spec is provided. We'll be using Postman instead. To do so, click on the "Discover more examples" link, which will take you to the &lt;a href="https://docs.testkube.io/articles/test-workflows/#example---test-workflow-for-postman"&gt;Test Workflows document&lt;/a&gt;. Scroll down to the Postman section and copy the code present there. You can also use the one shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;testworkflows.testkube.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TestWorkflow&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postman-workflow-example&lt;/span&gt; &lt;span class="c1"&gt;# name of the Test Workflow&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;git&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# checking out from git repository&lt;/span&gt;
      &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/kubeshop/testkube&lt;/span&gt;
      &lt;span class="na"&gt;revision&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
      &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;test/postman/executor-tests/postman-executor-smoke-without-envs.postman_collection.json&lt;/span&gt;
  &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# container settings&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# resource settings (optional)&lt;/span&gt;
      &lt;span class="na"&gt;requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# resource requests&lt;/span&gt;
        &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;256m&lt;/span&gt;
        &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;128Mi&lt;/span&gt;
    &lt;span class="na"&gt;workingDir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/data/repo/test/postman/executor-tests&lt;/span&gt; &lt;span class="c1"&gt;# default workingDir&lt;/span&gt;
  &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# steps that will be executed by this Test Workflow&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run test&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postman/newman:6-alpine&lt;/span&gt; &lt;span class="c1"&gt;# image used while running specific step&lt;/span&gt;
        &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# args passed to the container&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;run&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;postman-executor-smoke-without-envs.postman_collection.json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste this in the spec section and click Create. This will create the test workflow and take you to the workflow page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekkc9ntp5ku92axmepx4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekkc9ntp5ku92axmepx4.png" alt="Image description" width="512" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing a Test Workflow
&lt;/h3&gt;

&lt;p&gt;Click on "Run Now" to start the workflow execution. Clicking on the respective execution will show you the logs, artifacts, and the underlying workflow file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuoa5muli5kdhtjo7epb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuoa5muli5kdhtjo7epb.png" alt="Image description" width="512" height="331"&gt;&lt;/a&gt;&lt;br&gt;
Testkube Workflows preserve the logs and artifacts generated from the tests, thus providing better observability. Creating a test workflow is fairly straightforward, as shown above, and you can bring your testing tool and create a workflow for it with a few clicks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The move from Docker in Docker to Kubernetes for testing is the need of the hour, especially considering the scale and complexity of our applications. By leveraging Kubernetes for testing, we take advantage of its inherent capabilities of scaling, security and efficiency to name a few. And with tools like Testkube, organizations can achieve more reliable, efficient, and cost-effective testing processes. If you are ready to elevate your testing strategy with Kubernetes and &lt;a href="http://testkube.io"&gt;Testkube &lt;/a&gt;feel free to visit our &lt;a href="http://testkube.io"&gt;website&lt;/a&gt; to learn more about Testkube's capabilities and how it can transform your testing workflow.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>docker</category>
      <category>testkube</category>
    </item>
    <item>
      <title>Integrating Testkube With Azure Pipelines For Continuous Testing</title>
      <dc:creator>michael20003</dc:creator>
      <pubDate>Tue, 14 May 2024 16:53:47 +0000</pubDate>
      <link>https://forem.com/kubeshop/integrating-testkube-with-azure-pipelines-for-continuous-testing-2578</link>
      <guid>https://forem.com/kubeshop/integrating-testkube-with-azure-pipelines-for-continuous-testing-2578</guid>
      <description>&lt;p&gt;In the fast-paced world of software development, agility is key. Teams strive to expedite feature releases, yet the critical process of testing often lags behind. To truly achieve agility and ensure reliability, automated testing must be woven throughout the development lifecycle.&lt;/p&gt;

&lt;p&gt;Enter the concept of Continuous Testing, or TestOps, which embodies the integration of testing into DevOps practices. This isn't just about triggering tests upon code commits or automating report generation; it's about embedding a robust testing framework within your CI/CD ecosystem.&lt;/p&gt;

&lt;p&gt;Testkube emerges as a solution specifically designed to facilitate testing in Kubernetes environments and to dovetail with CI/CD workflows effortlessly. This blog post will explore the synergy between Testkube and Azure Pipelines, illustrating how this integration enhances continuous testing practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leveraging Testkube with Azure Pipelines for Enhanced TestOps
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://azure.microsoft.com/en-in/products/devops/pipelines"&gt;Azure Pipelines&lt;/a&gt;, a pivotal component of Microsoft Azure's DevOps services, offers seamless integration with leading version control systems like GitHub and GitLab. It utilizes an &lt;code&gt;azure-pipelines.yaml&lt;/code&gt; file to manage pipeline triggers and job configurations, enabling automated builds and deployments with ease.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://testkube.io"&gt;Testkube&lt;/a&gt;, on the other hand, is a versatile testing framework designed to harmonize with various CI/CD tools, bringing your preferred testing mechanisms into the Kubernetes ecosystem. By treating tests as Kubernetes resources through Custom Resource Definitions (CRDs), Testkube revolutionizes test management by allowing tests to be handled as code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrating Testkube with Azure Pipelines unlocks significant advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhanced TestOps:&lt;/strong&gt; This integration erases the traditional boundaries between testing and development, fostering a culture of continuous testing. It ensures product reliability by facilitating testing at every stage of the development process, accommodating rapid scaling and deployment speeds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Seamless Continuous Testing:&lt;/strong&gt; With Testkube and Azure Pipelines, testing becomes a continuous process that automatically triggers with every code commit. This ensures comprehensive testing with each change, embedding quality directly into the CI/CD pipeline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In-depth Insights:&lt;/strong&gt; Testkube excels in capturing and analyzing data from your executed tests. It leverages this information to generate detailed insights and dashboards, offering a clear view of test performance and trends over time.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This integration not only streamlines workflows but also empowers teams to maintain high-quality standards, ensuring agile, reliable product development with Testkube and Azure Pipelines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Azure Pipelines With TestKube
&lt;/h2&gt;

&lt;p&gt;Integrating Testkube with Azure Pipelines follows a process similar to what we did for GitLab and CircleCI in the previous posts. In this case, we'll configure Azure Pipelines with the GitHub Repo used in an earlier blog post.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a DevOps organization in Azure and then create a new project to get started.&lt;/li&gt;
&lt;li&gt;On the first run, it will ask you to configure your code repo with Azure Pipeline.&lt;/li&gt;
&lt;li&gt;Create an &lt;code&gt;azure-pipelines.yml&lt;/code&gt; in the root of your GitHub repository.&lt;/li&gt;
&lt;li&gt;The pipeline will create and execute a k6 test on a cluster with Testkube configured.&lt;/li&gt;
&lt;li&gt;Lastly, we'll configure a branch protection rule that will not allow a change to be merged if the test fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At a high level, this is what we are going to do. The code for this blog post is available in this &lt;a href="https://github.com/techmaharaj/testkube-GH"&gt;GitHub repo&lt;/a&gt;. It has a folder named k6, which has the test, and an &lt;code&gt;azure-pipelines.yaml&lt;/code&gt; file with the Azure Pipeline configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops"&gt;Azure DevOps organization&lt;/a&gt; &amp;amp; repository with &lt;a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&amp;amp;tabs=yaml"&gt;Azure Pipeline&lt;/a&gt; configured.&lt;/li&gt;
&lt;li&gt;Kubernetes cluster - we're using an AKS cluster.&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://docs.testkube.io/testkube-cloud/articles/installing-agent"&gt;Testkube Agent&lt;/a&gt; configured on the cluster.&lt;/li&gt;
&lt;li&gt;Testkube API token, Org ID, and Environment ID&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the prerequisites are in place, you should have a target Kubernetes cluster ready with a Testkube agent configured. You should also have a GitHub repository configured with Azure Pipelines integrated with Testkube.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Refer to our &lt;a href="https://docs.testkube.io/testkube-cloud/articles/organization-management/#api-tokens"&gt;API Token document&lt;/a&gt; to create the API token. To find the Org ID and environment IDs, log in to your Teskube Cloud dashboard, head to any existing tests page, navigate to CI/CD integration, and choose GitHub. Copy the environment and organization IDs from here.&lt;/p&gt;

&lt;p&gt;You'll also need to create &lt;a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&amp;amp;tabs=yaml%2Cbatch"&gt;variables in Azure Pipelines&lt;/a&gt; to store these IDs and the token.&lt;/p&gt;

&lt;h3&gt;
  
  
  K6 Test
&lt;/h3&gt;

&lt;p&gt;We will create a k6 test that performs a load test on the testkube.io website and checks if the response time is less than 1000 milliseconds. If the response is more than that, the test will fail.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;k6/http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;check&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sleep&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;k6&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;vus&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;            &lt;span class="c1"&gt;// Virtual Users&lt;/span&gt;
  &lt;span class="na"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;10s&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Duration of the test&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Send an HTTP GET request to the website&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://testkube.io&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   &lt;span class="c1"&gt;// Replace with your URL&lt;/span&gt;

  &lt;span class="c1"&gt;// Check if the response time is less than 1000 milliseconds&lt;/span&gt;
  &lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Response time is less than 1000 milliseconds&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;duration&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Check if response time is less than 1000 milliseconds&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="c1"&gt;// Add a sleep period (in this case, 1 second) between requests&lt;/span&gt;
  &lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configuring Azure Pipeline
&lt;/h3&gt;

&lt;p&gt;We configure the Azure Pipeline to execute whenever a new pull request is made. The job uses the Testkube API key, ORG_ID, and ENV_ID, saved as Azure Pipeline variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;trigger&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;

&lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;vmImage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ubuntu-latest'&lt;/span&gt;

&lt;span class="na"&gt;stages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Test&lt;/span&gt;
    &lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;job&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;RunTestkube&lt;/span&gt;
        &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SetupTestkube@1&lt;/span&gt;
            &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;organization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(TK_ORG_ID)'&lt;/span&gt;
              &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(TK_ENV_ID)'&lt;/span&gt;
              &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;$(TK_API_TOKEN)'&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
              &lt;span class="s"&gt;git clone https://github.com/techmaharaj/testkube-GH.git&lt;/span&gt;
              &lt;span class="s"&gt;cd testkube-GH/k6&lt;/span&gt;
              &lt;span class="s"&gt;testkube create test --name k6-test --type k6/script --update -f testkube.js&lt;/span&gt;
              &lt;span class="s"&gt;testkube run test k6-test&lt;/span&gt;
            &lt;span class="na"&gt;displayName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Testkube Test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt; You can also use this sample workflow generated by Testkube to create and configure your Azure Pipeline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gn7std1j03qqon586w0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gn7std1j03qqon586w0.png" alt="Image description" width="512" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above workflow does the following things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configures a job to connect with Testkube cloud using the Testkube token, organization, and environment ID.&lt;/li&gt;
&lt;li&gt;Creates and executes the k6 test using &lt;code&gt;kubeshop/testkube-cli&lt;/code&gt; on the AKS cluster.&lt;/li&gt;
&lt;li&gt;Based on the result, the status will be updated in the pull request. If the test passes, the merge option will be enabled, and anyone can merge it. However, if the test fails, the merge will not be available - &lt;a href="https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule"&gt;we'll configure a branch protection rule&lt;/a&gt; to prevent the PR from being merged if the run fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Configuring GitHub Repo
&lt;/h3&gt;

&lt;p&gt;You first need to create an Azure DevOps organization. Once this is made, you'll be prompted to add your first project. In this case, we're using a GitHub project. So, we can choose GitHub and follow the prompts to connect your GitHub repository to Azure DevOps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9kdotwpkrsa8mfe44h3r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9kdotwpkrsa8mfe44h3r.png" alt="Image description" width="512" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successfully creating the project, you need to make your pipeline. Azure will provide you with a default pipeline code that you can commit to your repo. However, since we already have our configuration, we will use that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vmhtyund7evyxua31dg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vmhtyund7evyxua31dg.png" alt="Image description" width="512" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point, our Azure Pipeline is configured to be triggered on every new PR on the main branch of the GitHub repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trigger Testkube Test
&lt;/h3&gt;

&lt;p&gt;To check if everything works correctly, raise a new pull request in the repository with some changes. You'll see that your action is triggered almost immediately.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4koogpixq0he1jiptz6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4koogpixq0he1jiptz6d.png" alt="Image description" width="512" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You see two jobs here, that is because we already have a GitHub action enabled in this repository from our previous blog post.&lt;/p&gt;

&lt;p&gt;At the same time, you can also see the execution on Azure Pipeline. In the background, our test will run on the target Kubernetes cluster specified.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9ajnb82211hwmpy7btq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9ajnb82211hwmpy7btq.png" alt="Image description" width="512" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0iq50zp6yo7vjt7f4336.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0iq50zp6yo7vjt7f4336.png" alt="Image description" width="512" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the test passes, our pipeline will update the status in the PR, and a user can merge the PR.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhg1bva0446jxgtkqut8h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhg1bva0446jxgtkqut8h.png" alt="Image description" width="512" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, if the workflow fails, the CI job will update the workflow status as failed in the PR. Merging will be blocked because of the branch protection rule that we have created, which prevents merging if the test fails.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Revolutionizing Testing with Testkube and Azure Pipelines
&lt;/h2&gt;

&lt;p&gt;In this blogpost, we learned about the pivotal role of continuous testing in modern software development, spotlighting how it significantly uplifts testing practices. We delved into the synergy between Testkube and Azure Pipelines, demonstrating a seamless integration that facilitates an efficient CI/CD workflow. By integrating a k6 test with Testkube and executing it through Azure Pipelines, we showcased a practical workflow that enhances testing efficiency and reliability.&lt;/p&gt;

&lt;p&gt;For a deeper dive and more comprehensive guidance on harnessing Testkube within your CI/CD ecosystem, our documentation offers extensive insights. Embrace TestOps by experimenting with &lt;a href="http://testkube.io"&gt;Testkube&lt;/a&gt; and witness firsthand the transformation it brings to your testing strategy.&lt;/p&gt;

&lt;p&gt;Should you have any queries, need guidance, or wish to share feedback, our &lt;a href="https://join.slack.com/t/testkubeworkspace/shared_invite/zt-2arhz5vmu-U2r3WZ69iPya5Fw0hMhRDg"&gt;Slack Community&lt;/a&gt; is a vibrant space for support and knowledge exchange. Embark on your journey towards more proactive, streamlined testing today.&lt;/p&gt;

&lt;p&gt;Happy testing!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>azure</category>
      <category>testing</category>
    </item>
    <item>
      <title>Critical Test Based Alerting with PagerDuty and Testkube</title>
      <dc:creator>michael20003</dc:creator>
      <pubDate>Thu, 09 May 2024 19:12:40 +0000</pubDate>
      <link>https://forem.com/kubeshop/critical-test-based-alerting-with-pagerduty-and-testkube-5dh7</link>
      <guid>https://forem.com/kubeshop/critical-test-based-alerting-with-pagerduty-and-testkube-5dh7</guid>
      <description>&lt;p&gt;In the realm of agile development, the focus often lands on accelerating feature deployment. However, the capability to swiftly respond to critical incidents is just as crucial. Especially in testing, where the failure of key tests could significantly impact a release, staying updated on test statuses with each build is vital.&lt;/p&gt;

&lt;p&gt;Modern applications and infrastructures require effective alerting and incident response systems to maintain high availability and operational awareness. PagerDuty stands out as a leading solution for incident management, providing teams with the tools needed to quickly address and resolve issues.&lt;/p&gt;

&lt;p&gt;This tutorial post explores how integrating PagerDuty with Testkube can enhance your team's response to critical test failures, ensuring your development cycle remains both fast and reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alerting Via Webhooks
&lt;/h2&gt;

&lt;p&gt;Throughout the evolution of technology, numerous methods have enabled systems to communicate seamlessly. From a variety of protocols to services, the goal has always been to facilitate the transfer of data across disparate systems efficiently.&lt;/p&gt;

&lt;p&gt;Webhooks stand out as a powerful mechanism for system interaction. They serve as digital informants, alerting services to specific events. Essentially, a webhook endpoint acts as a listener for one system, ready to receive data transmitted by another.&lt;/p&gt;

&lt;p&gt;In the context of Testkube, &lt;a href="https://docs.testkube.io/articles/webhooks/"&gt;Webhooks&lt;/a&gt; are instrumental. They empower you to inform other services about test-related activities effortlessly. For example, setting up a Slack webhook with Testkube allows for the automatic dissemination of event notifications, bridging the gap between test execution and team communication.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Components of a Webhook Trigger in Testkube:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Events:&lt;/strong&gt; These are the specific occurrences within Testkube you wish to monitor, such as "test-start" or "test-fail". Selecting relevant events allows for targeted notifications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source:&lt;/strong&gt; Indicates the origin of the event, whether it's an individual test or a collection of tests within a TestSuite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination:&lt;/strong&gt; The webhook endpoint or the digital address to which Testkube sends the notification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Implementing Webhooks&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instant Alerts:&lt;/strong&gt; Stay informed with real-time notifications about your tests' outcomes, enabling immediate action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Workflows:&lt;/strong&gt; Trigger specific actions based on test results, such as sending detailed emails after a failure, streamlining your response mechanism.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Integration:&lt;/strong&gt; Webhooks facilitate communication between Testkube and various tools or services like Slack for messaging or Grafana for monitoring, effortlessly fitting into your existing workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By utilizing webhooks within Testkube, you can significantly enhance test observability and automation, making your testing processes more efficient and integrated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Testkube With PagerDuty
&lt;/h2&gt;

&lt;p&gt;PagerDuty is an incident response management and alerting platform for DevOps teams managing critical operations. It provides real-time alerts and escalates incidents to the appropriate personnel. By automating the incident response workflow, PagerDuty ensures that incidents are addressed promptly and efficiently, reducing downtime and improving overall system reliability. &lt;/p&gt;

&lt;p&gt;Being the extensive tool that it is, there are a few components that we must be aware of for the purpose of this tutorial:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Services:&lt;/strong&gt; These are applications/services within an organization that are monitored. These are connected to monitoring tools that trigger alerts based on predefined rules and thresholds.&lt;/li&gt;
&lt;li&gt;**Integrations: **Integrations allow PagerDuty to seamlessly connect with other monitoring and collaboration tools. This allows it to collect data from multiple sources and manage them centrally. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incidents:&lt;/strong&gt; These are events that indicate something has gone wrong. When a monitoring tool detects an issue, it sends an alert to PagerDuty, which creates an incident that can be categorized and assigned to different personnel. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apart from these, PagerDuty has advanced mechanisms that allow teams to send emails, calls, SMS, and push notifications to notify designated personnel about the incident. You can read more about PagerDuty and its features &lt;a href="https://support.pagerduty.com/docs/introduction"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Creating a service &amp;amp; integration&lt;/p&gt;

&lt;p&gt;The first and foremost step is to create a service in PagerDuty. &lt;a href="https://support.pagerduty.com/docs/services-and-integrations"&gt;Creating a service in PagerDuty&lt;/a&gt; is fairly simple, and you can create one in a few minutes.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8fttiotp69mwvpis1q5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8fttiotp69mwvpis1q5.png" alt="Image description" width="512" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After your service is created, you need to create an integration. And integration basically allows PagerDuty to receive alerts from other services/tools. By default, PagerDuty provides support from multiple tools. However, in the case of Testkube, we’ll use their &lt;a href="https://support.pagerduty.com/docs/services-and-integrations"&gt;Events API V2&lt;/a&gt;, which will allow us to send custom events.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0cpzfj5j29lkje920uhd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0cpzfj5j29lkje920uhd.png" alt="Image description" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you select this, it will give you the configurations that you will use to create the webhook in Testkube. It will share details like integration key, integration URL for change and alert events along with an example to use the API. Note that PagerDuty requires the input to come in a specific format.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4dwvjqwsj56b24fmjmf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4dwvjqwsj56b24fmjmf.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this, we have configured PagerDuty to receive alerts from Teskube. Let us now go ahead and create a Webhook in Testkube.&lt;/p&gt;
&lt;h3&gt;
  
  
  Creating a Testkube Webhook
&lt;/h3&gt;

&lt;p&gt;Creating a webhook trigger in Testkube is straightforward. You can create Webhooks using the dashboard as well as the CLI. We’ll be using the dashboard to show you how it works.&lt;/p&gt;

&lt;p&gt;Using Dashboard&lt;/p&gt;

&lt;p&gt;We’ll set up a webhook for PagerDuty using the dashboard. This webhook will trigger on the &lt;code&gt;test-end-failure&lt;/code&gt; event and send the data to the PagerDuty webhook endpoint that we got in the previous step (Integration URL)&lt;/p&gt;

&lt;p&gt;Navigate to the webhooks section and “Create a new webhook.” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provide a name for your webhook.&lt;/li&gt;
&lt;li&gt;Choose the “Resource Identifier” as any test or executor on which you want the webhook to trigger. In this case, we will use a simple curl test. You can find the test in &lt;a href="https://docs.testkube.io/test-types/executor-curl/"&gt;this repo&lt;/a&gt; - &lt;em&gt;we’ve changed the HTTP code in the test so that it fails.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;For “Triggered events”, choose end-test-failed, which basically means it will trigger when the chosen Pytest fails.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7flr5r6f4k2ht3oght3y.png" alt="Image description" width="800" height="846"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd8o792j7o5tmacluxrw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd8o792j7o5tmacluxrw.png" alt="Image description" width="800" height="655"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Submit, and your webhook is ready. However, as mentioned earlier, PagerDuty requires input in a particular format as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl --request 'POST' \
--url 'https://events.pagerduty.com/v2/enqueue' \
--header 'Content-Type: application/json' \
--data '{
  "payload": {
    "summary": "Test alert",
    "severity": "critical",
    "source": "Alert source",
    “custom_details” {“key”:”value”}
  },
  "routing_key": "routingkey",
  "event_action": "trigger"
}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hence, we will add a custom payload. To do that, click on your Webhook and navigate to the Action section. Here, add the following snippet under the “Custom Payload” section&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
"payload": {
    "summary": "{{ .TestExecution.TestName }} - {{ .TestExecution.ExecutionResult.Status }}" ,
    "severity": "critical",
    "source": "Testkube",
    "custom_details" : {
        "testName": "{{ .TestExecution.TestName }}",
        "testType": "{{ .TestExecution.TestType }}",
        "testStatus": "{{ .TestExecution.ExecutionResult.Status }}",
        "testEndtime": "{{ .TestExecution.EndTime }}",
        "testDuration": "{{ .TestExecution.Duration }}",
        "url": "https://app.testkube.io/organization/{{ index .Envs "TESTKUBE_CLOUD_ORG_ID" }}/environment/{{ index .Envs "TESTKUBE_CLOUD_ENV_ID" }}/dashboard/tests/{{ .TestExecution.TestName }}/executions/{{ .TestExecution.Id }}"
    }
  },
  "routing_key": "routingkey",
  "event_action": "trigger"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above payload, we are sending the following details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test Name&lt;/li&gt;
&lt;li&gt;Test Type&lt;/li&gt;
&lt;li&gt;Test Status&lt;/li&gt;
&lt;li&gt;Test Endtime&lt;/li&gt;
&lt;li&gt;Test Duration&lt;/li&gt;
&lt;li&gt;URL to the specific test log&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click on save to save the configuration. &lt;/p&gt;

&lt;h3&gt;
  
  
  Testing the Webhook
&lt;/h3&gt;

&lt;p&gt;Now that we have configured the webhook for PagerDuty, it’s time to test it. To do that, simply run the curl test.&lt;br&gt;
You’ll see the webhook trigger when the test fails and send data to PagerDuty. Within PagerDuty, this will be shown as an incident based on the details we shared in the custom_payload.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54b1dcktzav0av9w4j2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54b1dcktzav0av9w4j2k.png" alt="Image description" width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, PagerDuty also sets up an email alert triggered when an incident is created.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbmcq11mndf6jrdjhka9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbmcq11mndf6jrdjhka9.png" alt="Image description" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that’s how you can configure the Testkube webhook to send alerts to PagerDuty. Based on your team’s specific needs, you can configure both Webhook and Testkube.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Elevate Your Incident Response with Testkube and PagerDuty Integration
&lt;/h2&gt;

&lt;p&gt;Harnessing the synergy between &lt;a href="https://testkube.io/"&gt;Testkube&lt;/a&gt; and &lt;a href="https://www.pagerduty.com/"&gt;PagerDuty&lt;/a&gt; through webhooks offers a formidable solution to bolster your incident management strategy. This integration not only simplifies tracking and addressing critical test failures but also fosters improved teamwork.&lt;/p&gt;

&lt;p&gt;By utilizing Testkube's automated testing capabilities alongside PagerDuty's robust incident management system, you equip your team with the necessary resources to uphold service excellence and enhance customer satisfaction.&lt;/p&gt;

&lt;p&gt;Discover the potential of &lt;a href="https://testkube.io/"&gt;Testkube&lt;/a&gt; and its versatile integrations. Embrace a system where proactive monitoring and seamless alerting transform your operational dynamics.&lt;/p&gt;

&lt;p&gt;Connect with our vibrant community on &lt;a href="https://join.slack.com/t/testkubeworkspace/shared_invite/zt-2arhz5vmu-U2r3WZ69iPya5Fw0hMhRDg"&gt;Slack&lt;/a&gt; for insights, support, and networking with like-minded developers. Embark on a journey to redefine your approach to quality assurance and incident response.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>testing</category>
      <category>devops</category>
    </item>
    <item>
      <title>Integrating Testkube and Zapier For Instant Email Alerts</title>
      <dc:creator>michael20003</dc:creator>
      <pubDate>Tue, 30 Apr 2024 18:11:27 +0000</pubDate>
      <link>https://forem.com/kubeshop/integrating-testkube-and-zapier-for-instant-email-alerts-1j66</link>
      <guid>https://forem.com/kubeshop/integrating-testkube-and-zapier-for-instant-email-alerts-1j66</guid>
      <description>&lt;p&gt;Gone are the days of simple, standalone apps. Today's applications are complex, distributed systems spanning multiple environments and sometimes even different geographies. Ensuring every component works seamlessly is more crucial than ever, highlighting the indispensable role of comprehensive testing.&lt;/p&gt;

&lt;p&gt;However, managing and monitoring the myriad of tests across various modules and environments poses a significant challenge. Enter Testkube, a tool not only for centralizing test metrics for enhanced observability but also for integrating these metrics into your existing systems for real-time insights.&lt;/p&gt;

&lt;p&gt;This tutorial will guide you through setting up a Zapier webhook in Testkube to funnel test data directly to Zapier, allowing you to automatically generate and send detailed email alerts via Gmail. Stay tuned for a streamlined approach to keeping tabs on your tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Webhooks in Testkube
&lt;/h2&gt;

&lt;p&gt;Think of a doorbell: it alerts you to someone's presence without needing to watch the door constantly. Webhooks serve a similar purpose in the digital realm, acting as notifications that prompt action or relay information between different applications when specific events occur.&lt;/p&gt;

&lt;p&gt;Testkube leverages &lt;a href="https://docs.testkube.io/articles/webhooks/"&gt;webhooks&lt;/a&gt; to inform you about test activities. Whether a test succeeds, fails, or triggers another significant event, Testkube can notify other systems in real-time, enhancing your testing workflow's responsiveness and integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Components of a Webhook Trigger in Testkube:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Events&lt;/strong&gt;: These are the specific occurrences within Testkube you wish to monitor, such as "test-start" or "test-fail". Selecting relevant events allows for targeted notifications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source&lt;/strong&gt;: Indicates the origin of the event, whether it's an individual test or a collection of tests within a TestSuite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination&lt;/strong&gt;: The webhook endpoint or the digital address to which Testkube sends the notification.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advantages of Implementing Webhooks
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instant Alerts&lt;/strong&gt;: Stay informed with real-time notifications about your tests' outcomes, enabling immediate action.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Workflows&lt;/strong&gt;: Trigger specific actions based on test results, such as sending detailed emails after a failure, streamlining your response mechanism.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Integration&lt;/strong&gt;: Webhooks facilitate communication between Testkube and various tools or services like Slack for messaging or Grafana for monitoring, effortlessly fitting into your existing workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By utilizing webhooks within Testkube, you can significantly enhance test observability and automation, making your testing processes more efficient and integrated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Testkube With Zapier
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://zapier.com/app/dashboard"&gt;Zapier&lt;/a&gt; is a tool that automates tasks in apps like Gmail and Slack, serving as a connector to streamline workflows without coding. At its core, Zapier uses "Zaps," automated workflows that link your apps and services. Each Zap has a "Trigger," an event in one app that starts the workflow, and an "Action," a subsequent automated task in another app.&lt;/p&gt;

&lt;p&gt;For instance, by setting up a Zapier webhook trigger with Testkube, you can automate an email alert for every failed test case, simplifying how you monitor and respond to testing outcomes. Let's delve into this application next.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Zap
&lt;/h3&gt;

&lt;p&gt;The first step is to create a Zap. We will create a Zap with a webhook as a trigger and Gmail as an action. This will give us a webhook endpoint that we will use to configure a webhook in Testkube. &lt;/p&gt;

&lt;p&gt;Creating a Zap is pretty straightforward, and Zapier gives you multiple options to create a Zap: using AI Zap builder, Pre-built Zap templates, and blank Zaps. In this case, we will create a blank Zap and configure a webhook.&lt;/p&gt;

&lt;p&gt;You can follow &lt;a href="https://help.zapier.com/hc/en-us/articles/8496309697421-Create-Zaps#h_01H91E3WYADMW3ZT5EB7XZRE9J"&gt;these steps to create a Zap&lt;/a&gt; and &lt;a href="https://help.zapier.com/hc/en-us/articles/8496288690317-Trigger-Zaps-from-webhooks#h_01HBGES5DW79VEMREX2Z7A0K48"&gt;configure a webhook to trigger a Zap&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqurm5rne9yvuwufqe72u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqurm5rne9yvuwufqe72u.png" alt="Image description" width="800" height="194"&gt;&lt;/a&gt;&lt;br&gt;
At this point, Zapier will give you a webhook URL, using which you'll create a webhook in Testkube.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Testkube Webhook
&lt;/h3&gt;

&lt;p&gt;Creating a webhook trigger in Testkube is easy. You can create Webhooks using the dashboard as well as the CLI. We'll be using the dashboard to show you how it works.&lt;/p&gt;

&lt;h4&gt;
  
  
  Using Dashboard
&lt;/h4&gt;

&lt;p&gt;We'll set up a webhook for Zapier using the dashboard. This webhook will trigger on the test-end-failure event and send the data to the Zapier webhook endpoint that we configured in the previous step.&lt;/p&gt;

&lt;p&gt;Navigate to the webhooks section and "Create a new webhook." &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provide a name for your webhook.&lt;/li&gt;
&lt;li&gt;Choose the "Resource Identifier" as any test or executor on which you want the webhook to trigger. In this case, we will use a simple curl test. You can find the test &lt;a href="https://docs.testkube.io/test-types/executor-curl/"&gt;in this repo&lt;/a&gt; - we've changed the HTTP code in the test so that it fails.&lt;/li&gt;
&lt;li&gt;For "Triggered events", choose end-test-failed, which basically means it will trigger when the chosen Pytest fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvawai3c4e7nxuprk50ez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvawai3c4e7nxuprk50ez.png" alt="Image description" width="800" height="850"&gt;&lt;/a&gt;&lt;br&gt;
On the next screen, provide the Zapier webhook endpoint URL you generated while setting up Zapier integration. Now, we have a successfully configured Zapier webhook. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79m2wvu3btgkdq81yztk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79m2wvu3btgkdq81yztk.png" alt="Image description" width="800" height="648"&gt;&lt;/a&gt;&lt;br&gt;
Now, when you execute the curl test and when it fails in the Zapier dashboard, you'll see the Testkube records. At this point, you've successfully configured Testkube Webhook to send data whenever the curl test fails.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzsv1kb4fdz3tdpx185n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzsv1kb4fdz3tdpx185n.png" alt="Image description" width="800" height="402"&gt;&lt;/a&gt;&lt;br&gt;
Click on "Continue with selected record button" to configure the action, in this case, Gmail.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring Gmail
&lt;/h3&gt;

&lt;p&gt;In the action field, choose Gmail and configure your Gmail account. It uses the familiar Google Sign-In, so you simply need to choose your account, provide Zapier the necessary permissions, and your Gmail account will be configured within a few seconds.&lt;/p&gt;

&lt;p&gt;Based on the test data that Zapier received, it allows us to insert variables In the various fields. Using those, we'll configure the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;To&lt;/strong&gt;: Email address of where the mail will be sent to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subject&lt;/strong&gt;: Provide the subject of the email. We'll provide "Test Name "&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Body&lt;/strong&gt;: Here, we include details like the Test name, Start Time, Duration, and Logs - a link to the test execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgtdl0mvo6owou4b81fb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgtdl0mvo6owou4b81fb.png" alt="Image description" width="800" height="358"&gt;&lt;/a&gt;&lt;br&gt;
With this setup, you should have a Zap like the one above. We have configured the email body with details like the test name, start time, duration, and logs, which is the URL for the test execution log.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing the Webhook
&lt;/h3&gt;

&lt;p&gt;Now that we have configured the webhook for Zapier, it's time to test it. To do that, simply run the curl test.&lt;/p&gt;

&lt;p&gt;When the test fails, you'll see your Zap trigger and the associated action being performed. In this case, it will trigger an email to Gmail. &lt;/p&gt;

&lt;p&gt;Based on our configuration, below is the mail we received after the Zap was executed successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xco74268xrpxzs0dszw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xco74268xrpxzs0dszw.png" alt="Image description" width="800" height="452"&gt;&lt;/a&gt;&lt;br&gt;
That's about it. Creating a webhook in Testkube and integrating it with Zapier to send emails using Gmail is so simple. &lt;/p&gt;

&lt;p&gt;In fact, using Zapier you can have endless possibilities as it has integration with virtually every tool and service that you know of. So you can set up a webhook in Testkube and configure Zapier to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send test status into an Excel sheet&lt;/li&gt;
&lt;li&gt;Create an issue on GitHub&lt;/li&gt;
&lt;li&gt;Make an entry about the test failure in Notion&lt;/li&gt;
&lt;li&gt;Send a notification to your team on Slack&lt;/li&gt;
&lt;li&gt;And much more.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;To sum it up, enabling webhooks in Testkube elevates the testing process by offering real-time alerts to various test events. This not only streamlines your testing workflow but also enhances the reliability and efficiency of your testing strategy. &lt;/p&gt;

&lt;p&gt;By integrating Testkube with Zapier, you unlock a world of endless possibilities. It allows you to connect Testkube to virtually any service you can think of.&lt;/p&gt;

&lt;p&gt;We invite you to explore the power of &lt;a href="https://testkube.io/"&gt;Testkube&lt;/a&gt; and try Webhooks. Join our community on &lt;a href="https://join.slack.com/t/testkubeworkspace/shared_invite/zt-2arhz5vmu-U2r3WZ69iPya5Fw0hMhRDg"&gt;Slack&lt;/a&gt; to share insights, seek help, and connect with fellow developers.&lt;/p&gt;

</description>
      <category>gitops</category>
      <category>testorchestration</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
