-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: records e2e tests for the apis using keploy cli #1538
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: re-Tick <[email protected]>
Ah, nice. I see that there's no changes to the source code unlike last time. Has keploy's architecture changed since? |
Yes. Now, keploy can be used as CLI and instruments the linux system calls. You can try in MacOS with co-lima and docker cmds. |
eBPF, that's cool! I'll test this out with listmonk in a couple of weeks. Thanks again for the PR. |
recorded new testcases and mocks with readable postgres queries and outputs so, it can be editable. Signed-off-by: re-Tick <[email protected]>
@re-Tick I downloaded the mock files from the PR (please see the tree below) $ tree /tmp/listmonk-test-keploy-cli
/tmp/listmonk-test-keploy-cli
└── keploy
├── testReports
│ ├── report-1.yaml
│ ├── report-2.yaml
│ ├── report-3.yaml
│ └── report-4.yaml
└── test-set-0
├── mocks.yaml
└── tests
├── test-10.yaml
├── test-11.yaml
├── test-1.yaml
├── test-2.yaml
├── test-3.yaml
├── test-4.yaml
├── test-5.yaml
├── test-6.yaml
├── test-7.yaml
├── test-8.yaml
└── test-9.yaml Then ran the test command. Testing
|
Hi @knadh, the CLI requires sudo, which changes the environment variables. To ensure it locates go/bin, we need |
Hi @knadh, we are not able to replicate your Postgres issue. We have tried on both arm64 and amd64 machines with Ubuntu, Debian and Amazon Linux and have followed the following steps: Steps Here all tests pass:
Can you please share more information (maybe the config file) to replicate the issue? |
Sorry, I haven't been able to find the time or bandwidth to look into this, unfortunately ;( I also realise I wouldn't have the bandwidth to maintain the mock files for the tests either. I'll look forward to bumping into a Keploy dev at one of the local meetups, maybe at IndiaFOSS, who could run me through this. |
This PR has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days. |
Hi @knadh! I’m still happy to walk you through the PR or explore collaboration— pinged you on linkedin, let me know when we can connect. :) |
Hi @nehagup, firstly, thanks for your patience! Never got around to figuring this out. Could you please drop me an e-mail at kailash [at] nadh.in? We can schedule a call sometime next week and address this for good. |
Issue Description
Add e2e tests and mocks to test the API endpoints.
ref: #972
Keploy-CLI Integration
Install and setup my forked repo in your machine by following this guide for dev setup. and switch to the
test-keploy-cli
branch.On Linux:
Download the keploy cli binary according to your local architecture. Instructions
Record Cmd
Record the testcases and mocks for the listmonk API using following cmd after initial configuration of listmonk.
And made the API calls from here. example:
This generates the keploy testcase
test-1.yml
in thekeploy/tests
directory along with postgres mocks.Test Cmd
Run the recorded testcases using the test cmd of keploy CLI.
On MacOS:
MacOS users need to install Colima and set an alias for Keploy CLI.
Record cmd:
Start the postgres server:
And edit some of the config.toml.sample fields:
And build the docker image for the listmonk:
docker build -t listmonk .
Now, run the API server and do the curl requests:
keploy record -c "docker run -p 9000:9000 -e TZ=Etc/UTC --network keploy-network --name demo-app --rm listmonk"
Test Cmd:
Stop the postgres server. And run the test cmd: