<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Richard Hendricksen on Medium]]></title>
        <description><![CDATA[Stories by Richard Hendricksen on Medium]]></description>
        <link>https://medium.com/@rhendricksen?source=rss-259b947948bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*O_bXp5X-Fn6dL_6KCrqCFQ.jpeg</url>
            <title>Stories by Richard Hendricksen on Medium</title>
            <link>https://medium.com/@rhendricksen?source=rss-259b947948bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:36:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rhendricksen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Running TestCafe tests in Docker, locally and in Jenkins]]></title>
            <link>https://rhendricksen.medium.com/running-testcafe-tests-in-docker-locally-and-in-ci-jenkins-cf8d72b69bbb?source=rss-259b947948bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf8d72b69bbb</guid>
            <category><![CDATA[testcafe]]></category>
            <category><![CDATA[ci]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Richard Hendricksen]]></dc:creator>
            <pubDate>Mon, 10 May 2021 15:13:30 GMT</pubDate>
            <atom:updated>2021-05-14T08:06:27.398Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1Wbkco5VQei0COPHsvBQQ.png" /></figure><p>While you can run TestCafe tests on any machine that has Node.js installed, it is more convenient to run them in a Docker container. This has the advantage when running the tests you don’t need to think about any dependencies, Node.js version etc. It also makes tests less flaky, because the environment the tests run in is always the same, either locally or in the CI environment. This is even more important when using TestCafe for visual regression testing, because then the screenshots will look the same wherever you run the tests.</p><h3>Setting up</h3><p>Make sure you have the following software installed:</p><ul><li>Recent version of Docker.</li><li>Node.js on your local development machine so we can test our code before creating the Docker image.</li><li>Checkout my example git repository. It contains a TestCafe framework and tests. You can find it here:</li></ul><p><a href="https://github.com/richardhendricksen/testcafe-mocking-typescript-framework">richardhendricksen/testcafe-mocking-typescript-framework</a></p><h3>Creating the Docker image</h3><p>The goal is to have a Docker image that contains all the executables needed to run our TestCafe tests. This means software like Node.js, the required browsers and other configuration that ensures functionality like screenshots and reporting works. It will not include the test and testframework code itself in the Docker container. The testcode changes a lot when creating new tests, and I don’t want to recreate the Docker image every time we add a new test.</p><p>We will use volume mounts when running the tests locally in Docker. In CI environment we will use git to pull our testcode in our Docker container.<br>This keeps our image lean and evergreen.</p><p>Most other guides use the testcafe/testcafe Docker image as a base image. This image is created by the TestCafe team. While I was experimenting with Dockerizing my tests I found this Docker image to be limiting. It has only the testcafe npm package pre-installed. My test frameworks usually depend on more packages than only the testcafe package, so the image is too barebones for me. Also it expects you run your test with the testcafe command, so if you like me use custom runners written in Typescript it won’t work out of the box.</p><p>After some searching I found the circleci/node:browsers image. This image contains Node.js, Java, all the browsers we need and is regularly updated. The only thing that isn’t available out of the box is TestCafe itself. But we can fix this easily by installing it and all other npm dependencies using the yarn install command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3c3aba5bfe3f906f0f2ba078a5419bb/href">https://medium.com/media/a3c3aba5bfe3f906f0f2ba078a5419bb/href</a></iframe><p>What this Dockerfile does:</p><ul><li>It copies the package.json from our project into the Docker image in the runner directory. There it installs the dependencies using yarn. This results that all our needed dependencies (including testcafe) are installed inside the Docker image.</li><li>Finally it sets the WORKDIR to a subdirectory called framework. When we want to run our tests we will mount our testcode inside that directory. Why we do this is that we don’t want to mount our local node_modules directory inside the Docker container, because of OS differences this will lead to issues. And to prevent overriding the already installed node_modules, we mount the test code in a subdirectory. When Node.js cannot find the required dependencies in the node_modules folder in the current directory it will look into the node_modules folder in the parent directory etc.</li></ul><p>Build the Docker image usingyarn docker:build <br>Or run docker build . -t testcafe-runner .</p><h3>Running the tests locally</h3><p>To run our tests inside the Docker container from our local machine we need to make our tests available inside the Docker container. We will use volume mounts for this. We need to mount the following directories:</p><ul><li>The testframework and tests.</li><li>The report directory so when the tests are finished the reports are saved on our local machine and not in the Docker container that gets deleted.</li><li>We don’t want to mount our local node_modules folder inside the Docker container, so we create an empty volume for this directory.</li></ul><p>We can achieve this by running:</p><pre>docker run -it --rm \<br>-v ${PWD}:/runner/framework \<br>-v ${PWD}/reports/allure:/runner/allure \<br>-v /runner/framework/node_modules \<br>testcafe-runner yarn test:ci</pre><p>This command will spin up a container of type testcafe-runner, remove it after it is done running, mounts the needed volumes inside the container and will execute the yarn test:ci command inside the container.</p><p>This can also be executed using the yarn docker:run:test command.</p><p>After the tests have run you can check the Allure test report using the<br>yarn test:report:open command.</p><h3>Running the tests in Jenkins (or any other CI env)</h3><p>When running the tests in CI we don’t need to volume mount our testcode inside the container. We will use git to retrieve the latest code from the repository. For this demo we will use Jenkins, but any CI environment like BitBucket Pipelines, GitHub Actions will do.</p><p>To try this out locally you need a Jenkins instance with Docker support. To set this up easily I created a Docker compose file that sets up a Jenkins container with Docker in Docker support:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b64fa40c560102747f7e45446ac1434/href">https://medium.com/media/8b64fa40c560102747f7e45446ac1434/href</a></iframe><p>Run with docker compose up -d .</p><blockquote>The Jenkins container it creates has no security features whatsoever, so only use for local testing!</blockquote><p>Now navigate to <a href="http://localhost:8080/">http://localhost:8080/</a> and click on Create a job .</p><p>Create a Pipeline job:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bdQXssKng0ZHk-0aZzrCGA.png" /></figure><p>And use the following pipeline script:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/831f5ea0c671890c842eb8f88a15cda6/href">https://medium.com/media/831f5ea0c671890c842eb8f88a15cda6/href</a></iframe><p>Run the pipeline. It will now:</p><ul><li>Retrieve the Docker image and start the container</li><li>Checkout the code using git inside the container</li><li>Install the npm dependencies using Yarn</li><li>Run the TestCafe tests</li><li>Create and archive the Allure report</li></ul><p>Afterwards you can view the report using the Test results link in the menu:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*geTmBSvMicYrPp7ZCixNog.png" /></figure><p>This will open the Allure HTML report, with screenshots for failed tests:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tu-VJYWmvoxQBSMnfAaF7w.png" /></figure><h3>Conclusion</h3><p>This blog should give a quick guide on how to quickly get started with running TestCafe tests in Docker. The CI setup for Jenkins should as easily also work for Bitbucket Pipelines and Github Actions. Examples of these can be found on my example Github repo.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf8d72b69bbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed load testing with Gatling using Docker and AWS — Part 2]]></title>
            <link>https://rhendricksen.medium.com/distributed-load-testing-with-gatling-using-docker-and-aws-part-2-5a6df57128aa?source=rss-259b947948bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a6df57128aa</guid>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[gatling]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Richard Hendricksen]]></dc:creator>
            <pubDate>Fri, 25 Sep 2020 11:55:38 GMT</pubDate>
            <atom:updated>2020-09-25T12:27:15.351Z</atom:updated>
            <content:encoded><![CDATA[<h3>Distributed load testing with Gatling using Docker and AWS — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ff5LKxuz6Wjur3r9-frl8A.png" /></figure><p>About a year ago I wrote my initial article about <a href="https://medium.com/@richard.hendricksen/distributed-load-testing-with-gatling-using-docker-and-aws-d497605692db">distributed load testing with Gatling using Docker and AWS</a>. Since that time I have improved my initial setup by quite a bit. This article describes my improved guide. I’ll also point out which improvements I made.</p><p>This article references the first one quite a bit, it can be found here:</p><p><a href="https://medium.com/@richard.hendricksen/distributed-load-testing-with-gatling-using-docker-and-aws-d497605692db">Distributed load testing with Gatling using Docker and AWS</a></p><h3>Previous setup</h3><p>In my original setup I used a Gatling Maven project for the load test code. From this a Docker image containing the Maven project was created. This image was then pushed to AWS ECR as the docker registry.<br>ecs-cli was used to create the needed infra and run the Docker image on AWS. After finishing the test the docker image would write its simulation.log to an S3 bucket, where a bash script could later retrieve it to make the HTML report.</p><h4>Improvements over the previous setup</h4><ul><li>Create runnable fat jar for Gatling docker container</li><li>Setup infra using AWS CDK instead of ecs-cli</li><li>Run load test using AWS SDK instead of bash scripts</li><li>Being able to pass environment variables to individual gatling-runners, for example which userId’s to use</li><li>Adding realtime monitoring</li></ul><h3>Example repository</h3><p>The code examples in this article all come from my Github repository which contains a fully worked out example project:</p><p><a href="https://github.com/richardhendricksen/gatling-docker-on-aws/">richardhendricksen/gatling-docker-on-aws</a></p><p>The code used in the original article can be found in the <a href="https://github.com/richardhendricksen/gatling-docker-on-aws/tree/v1">v1</a> branch.</p><h3>Step 1. Gatling Maven Project</h3><p>This step is equal to my original article, read it <a href="https://medium.com/@richard.hendricksen/distributed-load-testing-with-gatling-using-docker-and-aws-d497605692db#666c">here</a>.</p><h3>Step 2. Creating Docker image</h3><p>This will be the first improvement. In the previous guide I would create a Docker image that contains Maven and include the source code. On init the docker container would call mvn clean gatling:test, which in turn uses the gatling-maven-plugin that would compile the code and run the Gatling test.<br>But the Maven repository is not included in the Docker image, so every time a container is started all the required dependencies will be downloaded and the source needs to be compiled.</p><p>What would be better is to use a <a href="http://tutorials.jenkov.com/maven/maven-build-fat-jar.html">fat jar</a> that includes the compiled test code and all its dependencies, so the Gatling test can be run directly using java .</p><h4>Creating the fat jar</h4><p>First create a jar of the Gatling testcode. To do this add the maven-jar-plugin to the pom.xml:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/445a9863394b2a335f98b020de3e012c/href">https://medium.com/media/445a9863394b2a335f98b020de3e012c/href</a></iframe><p>When running mvn clean package it will create gatling-runner-1.0-SNAPSHOT-tests.jar in the target folder. This jar wil contain all the compiled testcode, but no dependencies. For this the maven-assembly-plugin is used. This plugin however will only include runtime dependencies, so remove the test scope from all the dependencies.<br>Then add the maven-assembly-plugin to the pom.xml:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c7ad01a4482b5e49b6fb12f0d10ec5a/href">https://medium.com/media/6c7ad01a4482b5e49b6fb12f0d10ec5a/href</a></iframe><p>This will generate gatling-runner-1.0-SNAPSHOT-jar-with-dependencies.jar in the target folder. With both of these jars combined the Gatling project can be ran using java.</p><p>When running the Gatling test using Maven, the gatling-maven-plugin is used. This plugin uses <a href="https://github.com/gatling/gatling-maven-plugin/blob/7c9de64c0fc15dd044a059c685b4bc3b7e0b0868/src/main/java/io/gatling/mojo/MojoConstants.java">specific</a> Java Runtime options that need to be set.</p><p>Combine this in an entrypoint script that will run the Gatling code using java setting the needed JAVA_OPTS. After the tests the script will also upload the simulation.log file to the S3 bucket:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3dd895e7a0d114b6493af44e8a63f0d/href">https://medium.com/media/a3dd895e7a0d114b6493af44e8a63f0d/href</a></iframe><p>The improved Docker image no longer needs Maven and the source code, it only needs the JRE, aws-cli and both jars:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46c5fdc6c7046c43d0d21f0d81bfcff4/href">https://medium.com/media/46c5fdc6c7046c43d0d21f0d81bfcff4/href</a></iframe><p>Build the Docker image with docker build -t gatling-runner . .</p><p>When running locally you will need to set the required environment variables:</p><ul><li>SIMULATION : The desired Gatling Simulation to run, needs to be full classpath, e.g. nl.codecontrol.gatling.simulations.BasicSimulation</li><li>REPORT_BUCKET: The S3 Bucket to write the Gatling results file to</li><li>Optionally: AWS_PROFILE : Set this if you want to use a non-default profile</li></ul><pre>docker run --rm \<br>-v ${HOME}/.aws/credentials:/root/.aws/credentials:ro \<br>-e SIMULATION=nl.codecontrol.gatling.simulations.BasicSimulation \<br>-e REPORT_BUCKET=&lt;S3_BUCKET&gt; \<br>-e AWS_PROFILE=&lt;AWS_PROFILE&gt; \ <br>gatling-runner</pre><h3>Step 3. Setting up infra</h3><p>In the original setup ecs-cli was used to setup the infra, but it required other infra parts to already exist. For example to run the gatling-runner on an ECS cluster you need a task role with S3 write rights. You also needed to manually create ECR repositories to store the Docker images on AWS.</p><p>To streamline this I migrated to AWS CDK. AWS CDK is the <a href="https://aws.amazon.com/cdk/">AWS Cloud Development Kit</a>. It is a software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. The AWS CDK supports TypeScript, JavaScript, Python, Java, and C#/.Net. In this guide Java is used.</p><p>In the following steps I won’t go in too much detail in how AWS CDK works, but I will show the code that will generate what’s needed. Perhaps in the future I will create a separate article about this topic.</p><h4>Getting started</h4><p>Install the AWS CDK:<br>npm install -g aws-cdk</p><p>Now init a new project using:<br>cdk init app — language java</p><p>In setting up the infra an existing VPC and S3 Bucket will be used, which will be passed using env vars. Everything else will be created using the CDK app.</p><blockquote>The reason I use an existing S3 bucket, is that when you destroy the stack using cdk and the S3 bucket still contains files, the S3 bucket won’t be destroyed. Then when you want to recreate the stack you will get errors mentioning the S3 bucket you want to create already exists. To prevent this I will just assume you already created the S3 bucket manually.</blockquote><p>First setup the CDK App. It will pass the AWS credentials to the stack and expects env vars VPC_ID and REPORT_BUCKET . The app then creates the GatlingRunnerEcsStack , which in turn consists of all the infra parts that are needed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a26266afeecc1a483f6a0cc8bf3489f/href">https://medium.com/media/3a26266afeecc1a483f6a0cc8bf3489f/href</a></iframe><p>The GatlingRunnerEcsStack creates:</p><ul><li>ECS Cluster to run the tasks on</li><li>IAM Roles for running Fargate tasks and writing to the S3 bucket</li><li>Docker image builder using the Dockerfile from the Maven Gatling project</li><li>Fargate task definition for running the Docker container</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/15a9d5bef4c00ef9790dd58bc9c020fa/href">https://medium.com/media/15a9d5bef4c00ef9790dd58bc9c020fa/href</a></iframe><p>It uses helper classes for the Roles, ContainerOptions and TaskDefinition . You can find the source code for those <a href="https://github.com/richardhendricksen/gatling-docker-on-aws/tree/master/gatling-infra/src/main/java/nl/codecontrol/cdk/gatling/runner">here</a>.</p><h4>Deploying the infra</h4><p>First compile the code using: mvn package</p><p>You can now deploy the Infra stack using:</p><pre>VPC_ID=&lt;VPC_ID&gt; \<br>REPORT_BUCKET=&lt;S3_BUCKET&gt; \<br>cdk deploy --profile &lt;AWS_PROFILE&gt;</pre><p>The output will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBsppxOmyyrOO4f79SsN4A.png" /></figure><blockquote>When running for the first time you might get the following error: GatlingRunnerEcsStack failed: Error: This stack uses assets, so the toolkit stack must be deployed to the environment <br>You can fix this by bootstrapping the CDK on your profile:<br>cdk bootstrap aws://&lt;aws_id&gt;/region</blockquote><h3>Step 4. Creating AWS Runner</h3><p>In the original setup I used mostly bash shell scripting to run the test, for the new setup I moved to using AWS SDK . This gives us more possibilities to setup the testrunner while also being easier to write and maintain.</p><p>Setup the Maven project by using the following pom.xml:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dba7fcc008935d90ec9028e372328cc8/href">https://medium.com/media/dba7fcc008935d90ec9028e372328cc8/href</a></iframe><p>It contains all dependencies needed for the testrunner.</p><p>The AWSLoadTestRunner does several things:</p><ul><li>Checks if there are no current running tasks on the cluster. If true, then it will exit with an error.</li><li>It has a Config object containing settings for the testrun. Most important are the number of containers that will be spun up, the number of users per container and the duration.</li><li>For the number of requested containers it will create a RunTaskRequest , setting the requested settings using environment variables. After this it will start the task.</li><li>When all tasks are started, it will wait until every task is done.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b30b8ab6a5d182f0053eb6846d5b1495/href">https://medium.com/media/b30b8ab6a5d182f0053eb6846d5b1495/href</a></iframe><p>Set the desired config using environment variables and then execute the AWSLoadTestRunner using Maven:</p><pre>AWS_PROFILE=&lt;AWS_PROFILE&gt; \<br>VPC_ID=&lt;VPC_ID&gt; \<br>CLUSTER=gatling-cluster \<br>TASK_DEFINITION=gatling-runner \<br>CONTAINERS=10 \<br>USERS=2000 \<br>MAX_DURATION=1 export \ SIMULATION=nl.codecontrol.gatling.simulations.BasicSimulation \<br>mvn clean compile exec:exec</pre><p>The output will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vzfoQsIYJ-QVZmaWUObMUg.png" /></figure><h3><strong>Step 5. Generating HTML report</strong></h3><p>This step has not changed from the previous article. The Gatling runners still write their simulation.log files to the S3 bucket when they are done. We then retrieve them using aws cli and combine them using built in Gatling functionality. See <a href="https://medium.com/@richard.hendricksen/distributed-load-testing-with-gatling-using-docker-and-aws-d497605692db#5a17">part 1</a> of my article for the full explanation.</p><h3>Step 6. Add realtime monitoring</h3><p>One of the first things I wanted to add on the previous solution was a way to realtime monitor the load test. This way I could spot performance issues during the test instead of waiting until the full duration of the test was completed when the Gatling report was created.</p><p>The best way to use this to let Gatling using the Graphite protocol to write to an InfluxDB and create a Grafana dashboard that uses the InfluxDB as a data source. An explanation for this solution can also be found on the Gatling <a href="https://gatling.io/docs/current/realtime_monitoring/#graphite-influxdb-grafana">website</a>.</p><h4>Creating InfluxDB and Grafana Docker images</h4><p>Before Gatling can be configured an InfluxDB and Grafana service needs to be setup. I will also use Docker images for this.</p><p>First create the InfluxDB docker image:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3211f72e161e870eb62b060dbbf25bd1/href">https://medium.com/media/3211f72e161e870eb62b060dbbf25bd1/href</a></iframe><p>A custom influxdb.conf is used to set the required templates needed for visualizing later in Grafana. Templates allow matching parts of a metric name to be used as tag names in the stored metric.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b598d0c8a9bfdd6685a0a3a176f7cd3/href">https://medium.com/media/9b598d0c8a9bfdd6685a0a3a176f7cd3/href</a></iframe><p>The other file copied into the Docker image is an init db script that sets a TTL on the Graphite database for 1d to keep the database size in check:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd48d463fc1a2addf94ed816b23c46eb/href">https://medium.com/media/fd48d463fc1a2addf94ed816b23c46eb/href</a></iframe><p>Then the Grafana image:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20d143435702b1b188c03e72e1997255/href">https://medium.com/media/20d143435702b1b188c03e72e1997255/href</a></iframe><p>This one is a little more complex. I use the <a href="https://grafana.com/docs/grafana/latest/installation/configure-docker/">provisioning</a> possibilities of the Grafana image to provision the InfluxDB datasource and the dashboard. Since I also want to be able to make screenshots of the dashboard using the Grafana API I needed to setup the renderer plugin as described <a href="https://grafana.com/docs/grafana/latest/administration/image_rendering/#run-in-docker">here</a>.</p><p>Check my <a href="https://github.com/richardhendricksen/gatling-docker-on-aws/tree/master/gatling-infra/src/main/java/nl/codecontrol/cdk/gatling/monitoring">repository</a> for the InfluxDB datasource and dashboard provision files.</p><h4>Deploying monitoring infra</h4><p>The monitoring solution will also be deployed on AWS. To create the needed infrastructure I will again use AWS CDK. The monitoring infra will be a separate stack so I can decide which of both stacks I want to deploy any given time.</p><p>First update the GatlingInfraCDKApp to contain the second stack:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21c7ec6688225c8bfe53e57fee94fe5e/href">https://medium.com/media/21c7ec6688225c8bfe53e57fee94fe5e/href</a></iframe><p>The GatlingRealtimeMonitoringEcsStack will create the following:</p><ul><li>Create a separate ECS Cluster so it won’t interfere with the gatling runners</li><li>Setup the needed IAM roles</li><li>Create the needed security group</li><li>Create containers for both InfluxDB and Grafana</li><li>Setup task definition containing the InfluxDB and Grafana containers</li><li>Setup a Fargate service containing the task definition</li><li>Setup a Load balancer to create a DNS for the Gatling containers to connect to</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83db9260cb39e0426002f804cbf09c96/href">https://medium.com/media/83db9260cb39e0426002f804cbf09c96/href</a></iframe><p>Check the <a href="https://github.com/richardhendricksen/gatling-docker-on-aws/tree/master/gatling-infra/src/main/java/nl/codecontrol/cdk/gatling/monitoring">repository</a> for the helper classes.</p><h4>Deploying the monitoring infra</h4><p>Again, first compile the code using: mvn package</p><p>Since there are now two stacks in the CDK App you need to define which stack you want to deploy:</p><pre>VPC_ID=&lt;VPC_ID&gt; \<br>REPORT_BUCKET=&lt;S3_BUCKET&gt; \<br>cdk deploy GatlingMonitoringEcsStack --profile &lt;profile&gt;</pre><p>This will result in the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMW039_nNLo8g1I5MXc-DQ.png" /></figure><p>The load balancer will have generated a DNS name where the monitoring stack will be available. Go to AWS EC2 to find it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIK-tw8dNDNJAcRODp2l2A.png" /></figure><p>Or use the aws-cli tooling:</p><pre>aws elbv2 describe-load-balancers \<br>                --names gatling-monitoring \<br>                --query LoadBalancers[].DNSName \<br>                --output text</pre><p>On this address the Grafana dashboard will be available on port :80. On port :2003 the graphite endpoint for InfluxDB will be available.</p><h4>Configure Gatling</h4><p>Changing the Gatling config is easy. Just enable the graphite config section in the gatling.conf :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21ae341fc1579a8ae885c879b24d407c/href">https://medium.com/media/21ae341fc1579a8ae885c879b24d407c/href</a></iframe><p>Now build the gatling-runner project and redeploy the GatlingRunnerECSStack so the Docker image gets updated on ECR.</p><p>Now run a loadtest and watch the dashboard…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Pb8eoudZqBRavd2Zu6gBg.png" /></figure><h3><strong>Afterthoughts</strong></h3><p>I finally found time to add part 2 to my initial article and I’m quite happy with my current solution. The maintenance has become so much easier than my initial setup and the realtime monitoring is the best addition by far. I’ll keep improving my current setup over time and those improvements can be found in the Github repository mentioned above in the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a6df57128aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Frontend integration testing with CodeceptJS and Playwright]]></title>
            <link>https://rhendricksen.medium.com/setting-up-codeceptjs-playwright-integration-test-framework-with-mocking-support-f3cb53127ec4?source=rss-259b947948bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3cb53127ec4</guid>
            <category><![CDATA[mocking]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[playwrights]]></category>
            <category><![CDATA[browser-testing]]></category>
            <category><![CDATA[codeceptjs]]></category>
            <dc:creator><![CDATA[Richard Hendricksen]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 13:57:24 GMT</pubDate>
            <atom:updated>2020-09-08T18:21:39.855Z</atom:updated>
            <content:encoded><![CDATA[<h3>Frontend integration test framework with CodeceptJS and Playwright</h3><p>On my current project we use the widely known <a href="https://martinfowler.com/bliki/TestPyramid.html">test pyramid</a>. That means we have a small set of slow end-to-end tests that runs against a fully deployed application: frontend, backend and a database with meaningful data. One level below that we have our so called frontend integration tests. Also called UI integration tests, frontend only tests etc. These are tests where we do want to fully render the app in a real browser, but don’t want to test the whole stack and the tests don’t have to run in multiple browsers.</p><p>We were using a framework using Protractor for driving the browser and ng-apimock for mocking the http calls. Since Protractor is <a href="https://dev.to/davert/5-reasons-you-should-not-use-protractor-in-2019-3l4b">considered end of life</a>, we needed to migrate to newer solution.</p><h3>CodeceptJS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eS7cYHOLCLalIWUDCXdyuQ.png" /></figure><p>We eventually settled on a framework consisting of <a href="https://codecept.io/">CodeceptJS</a> and Playwright. If you don’t know CodeceptJS, it is more of a <a href="https://codecept.io/basics/#architecture">wrapper</a> than a standalone testing tool. It supports frameworks like Testcafé, Protractor, WebdriverIO, Playwright and more. The advantage is that you can write your tests and page objects separate from the underlying framework that controls the browser.</p><p>Since we are considering using Testcafé for our new end-to-end framework and Playwright for the frontend integration tests, using CodeceptJS means we could reuse our page objects.</p><h3>Playwright</h3><p><a href="https://github.com/microsoft/playwright">Playwright</a> is a relative new framework to automate browser testing that’s fast, reliable and evergreen. It is from the same team of developers that originally developed Puppeteer.</p><h3>Getting started</h3><p>In this blog we will go step by step creating the framework. You will need at least Node.js &gt; 12.0. I will include all code examples as gists.<br>I also included my github repository where you can find the whole framework:</p><p><a href="https://github.com/richardhendricksen/codeceptjs-playwright-with-mocking">richardhendricksen/codeceptjs-playwright-with-mocking</a></p><h3>Application under test</h3><p>For this guide we will use a simple Todo app for our application under test. We will use the <a href="https://www.todobackend.com/">Todo-Backend</a> app for this. It comes with a separate frontend and multiple backends to choose from. I have chosen for the Java 8 with Spring Boot backend. The resulting url for this app is shown below:</p><p><a href="https://www.todobackend.com/client/index.html?https://todo-backend-spring4-java8.herokuapp.com/todos">Todo-Backend client</a></p><p>The exact choice for the backend part isn’t that relevant since we will mock it anyway. But it is easier to debug tests when you have a fully functional app.</p><h3>Setting up CodeceptJS</h3><p>Create an empty folder, then initialize npm and/or git as usual. Install the CodeceptJS, Playwright and Typescript dependencies: <br>npm install --save-dev codeceptjs playwright typescript ts-node</p><p>Now setup CodeceptJS using npx codeceptjs init . We will be using Typescript as our main language where possible. The final step will be to add an initial feature to test. Use settings shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pff6n5YsrWfWr_-xQz5SJA.png" /></figure><h4>Typescript</h4><p>Since we will be using Typescript for our test code, we need to add a tsconfig.json file to our project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df000d4459e7918180d4871b21603043/href">https://medium.com/media/df000d4459e7918180d4871b21603043/href</a></iframe><p>Next we need to add ts-node to our generated config file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2792ccb822d58eb48f3ec3cf1c87a2de/href">https://medium.com/media/2792ccb822d58eb48f3ec3cf1c87a2de/href</a></iframe><p>Remove the unneeded jsconfig.json file.</p><p>We can now run the framework using npx codeceptjs run . If everything went correctly you will now see 1 passing test that does exactly nothing.</p><h3>Adding first test</h3><p>When initializing the CodeceptJS framework we already created an empty test: list_todos.spec.ts . Now we can add our code to test our first scenario.</p><p>Tests in the CodeceptJS framework consists of a file that first describe the feature that is tested. In this feature there are one or more scenarios. In theses scenarios we use the I object to interact with the browser. As described by CodeceptJS:</p><blockquote>Each test is described inside a Scenario function with the I object passed into it. The I object is an actor, an abstraction for a testing user. The I is a proxy object for currently enabled Helpers.</blockquote><p>Our first scenario will be to open the app with an empty todo list. We will then check if the title is shown, that we can make new todo items and no todo list is shown:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70608305d57d33779d53866443276e02/href">https://medium.com/media/70608305d57d33779d53866443276e02/href</a></iframe><p>Run the test with npx codeceptjs run .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hs0l_6ASrdqMqXpR9vicKg.png" /><figcaption>Success!</figcaption></figure><p>If you want to see more detail about the steps in the test, add --steps to the runner:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkuj7fLLSgYo92ghbhqQVQ.png" /></figure><h3>Page objects</h3><p>To make the code more readable and reusable, we will migrate to using page objects. CodeceptJS has support for <a href="https://codecept.io/pageobjects/#pageobject">page objects</a>. But since I want to use Typescript and don’t want to use their dependency injection I will use a different setup.</p><p>In the sub folder pages we will create our first page object: todo.page.ts. It will will contain the needed selectors and methods for getting or modifying the state of the app. The page object itself will not do any assertions, this will be done in the test itself. As stated by Martin Fowler on <a href="https://martinfowler.com/bliki/PageObject.html">page objects</a>:</p><blockquote>Page objects are commonly used for testing, but should not make assertions themselves. Their responsibility is to provide access to the state of the underlying page. It’s up to test clients to carry out the assertion logic.</blockquote><p>Therefore we won’t be using any of the see* methods anymore, since they do their own assertions, and I don’t want those in my page objects. We will use the grab* methods instead, which will return the state, instead of asserting them. We then use chai to do the assertion in the test instead of the page object.</p><h4>async/await</h4><p>The CodeceptJS code looks synchronous, but it actually asynchronous, as mentioned in the <a href="https://codecept.io/basics/#how-it-works">How it Works</a> section:</p><blockquote>Behind the scenes all actions are wrapped in promises, inside of the <em>I</em> object. <a href="https://github.com/Codeception/CodeceptJS/blob/master/lib/recorder.js">Global promise</a> chain is initialized before each test and all <em>I.*</em> calls will be appended to it, as well as setup and teardown.</blockquote><p>However when using the grab* methods CodeceptJS states:</p><blockquote>If you need to get element’s value inside a test you can use grab* methods. They should be used with await operator inside async function</blockquote><p>In other words, test execution doesn’t pause when using the grab* methods, since they aren’t part of the global promise chain. Therefore we will need to use async/await setup when using those methods. To keep our test code consistent we will use it for all our test code.</p><h4>Custom Steps</h4><p>In our initial test we used seeElement and dontSeeElement methods. These methods asserts if the element is visible or not visible, respectively. CodeceptJS currently doesn’t have a method to grab the visible state of an element. The one method that comes close is grabNumberOfVisibleElements . This method however returns the number of elements that is visible given a selector. So we need to add a custom method canSee that returns the boolean we can assert.</p><p>When we initialized the project, CodeceptJS created a steps_file.js where we can add custom steps that extend the I object. But since we are using Typescript, rename the file to steps_file.ts. Then add our custom method:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb6491682c6c9e8e1030228d87455c32/href">https://medium.com/media/bb6491682c6c9e8e1030228d87455c32/href</a></iframe><p>Fix our config by replacing steps_file.js with steps_file.ts in the include section:</p><pre>include: {<br>    I: &#39;./steps_file.ts&#39;<br>}<strong>,</strong></pre><p>Finally to provide autocompletion for our new method in the IDE, we need to update the Typescript definition file to include this new method.<br>Run: npx codeceptjs def</p><p>Combining all information above, the todo.page.ts will look as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9246f6bfafe2127776328f04f535ead/href">https://medium.com/media/b9246f6bfafe2127776328f04f535ead/href</a></iframe><p>We have to do some extra plumbing for the getTitle method, because the grabTextFrom method returns either a string or string[] depending on the selector. Since we only expect a single string, when an array is returned we only take the first value. Another solution would be to throw a warning or error since we aren’t expecting an array of strings.</p><p>We can now edit our existing test to use the page object. For our assertions we will use the chai framework. Install it with npm install --save-dev chai .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0bc9dee47ef7d2d927897cca46ebcbfc/href">https://medium.com/media/0bc9dee47ef7d2d927897cca46ebcbfc/href</a></iframe><p>We now have one scenario: an empty todo list. For the next scenarios we want the app to contain todos. To able to test this we would need to set the required state in the database before each test. Since we only are testing the frontend this is not some we want to do. The solution is to mock the backend request that returns the list of todos.</p><h3>Mocking</h3><p>Before adding more scenarios we need to add support for mocking the backend. CodeceptJS includes limited <a href="https://codecept.io/helpers/MockRequest/#mockrequest">mocking</a> support, but this is only implemented for Puppeteer and Webdriver. This means we will have to implement this ourselves.</p><p>Extending the Playwright helper in CodeceptJS is made easy by creating a <a href="https://codecept.io/helpers/#extending-codeceptjs-with-custom-helpers">custom helper</a>. This helper will extend the I object, adding framework specific methods to handle the mocking.</p><p>Playwright has a method called page.route(url, handler) in their <a href="https://github.com/microsoft/playwright/blob/master/docs/api.md#pagerouteurl-handler">API</a>. This method provides the capability to modify network requests that are made by a page.</p><p>To create a custom helper run npx codeceptjs gh . Use settings shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-RIX2w8kDTaz3mGro3CwHA.png" /></figure><p>As you can see above the helpers are written in Javascript instead of Typescript. This is because CodeceptJS expects custom helpers to be ES6 classes that extend the <a href="https://github.com/Codeception/CodeceptJS/blob/master/lib/helper.js">abstract Helper class</a>. I have not been able to get this to work in Typescript yet.</p><p>The next thing we need to do is to extend our config to include our new custom helper. Replace the helpers section of the config with:</p><pre>helpers: {<br>    Playwright: {<br>        url: &#39;https://www.todobackend.com/client/index.html?https://todo-backend-spring4-java8.herokuapp.com/todos&#39;<strong>,<br>        </strong>show: true<strong>,<br>        </strong>browser: &#39;chromium&#39;<br>    }<strong>,<br>    </strong>PlaywrightHelper: {<br>        require: &#39;./helpers/playwright.helper.js&#39;<strong>,<br>    </strong>}<br>}<strong>,</strong></pre><h4>Writing the helper</h4><p>The method we will add will be called mockEndpoint. It expects the following parameters:</p><ul><li>url : A regex string that matches the http request</li><li>method: the HTTP method type, e.g. GET, POST etc.</li><li>baseDir: the directory where the mocked response can be found</li><li>scenario: the filename of the mocked JSON response that contains the data to be returned</li></ul><blockquote>After writing this I figured out that the Playwright page.route doesn’t support HTTP method matching, it only matches the url. I still think it is a good idea to store this information though, so I have left it in.</blockquote><p>Since the first 3 params are fixed for each endpoint we will combine them together in one object.</p><p>Create a directory mocking and add a endpoints.ts file containing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b952212994aa887ea992ce55d2df32f/href">https://medium.com/media/1b952212994aa887ea992ce55d2df32f/href</a></iframe><p>It does not contain any endpoints yet, but we will add those later.</p><p>Now edit the playwright.helper.js file and add our method mockEndpoint. It uses the page object from the Playwright Helper provided by CodeceptJS. The page object contains the route method we need. It will match a regex http request and returns the JSON content of a file instead of the real request.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3307c64e622c23b4a5af4dd8b7be8f87/href">https://medium.com/media/3307c64e622c23b4a5af4dd8b7be8f87/href</a></iframe><p>This provides us with an I.mockEndpoint(endpoint, scenario) method to use in our tests.</p><h4>Typescript</h4><p>To provide autocompletion for our new method in the IDE, we need to update the Typescript definition file again to include this new method.<br>Run: npx codeceptjs def</p><h4>Mocking the GET todos endpoint</h4><p>To mock the GET todos endpoint we need go back to the app:</p><p><a href="https://www.todobackend.com/client/index.html?https://todo-backend-spring4-java8.herokuapp.com/todos">Todo-Backend client</a></p><p>When checking the network tab you can see it does the following network request to get the list of todos when opening the page:</p><p>GET <a href="https://todo-backend-spring4-java8.herokuapp.com/todos">https://todo-backend-spring4-java8.herokuapp.com/todos</a>/</p><p>It initially returns an empty JSON list:</p><p>[]</p><p>Now add a todo item and refresh. It will now return a JSON list with one item:</p><pre>[<br>  {<br>    &quot;id&quot;<strong>: </strong>1<strong>,<br>    </strong>&quot;title&quot;<strong>: </strong>&quot;My first todo&quot;<strong>,<br>    </strong>&quot;completed&quot;<strong>: </strong>false<strong>,<br>    </strong>&quot;order&quot;<strong>: </strong>1<strong>,<br>    </strong>&quot;url&quot;<strong>: </strong>&quot;https://todo-backend-spring4-java8.herokuapp.com/todos/1&quot;<br>  }<br>]</pre><p>So now we have all the info we need to mock this endpoint. Let’s add this info to our Endpoints class in the endpoints.ts file:</p><pre>export class Endpoints {<br>    static <em>TODOS</em>: Endpoint = {url: &#39;^https://todo-backend-spring4-java8.herokuapp.com/todos/$&#39;<strong>, </strong>method: &#39;GET&#39;<strong>, </strong>baseDir: &#39;todos&#39;}<strong>;<br></strong>}</pre><p>Let’s create a mock data files for this endpoint. In the directory mocking/data/todos create empty.json containing [] .</p><p>Next create singleTodo.json with:</p><pre>[<br>  {<br>    &quot;id&quot;<strong>: </strong>1<strong>,<br>    </strong>&quot;title&quot;<strong>: </strong>&quot;My first todo&quot;<strong>,<br>    </strong>&quot;completed&quot;<strong>: </strong>false<strong>,<br>    </strong>&quot;order&quot;<strong>: </strong>1<strong>,<br>    </strong>&quot;url&quot;<strong>: </strong>&quot;https://todo-backend-spring4-java8.herokuapp.com/todos/1&quot;<br>  }<br>]</pre><h4>Updating first scenario</h4><p>Our first scenario worked because the state of the backend was aligning with our test: the list of todos was empty. But we don’t want to call the backend, so edit the first scenario to mock the backend call so it returns an empty todo list:</p><pre><strong><em>Scenario</em></strong>(&#39;empty todo list&#39;<strong>, </strong>async (I) =&gt; {<br>    await I.mockEndpoint(Endpoints.<em>TODOS</em><strong>, </strong>&#39;empty&#39;)<strong>;<br>...</strong></pre><h4>Adding second scenario</h4><p>Let’s add a new scenario to our existing test file. We will mock the endpoint to return a single todo item and then check if that todo item is shown correctly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4596ede27c73afe9b915fae96dd8ca8/href">https://medium.com/media/a4596ede27c73afe9b915fae96dd8ca8/href</a></iframe><h4>Expanding page object</h4><p>Since we now have a todo item in the frontend, we want to verify that:</p><ul><li>The title of the todo item is My first todo</li><li>The todo item is not completed</li><li>The number of todo items is 1</li></ul><p>We need to expand our page object to be able to retrieve this information from the page:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61a224c44e046caf700dd546e2c3ee29/href">https://medium.com/media/61a224c44e046caf700dd546e2c3ee29/href</a></iframe><p>Then we can update our test again:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa613e4f03850d90e5a2ccb301142b37/href">https://medium.com/media/aa613e4f03850d90e5a2ccb301142b37/href</a></iframe><p>Run the test with npx codeceptjs run --steps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mrI9Ik2sVfVvAY3WKlxriQ.png" /></figure><h3>Conclusion</h3><p>While I was writing this guide I got more and more excited about the possibilities of CodeceptJS and Playwright. It was easy to setup, incredibly fast and so far really stable.</p><p>While the I.&lt;method&gt; BDD style reads really well if your tests only consists of these methods, it gets a bit messy if you use them in conjunction with page objects. What doesn’t help is that the example code on the <a href="https://codecept.io/pageobjects/#pageobject">CodeceptJS website</a> does exactly this.<br>Solution for this would be to put everything in page objects, but then you shouldn’t use the I.see* methods anymore if you don’t want to do the assertions in page objects. However, not all see methods have an equivalent grab method, resulting in having to create more custom code yourself.</p><p>What I’m really curious about is how easy it is to reuse this framework and its page objects for e2e testing using TestCafé, since this is one of my reasons for choosing CodeceptJS in conjunction with Playwright instead of just Playwright alone. Perhaps I’ll add a future blog with my experiences on this matter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3cb53127ec4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consumer-Driven Contract Testing with Pact for Angular and Spring Boot]]></title>
            <link>https://rhendricksen.medium.com/consumer-driven-contract-testing-with-pact-for-angular-and-spring-boot-9c84caac4040?source=rss-259b947948bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c84caac4040</guid>
            <category><![CDATA[pact]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[junit-5]]></category>
            <category><![CDATA[contract-testing]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Richard Hendricksen]]></dc:creator>
            <pubDate>Wed, 04 Dec 2019 07:43:21 GMT</pubDate>
            <atom:updated>2020-11-23T08:17:34.039Z</atom:updated>
            <content:encoded><![CDATA[<h4>Setting up Contract Testing using Pact, Angular with Karma and Jest and Spring Boot with JUnit 5</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aasyQdazvooYBfG27o2Rog.png" /></figure><p>When setting up Contract testing for our project we had some issues getting Pact working nicely with Angular Testbed and Karma/Jest. The code examples that are available are either outdated or simply not working when having multiple providers.</p><p>In this article I will go step by step showing how to setup a Consumer-Driven Contract Testing framework with Pact. It will include an Angular frontend as a Consumer and a Spring Boot backend as a Provider.</p><h3>Code Example</h3><p>I have created an example repository on GitHub containing all the code:</p><p><a href="https://github.com/richardhendricksen/pact-example-angular-spring-boot">richardhendricksen/pact-example-angular-spring-boot</a></p><h3>Getting started</h3><p>Create a new directory which will be the root for our Consumers, Providers and contracts. We will use both Typescript/Javascript and Java for this guide.</p><h3><strong>Creating the Consumer</strong></h3><p>Since the framework is consumer-driven we will start with our first consumer, the Angular frontend. We will both use Karma and Jest to run the Pact tests.</p><h4>Angular CLI</h4><p>To create the first Angular app we will use <a href="https://cli.angular.io/">Angular CLI</a>. First create a directory consumers from the root dir and in this directory run:</p><p>ng new angular-karma</p><p>Keep every setting default and the Angular app will be created</p><p>As you can see above we will create an Angular app per testrunner to keep things clear. We will start with Karma.</p><h4>Adding the service</h4><p>To have something to contract test we will add a User service to our Angular project. Go to the src/app folder and create the user.service.ts file. It will be a simple service for our User endpoint:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f912f127ab4ea76ea66398a9608d13c/href">https://medium.com/media/6f912f127ab4ea76ea66398a9608d13c/href</a></iframe><h4>Setting up Pact using Karma</h4><p>Install the following packages:</p><pre>npm install --save-dev @pact-foundation/karma-pact @pact-foundation/pact-node @pact-foundation/pact-web</pre><blockquote>At this time there is still an issue with the @pact-foundation/karma-pact plugin not working with Karma 4, so we need to lower the Karma version to ^3.1.4 in the package.json file.</blockquote><p>Edit the karma.conf.js file in the root of the Angular project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ab8c46e134c84285ce5663532fcc1f2/href">https://medium.com/media/1ab8c46e134c84285ce5663532fcc1f2/href</a></iframe><p>The important things to note about pact :</p><ul><li>the used specification version</li><li>which port the Pact mock service will be running</li><li>where the contracts will be written. Since we will not be using a Pact broker for this guide, we will use a shared directory in the root folder to share contract between Consumers and Providers.</li></ul><p>Also note the proxies part that makes sure our calls get proxied to the Pact mock server.</p><p>Now run ng test/npm run test / yarn test to start the Karma testrunner. It will start the Pact mock server:</p><pre>INFO: pact-node@10.2.2/9882 on hades.local: <br>    Creating Pact Server with options: <br>    {&quot;cors&quot;:true,&quot;spec&quot;:3,&quot;port&quot;:1234,&quot;log&quot;:&quot;&lt;logdir&gt;&quot;,&quot;dir&quot;:&quot;&lt;pactdir&gt;&quot;,&quot;pactFileWriteMode&quot;:&quot;overwrite&quot;,&quot;ssl&quot;:false,&quot;host&quot;:&quot;localhost&quot;}<br>INFO [pact]: Pact Mock Server running on port: 1234</pre><p>Since we don’t have any Contract tests yet this is all Pact will do for now</p><h4>Adding Consumer Contract Test</h4><p>To integrate closely with Angular we will write our Contract tests next to the service. To separate it from unit tests we will call it user.service.pact.spec.ts</p><p>To write our contract test we first need to setup the Pact framework. To use Pact with Karma we need to use PactWeb instead of the Pact Node.js library. In the beforeAll we add a new PactWeb configuration for this service:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81150be3fa5cc9f23c5ed1fb8b650bd0/href">https://medium.com/media/81150be3fa5cc9f23c5ed1fb8b650bd0/href</a></iframe><p>This configuration determines which Consumer/Provider pair is contract tested. The port number is for the port on which the Pact mock server should be available.</p><p>We will use Angular TestBed to setup our service for testing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2df9b79e2330f96fb44fa8673b854dcc/href">https://medium.com/media/2df9b79e2330f96fb44fa8673b854dcc/href</a></iframe><p>Next are the callbacks for verifying the mock service and writing the contract file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf5b6106cb4bbfe834548079d851fc5e/href">https://medium.com/media/cf5b6106cb4bbfe834548079d851fc5e/href</a></iframe><p>With all this plumbing we can create our first contract test:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bec33ba4f11956dbae5f829d3b4f1d53/href">https://medium.com/media/bec33ba4f11956dbae5f829d3b4f1d53/href</a></iframe><p>In the beforeAll we setup the mock service to accept a GET request on the /api/users/1 path and return an example user we defined above. The test will then call our Angular service and validate the expected response is returned.</p><p>When we now run ng test a contract file is generated in the root pacts folder. If you view this file you can see it contains our definition of the contract as defined by our test code for this Consumer/Provider pair:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d0bcd8d1eeb2f7e1cee9dfd73a78555/href">https://medium.com/media/7d0bcd8d1eeb2f7e1cee9dfd73a78555/href</a></iframe><h4>Setting up Pact using Jest</h4><p>When using Jest instead of Karma there are some setup changes, but the contract tests stay the same. <br>Create a new Angular app from the root dir using ng new angular-jest .<br>Add the same user.service.ts as shown for the Karma framework.</p><p>Then install the following packages:</p><pre>npm install --save-dev @angular-builders/jest @pact-foundation/pact @pact-foundation/pact-node @types/jest jest jest-preset-angular</pre><p>Add the jest.pact.config.js file in the root of the Angular project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8b513103dfc17238d1e25d346fd0772/href">https://medium.com/media/c8b513103dfc17238d1e25d346fd0772/href</a></iframe><p>Things to note in this config are the testUrl param, which makes sure all our calls will be directed to our Pact mock server. Also we have a setupFile that will setup our Jest framework. It’s located in pact/jest/setupJest.ts :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b71da08b0a72c8de9388f8447c12923b/href">https://medium.com/media/b71da08b0a72c8de9388f8447c12923b/href</a></iframe><p>To make sure Jest will work we need to edit the tsconfig.spec.json and add the emitDecoratorMetadata and experimentalDecorators tags. This prevent errors with the jest-preset-angular package as stated <a href="https://github.com/thymikee/jest-preset-angular/issues/288">here</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/431d778bc9d459d5651f92ae21436132/href">https://medium.com/media/431d778bc9d459d5651f92ae21436132/href</a></iframe><p>The final file to edit will be angular.json . Default Angular uses Karma instead of Jest for testing. Find the test part in the json and change it to:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfc632817b06a388b8cce96651b26f0c/href">https://medium.com/media/cfc632817b06a388b8cce96651b26f0c/href</a></iframe><p>Things to note here are the runInBand parameter to make sure Jest will run the Pact tests sequentially instead of parallel.</p><h4>Adding Consumer Contract Test</h4><p>This step is mostly the same as for our Karma setup, with a few minor changes. We will be using the Pact Node.js library instead. First setup the Pact mock server:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/674b38e3fca354623f661f7546d3d21b/href">https://medium.com/media/674b38e3fca354623f661f7546d3d21b/href</a></iframe><p>The other steps are the same as for Karma:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8268b318971d8c33b4373a971a5886f6/href">https://medium.com/media/8268b318971d8c33b4373a971a5886f6/href</a></iframe><p>After this the contract test is exactly the same as in the Karma framework:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bec33ba4f11956dbae5f829d3b4f1d53/href">https://medium.com/media/bec33ba4f11956dbae5f829d3b4f1d53/href</a></iframe><p>Now we can run the contract test using ng test.</p><h3>Creating the Provider</h3><p>Since we now have our Consumers and their contracts we can create the Provider. We will use Spring Boot for that.</p><h4>Setup Spring Boot</h4><p>I used the Spring Initializr <a href="https://start.spring.io/">site</a> to create the base for the Provider. Create a Maven project using Java. Fill in the required fields and then extract it to the providers/spring-boot folder.</p><p>You can run the backend service using mvn clean spring-boot:run</p><h4>Adding User Service</h4><p>We will add a new RestController to handle our request for the User Service:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/862b12a6cf215a9fb40f3aa319c986ed/href">https://medium.com/media/862b12a6cf215a9fb40f3aa319c986ed/href</a></iframe><p>We also will need a model for User:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c824746d22d94be10fdec9f5f23460e/href">https://medium.com/media/3c824746d22d94be10fdec9f5f23460e/href</a></iframe><h4>Setting up Pact using JUnit 5</h4><p>To setup our contract verification we will use the JUnit 5 Pact extension.<br>First add the following packages to your pom file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/465f3571a7ec244de4058b2eee91a1ab/href">https://medium.com/media/465f3571a7ec244de4058b2eee91a1ab/href</a></iframe><p>To make use of our contracts in the root folder we include them in our testResources so we can acces them from the Java classpath:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12faf4c5fd880e35f31c474508a6e624/href">https://medium.com/media/12faf4c5fd880e35f31c474508a6e624/href</a></iframe><p>Setting up the contract verification is now very simple:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/97e40eff8e4bb7c7b4dadaa4f67d1fed/href">https://medium.com/media/97e40eff8e4bb7c7b4dadaa4f67d1fed/href</a></iframe><p>Things to note:</p><ul><li>@Provider annotation refers to the Provider name, it has to match the Provider name used in the Consumer test. It will only test contracts that match the Provider name.</li><li>@PactFolder refers to the folder the test can find the contracts.</li><li>The start will start our Spring Boot application.</li><li>In the before method we point Pact to the correct base url where the Provider is available.</li><li>The @State annotation provides a method to setup our backend to reach that state. In our case we don’t need do to anything.</li><li>Finally in the pactVerificationTestTemplate method the contracts are verified.</li></ul><h3>Afterthoughts</h3><p>In this guide we created an Angular frontend and Spring Boot backend. We then proceeded to create a contract from the Angular frontend and verified that it abides the contract. We then verified the contract for the Spring boot backend.</p><p>In this guide we haven’t looked at <a href="https://spring.io/projects/spring-cloud-contract">Spring Cloud Contract</a>, which is another framework to setup contract testing for Spring Boot applications. But it is not mutually exclusive since Spring Cloud Contract can <a href="https://cloud.spring.io/spring-cloud-contract/2.0.x/single/spring-cloud-contract.html#pact-converter">convert</a> contracts to Pact versions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c84caac4040" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed load testing with Gatling using Docker and AWS]]></title>
            <link>https://rhendricksen.medium.com/distributed-load-testing-with-gatling-using-docker-and-aws-d497605692db?source=rss-259b947948bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d497605692db</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[performance-testing]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[gatling]]></category>
            <dc:creator><![CDATA[Richard Hendricksen]]></dc:creator>
            <pubDate>Mon, 29 Apr 2019 11:54:05 GMT</pubDate>
            <atom:updated>2020-09-25T12:08:53.093Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j97h4U92uai30iSJALG43w.png" /></figure><h4>Update:</h4><p>I have published a part 2 of this article, containing a lot of improvements over my initial setup. You can read it here:</p><p><a href="https://medium.com/@richard.hendricksen/distributed-load-testing-with-gatling-using-docker-and-aws-part-2-5a6df57128aa">Distributed load testing with Gatling using Docker and AWS — Part 2</a></p><p>Before our release to production we needed to perform a load test with more than 170.000 concurrent users. Since we already had experience running performance tests with <a href="https://gatling.io/">Gatling</a>, it was our goto choice for setting up our load tests. If you are not familiar yet with Gatling, it’s an open source load- and performance test framework with tests written in Scala. It’s very powerful and has excellent reporting.</p><p>The challenge was how to reach our desired number of concurrent users. Since it’s not possible to achieve so much load with only one machine, I knew we needed a distributed solution. Gatling offers their own distributed solution <a href="https://gatling.io/gatling-frontline/">Gatling Frontline</a>, but I figured it wouldn’t be much harder to create my own solution. This would give me more control over the final solution (and costs). Since running multiple Gatling instances will result in multiple simulation.log files, they need to be aggregated into one report. Luckily Gatling has a solution for just <a href="https://gatling.io/docs/3.0/cookbook/scaling_out/">this</a>.</p><p>Since we already are using AWS for our target application, it was an easy choice for the cloud provider for the load test. And because I wanted something that was easy to automate, scale and reuse, Docker became the preferred choice. On AWS we will use <a href="https://aws.amazon.com/ecr/">ECR</a> and <a href="https://aws.amazon.com/ecs/">ECS</a> for this. For collecting the multiple simulation.log files we will use <a href="https://aws.amazon.com/s3/">S3</a>.</p><p>Now we all need to assemble it together step by step.</p><p><strong>Step 1. Gatling Maven project</strong></p><p>I will not go into detail how to setup a Gatling Maven project. Gatling has excellent <a href="https://gatling.io/docs/3.1/extensions/maven_plugin/">documentation</a> about this. You can find an example project I created here:</p><p><a href="https://github.com/richardhendricksen/gatling-docker-on-aws/tree/v1">richardhendricksen/gatling-docker-on-aws</a></p><p>All the gists used in this guide come from this project.<br>For this guide I will use a simplified example. This will be our simulation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8524d689e61994b88ea0974a3a60501/href">https://medium.com/media/b8524d689e61994b88ea0974a3a60501/href</a></iframe><p>In this simulation you can use environment variables to override default values. You will see why this is convenient later.</p><p>Together with the pom.xml file we have our basic Gatling Maven project:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c8c57d5d427cb29037d76074ef7fff7/href">https://medium.com/media/3c8c57d5d427cb29037d76074ef7fff7/href</a></iframe><p>We can now run our Gatling Maven project with:<br>mvn clean gatling:test</p><p><strong>Step 2. Creating Docker image</strong></p><p>Our Docker image will need to do the following things:</p><ul><li>Contain the Gatling testcode</li><li>Being able to execute the test using Maven</li><li>Have all the needed dependencies included (when running the tests I don’t want every container downloading all dependencies on it’s own)</li><li>Upload the result to S3</li></ul><p>This will be the Dockerfile:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06b1c87f20b7ba7054d24a251ff908b8/href">https://medium.com/media/06b1c87f20b7ba7054d24a251ff908b8/href</a></iframe><p>The entrypoint for the image is run.sh. This script executes the test and uploads the result to a S3 bucket. The bucket needs to be supplied as an argument:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40a86f93758138e48d1c049222175ed5/href">https://medium.com/media/40a86f93758138e48d1c049222175ed5/href</a></iframe><p>We can now create our Docker image:</p><p>docker build -t gatling-runner .</p><p>And run it!<br>Since the script will try to upload the results to a S3 bucket, we need to make sure our AWS credentials are known in the Docker image. When running on ECS the IAM role will solve this, but when running on our local Docker we will need to provide the correct AWS credentials. You can also provide the AWS profile if needed:</p><p>docker run --rm -v ${HOME}/.aws/credentials:/root/.aws/credentials:ro gatling-runner -r &lt;s3_bucket&gt; [-p &lt;aws_profile&gt;]</p><p><strong>Step 3. Pushing Docker image to Amazon ECR</strong></p><p>To be able to run our image on ECS, we first need to upload it to a Docker registry. Since we are using AWS, we will use <a href="https://aws.amazon.com/ecr/">ECR</a> for this.</p><p>First open your AWS management console, go to ECR and create a new repository. I’ve called mine gatling-runner . Remember the repository URI, we will need it later.</p><p>Now log in with your local docker to this repository:</p><p>$(aws ecr get-login --no-include-email)</p><p>Tag your local image and push it to your ECR repository. The URI will look something like this, depending on your region: &lt;aws_account_id&gt;.dkr.ecr.eu-west-west-1.amazonaws.com/gatling-runner</p><pre>docker tag gatling-runner &lt;ecs_repo_uri&gt;<br>docker push &lt;ecs_repo_uri&gt;</pre><p>Afterwards you can logout from the ECS repository:</p><p>docker logout &lt;ecs_repo_uri&gt;</p><p>If you now visit the <a href="https://eu-west-1.console.aws.amazon.com/ecr/repositories/">ECR repository</a> you will see the pushed image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYvl70HpAJlaWGFlqx8pbg.png" /><figcaption>gatling-runner image</figcaption></figure><p><strong>Step 4. Running Docker container on ECS</strong></p><p>Amazon ECS is Amazon’s version of Kubernetes/Docker Swarm. The most important part is that we can run Docker containers here. It is tightly integrated other AWS services, and this is exactly what we are going to make use of.</p><p>Since we now have our Docker image available in ECR, we can now create our cluster to run the image on.</p><p>There are 2 options when running containers on ECS: EC2 or Fargate. When using EC2 you have to deploy and manage your own cluster of EC2 instances for running containers. When using Fargate you can run containers directly without using EC2 instances. Both options are valid and will work with this setup. Both have pros and cons which I will not discuss here. For the sake of simplicity I will use the Fargate setup in this guide.</p><p>To create the cluster we will need the Amazon ECS CLI tools. You can find them <a href="https://github.com/aws/amazon-ecs-cli">here</a>. Make sure you have them installed and configured with your AWS account.</p><p>Now configure the ECS Fargate cluster:</p><p>ecs-cli configure --cluster gatlingCluster --region eu-west-1 --default-launch-type FARGATE --config-name gatlingConfiguration</p><p>Now start the cluster:</p><p>ecs-cli up</p><p>While creating all the necessary components for the cluster, take note of the created subnets, we will need those later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsiXu8KQCzpwoaACwYRXNQ.png" /></figure><p>After some waiting you will now have a cluster to run Docker containers on!<br>You can view it in the management console <a href="https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/clusters">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VCuxm2LGPwnLG9ySJ_rOYg.png" /></figure><p>For running our Docker container on the cluster we will use a docker-compose file. Here we can use the environment variables to control our test parameters, without recreating our docker image! The docker-compose file also provides logging in AWS.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a0d91a734342e3ef82b0613e06a33b8/href">https://medium.com/media/4a0d91a734342e3ef82b0613e06a33b8/href</a></iframe><p>To be able to run a container on a Fargate cluster we will need to provide some additional information in a so called ecs_params.yml file. Make sure that the IAM role inserted for task_role_arn should have the correct rights for writing to the S3 bucket. Don’t forget this if you want reporting!<br>Those created subnets I told you to take note of? Insert them here. <br>Also insert the security group, the default one for the VPC of the cluster will do.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e08a6b2f6dfbdd51c93de11ccc0e5e70/href">https://medium.com/media/e08a6b2f6dfbdd51c93de11ccc0e5e70/href</a></iframe><p>You can play around with these settings to find an optimal combination that works for you. Change mem_limit and cpu_limit if you experience memory issues/slow tests.</p><p>We can now run a single container of our test. --create-log-groups will prevent an error if you haven’t created the log groups yet.</p><p>ecs-cli compose up --create-log-groups</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYvFVU3LBkOSOMD4CFZxMQ.png" /></figure><p>You can use the container id to see some logging:</p><p>ecs-cli logs --task-id &lt;container_id&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xIHn0BYiL4XssNGMZnrHA.png" /></figure><p>Nice, it worked! If you check the S3 bucket you will now find the simulation.log in the logs folder.</p><p>To scale our load test, we can change 2 things:</p><ul><li>the number of concurrent users per container</li><li>the number of containers</li></ul><p>We can adjust the former by changing the environment variable in the docker-compose file. We can change the latter by using the scale option:</p><p>ecs-cli compose scale 2</p><p>Now our load test is executed in 2 containers, resulting in doubling the amount of concurrent users.</p><p>The best combination of concurrent users per container and the number of containers will be different for every test. Experiment with this to find the optimal solution.</p><p><strong>Step 5. Generating HTML report</strong></p><p>Since we now have a collection of simulation.log files in our S3 bucket, the next step is to generate a Gatling HTML report from these files.<br>Our Maven project configuration we created earlier has a special configuration for this, which we will use now. The only part left is getting those log files from S3:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8069a7c7849d643bfb90de10b809b13/href">https://medium.com/media/a8069a7c7849d643bfb90de10b809b13/href</a></iframe><p>This script downloads the simulation.log files from S3, then calls the Maven configuration which generates the HTML report, and finally uploads the report back to the S3 bucket in the gatling folder. The last part is of course optional, but a good way to access the final report.</p><p>./consolidate_reports -r &lt;bucket_name&gt; [-p &lt;aws_profile&gt;]</p><p>The script expects the S3 bucket where the log files are located. You can optionally provide an AWS profile.</p><p><strong>Step 6. Cleanup</strong></p><p>When we are done with load testing, we can clean it all up with one simple command:</p><p>ecs-cli down --force</p><p>This command will cleanup the created cluster and all generated components.</p><p><strong>Afterthoughts</strong></p><p>I am quite happy with my current setup, but there are of course always improvements to be made. I’d like to explore the possibilities of using spot EC2 instances in combination with the cluster to lower the costs even further. Also the whole process should be scripted into a Jenkins build, so I can automate the whole process even further, integrating it in our CI/CD pipeline.</p><p>This guide was inspired by:<br><a href="https://medium.com/de-bijenkorf-techblog/https-medium-com-annashepeleva-distributed-load-testing-with-gatling-and-kubernetes-93ebce26edbe">Distributed load testing with Gatling and Kubernetes</a><br><a href="https://github.com/electronicarts/gatling-aws-maven-plugin">Gatling AWS Maven Plugin</a><br><a href="https://github.com/nearmap/gatling-on-ecs">Gatling on ECS</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d497605692db" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>