Hi there,
first of all, thank you for this great tool!
I would be interested in writing a jest environment for artillery, so that it can integrate more easily with jest. I need this as I am writing a mockserver / proxy and I would like to enable it's users to be sure it has certain performance properties.
You could use the option testEnvironment to configure the to-be-created environment or use an inline comment.
I would envision a usage like this:
// Here we would need to do a decision
const config = { target: 'https://artillery.io' };
// OR
const config = "./artillery/config1.yml";
describe("MyService", () => {
describe("Performance", () => {
it("has a limit for latency", async () => {
const testResult = await artillery(config);
expect(testResult).toHaveMaxLatencyLowerThan(1000);
expect(testResult).toHaveMedianLatencyLowerThan(200);
});
});
});
1) Is a jest environment the right tool? We could also think about a test runner that consumes the .yml-files and reads additional fields for max values that lead to a failure
2) Should we use JS objects for configuration or a path to the yml files or both?
Are there any thoughts you have on this? Would love to hear some feedback before I jump into the implementation
I'm not familiar with Jest, so I'm unable to provide feedback on the particulars of the implementation. Maybe someone else with more experience with it can chime in.
I could also just start with a POC and we see how it goes. Just wanted to give you the opportunity to give your view on it.
I started with an empty Typescript project and sketched out the TODOs I would need to tackle: https://github.com/DanielMSchmidt/jest-environment-artillery
Closing due to inactivity, but feel free to reopen if needed.
Most helpful comment
I started with an empty Typescript project and sketched out the TODOs I would need to tackle: https://github.com/DanielMSchmidt/jest-environment-artillery