Hypertest Docs
HyperTestKnowledge Base
  • Quick Set-up
    • Install HyperTest
    • Deploy your application
    • Mirror Traffic
      • Using Kubernetes
      • Using Amazon ECS
      • Using Docker
      • Using Nginx
      • Using Goreplay
        • ElasticBeanStalk Script for Goreplay
      • Using Apache
      • Using IIS
      • Using Istio
      • Using Kong
      • Using HAProxy
      • Others
  • HyperTest Overview
    • Introduction
    • Architecture
  • Detailed Setup Guide
    • Detailed Setup Guide
      • Installation
        • Linux VM
        • Kubernetes Cluster
          • Hardware Requirements
          • Cluster Setup
            • EKS
              • Existing Application Load Balancer
              • Calculate Setup Cost for EKS Cluster
            • GCP
            • AKS
            • Self Managed
              • Microk8s with EKS-D
          • HyperTest Installation
      • Mirror Traffic
      • Configure HyperTest
      • Automate Starting a Test
        • CI Integration
          • GitHub Checks Integration
            • Mandatory checks
          • Gitlab Integration
          • Bitbucket Integration
          • Jenkins Pipeline
            • Jenkins Plugins for PR events
  • Upgrade HyperTest
    • Upgrade HyperTest
      • Linux VM
      • Kubernetes Cluster
  • User Guides
    • Usage Guide
      • Install and Configure HyperTest
        • Install HyperTest
        • Configure Base DNS
        • Add New Service
      • Tests Runs and Analysis
        • View Test Cases
        • Start New Test Run
        • Understand Your Test Run Analysis
        • Prioritize Your Error Types
        • Track Bugs
        • Ignore Errors/Desired Changes
        • View/Download Report
        • View Consolidated Dashboard Reports
        • Sign-off Reports
        • Reduce Execution Time
        • Deduplication Rules
      • Troubleshooting and FAQs
    • Best Practices Guide
      • Cost Optimization
    • Dashboard Tour
      • Dashboard
      • All Sessions
      • Regression Report
      • Notifications
      • First Test Run
      • Interactions
      • Custom Analysis
      • Configuration
    • User Management
      • Create Admin User
      • Roles, Groups & Users
      • Enabling User Signup
    • Other Guides
      • Basic Nginx Auth for Linux HT
  • Middleware
  • Advanced Features
    • Import test cases from Postman
  • Change Log
  • Troubleshooting
  • FAQs
    • Setup
    • General
    • Regression Report
  • Glossary
    • Session
Powered by GitBook
On this page
  • 1. Required Parameters to run Goreplay:
  • 2. Dockerfile Changes:
  • Debug mirroring setup via Goreplay
  1. Quick Set-up
  2. Mirror Traffic

Using Docker

PreviousUsing Amazon ECSNextUsing Nginx

Last updated 1 year ago

Find the video guide for below instructions over .

In this guide, we will be using to mirror the traffic to HyperTest. We will install and start Goreplay in your itself.

Update your application's Dockerfile as per the below example or create a new one

1. Required Parameters to run Goreplay:

  1. application_port: <port on which your app is running>

  2. hypertest_logger_url: <hypertest-vm-ip>:<hypertest-logger-port> or <hypertest_service_logger_ingress_url>

2. Dockerfile Changes:

  1. Comment your CMD or ENTRYPOINT line to start your application

  2. Download goreplay binary and extract it

  3. Start Goreplay

  4. Add your entrypoint command to start your application in the end

Only copy the parts from ## copy from this till ## to this. Rest is just sample Dockerfile.

Dockerfile
FROM node:10-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
ENV HYPER_TEST_BRANCH candidate
EXPOSE 3001
#CMD ["npm", "start"]

## copy from this ##
# add next line only for alpine-based images
RUN apk add --no-cache ca-certificates openssl
RUN wget https://github.com/buger/goreplay/releases/download/v0.16.1/gor_0.16.1_x64.tar.gz -O gor.tar.gz
RUN tar xzf gor.tar.gz
CMD [ "sh", "-c", "./goreplay --input-raw :<application-port> --output-http <hypertest_logger_url> --http-disallow-header "fromhypertest: y" --http-set-header "x-ht-env: <your-env>" & npm start" ]
## to this

Build a new docker image using the modified Dockerfile. Deploy your application using the new image.

To verify the mirroring setup, hit any api on the application and check for request in "last mirrored requests" section or Session page in HyperTest.

Debug mirroring setup via Goreplay

To debug if goreplay is receiving the traffic from your application, we will output the incoming traffic to stdout, so we can see if Goreplay is receiving requests.

Steps:

  1. Exec into the goreplay container using below command:

kubectl exec -it <pod-name> sh

if you are running as a docker container use the below command:

docker exec -it <container-name> sh

2. Run the following command:

./goreplay --input-raw :<application_port> --output-stdout

The goreplay binary will be in your work directory set in Dockerfile.

Now hit any api on your application and verify if Goreplay is able to receive it.

here
Goreplay
Dockerfile