Artillery: Expose jest environment

Created on 26 Apr 2018  路  4Comments  路  Source: artilleryio/artillery

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.

Configuration

You could use the option testEnvironment to configure the to-be-created environment or use an inline comment.

Usage

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);
    });
  });
});

Decisions

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

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

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NivLipetz picture NivLipetz  路  5Comments

CaseyBurnsSv picture CaseyBurnsSv  路  4Comments

SamDecrock picture SamDecrock  路  5Comments

hassy picture hassy  路  4Comments

kennethlynne picture kennethlynne  路  5Comments