Skip to content

Latest commit

 

History

History

S3-Keploy

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

S3-Keploy

A simple CRUD application to showcase Keploy integration capabilities using Go-Fiber and S3

Prerequisites

  1. Go
  2. AWS Access Key and Security Key

Running app on Ubuntu 22.04.03 LTS

Setting aws credentials

Go to home directory
Create .aws folder
Inside .aws folder, create credentials name file
Open credentials in any text editor and add following :

[default]
aws_access_key_id = <YOUR_ACCESS_KEY_ID>
aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>

Setting up application

git clone https://github.com/keploy/samples-go && cd S3-Keploy
go mod download

Capture the Testcases

sudo -E env PATH="$PATH" keploy record -c 'go run .' 

Routes

  • /list : GET - Get all buckets name
  • /getallobjects?bucket=<ENTER BUCKET NAME> : GET - Get all objects name
  • /create : POST - Create a new bucket
  • /upload?bucket=<ENTER BUCKET NAME> : POST - Upload a file
  • /delete?bucket=<ENTER BUCKET NAME> : DELETE - Delete a bucket
  • /deleteallobjects?bucket=<ENTER BUCKET NAME> : DELETE - Delete all objects
  • /replacefile?bucket=<ENTER BUCKET NAME> : PUT - Replace already present file

Create a new bucket image

Get all buckets name image

Upload a file image

Replace already present file image

Delete a bucket image

Once done, you can see the Test Cases on the Keploy server, like this:

image

Generate Test Runs

Now that we have our testcase captured, run the test file.

sudo -E env PATH=$PATH keploy test -c "go run ." --delay 20

Once done, you can see the Test Runs on the Keploy server, like this:

image

If you like the sample application, Don't forget to star us ✨