frain-dev / immune Goto Github PK
View Code? Open in Web Editor NEWEnd-to-End Testing tool for frain-dev/convoy
License: Mozilla Public License 2.0
End-to-End Testing tool for frain-dev/convoy
License: Mozilla Public License 2.0
Immune should be able to generate reports, somewhat like what vegeta does.
Allow error bubbling via an Error method in the signal type
Allow authentication configuration, so we can test against authenticated APIs
After long discussions with the team, we have decided to implement isolation of test cases in the following way:
"test_cases": [
{
"setup": [
"setup_group",
"setup_app",
"setup_app_endpoint",
],
"http_method": "POST",
"endpoint": "/events?groupID={group_id}",
"callback": {
"enabled": true,
"times": 2
},
"request_body": {
"app_id": "{app_id}",
"event_type": "payment.failed",
"data": {
"sc": "gene",
"marvel": "stark"
}
},
"response_body": true,
}
]
Where the setup array references the names of the setup funcs to be run before this test case is run
After each test case finishes the db is truncated.
The way it works now, consecutive test cases that require callbacks may spill over. For instance, if a test case specifies 1 callback but 2 come through for it, the next test case to require a callback will first of all drain the excess callback from the channel. This corrupts the system & makes its integrity false.
Ways to solve this may include:
I will give this some thought before trying to solve it.
Immune callbacks should validate webhook events. It means when a callback receives an event. It should:
A success in step 2 indicates a successful test else a failure.
This feature is essential for verifying that Convoy is signing the payload properly, and bugs like this don't repeat themselves.
The test cases should register a channel with the callback server with its callback id in this manner:
cs := callback.NewServer()
cs.RegisterCallbackChannel(uid string, ch chan struct{})
The cs.RegisterCallbackChannel method should look like this:
func (s *Server) RegisterCallbackChannel(uid string, ch chan struct{}) {
s.chanMap[uid] = ch
}
And when a callback is received the uuid should be extracted and the channel gotten from that map, then a struct{}{} sent on it. This allows the callback signalling to be disjointed, and is one step to allowing us run test cases concurrently.
Need to put more work into the context & automatic cancellations
Searching the Request body for variable references should take into consideration array values like:
{
"groups": [
"{group_id}"
]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.