artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.07k stars 512 forks source link

feat(JSONPath-Plus): Use library correctly #3311

Closed Archangelza1 closed 1 month ago

Archangelza1 commented 3 months ago

Description

This updates the JSON parse logic so that it returns what is requested by the user using the JSONpath-plus standard queries

refactors the extractJSONPath function to improve its flexibility and simplify its implementation.

Pre-merge checklist

This is for use by the Artillery team. Please leave this in if you're contributing to Artillery.

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

hassy commented 3 months ago

Thanks for the PR @Archangelza1! We can't merge it as-is as it would break backwards-compatibility, but the new behavior could be introduced via extra configuration.

Archangelza1 commented 3 months ago

@hassy I have made an update to the code to allow backwards compatibility

Archangelza1 commented 2 months ago

@hassy Any update on this PR?

hassy commented 1 month ago

hi @Archangelza1 apologies for the delay on this one. Thanks for making the changes but it doesn't get us there completely:

  1. Current behavior is maintained when multiple is not set, that's good.
  2. Setting multiple to true is now equivalent to current behavior
  3. Setting multiple to false will return all results - this is not very intuitive

Ideally not setting multiple at all should be equivalent to setting multiple = false, and setting multiple to true should add new behavior.

I'll merge this and fix it up in a separate commit.

hassy commented 1 month ago

Failing tests are ones that rely on a secret which is not passed to CI runs from forks. The core test suite is passing.