Skip to content
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

fix(skytrace): send parsed json body correctly to expect plugin #1955

Conversation

bernardobridge
Copy link
Contributor

Context

The Skytrace Smoke tests have been failing, due to a regression introduced by: 8a3e5c2

In reality, that logic is fine, but Skytrace was sending the body as a string when it should be an object (JSON).

This PR does the following:

  • Checks for contentType using test instead of match instead, so a boolean is returned (rather than null) when there is no match
  • If it's a JSON, parses it to an object, otherwise sends content as is.

Testing

The following commands were used to test this:

(the failing test):

./node_modules/skytrace/bin/run ping TEST_URL/api/load-tests/:uuid \
          -H "X-Auth-Token: API_KEY_HERE" \
          -bp \
          -e "statusCode: 200" \
          -e "contentType: application/json; charset=utf-8" \
          -e "jmespath: report.aggregate.summaries.[\"browser.page.FCP.https://www.artillery.io/docs\"][0].max != null"
./node_modules/skytrace/bin/run ping TEST_URL/api/user/whoami \                                             
          -H "X-Auth-Token: API_KEY_HERE" \
          -bp \
          -e "statusCode: 200" \
          -e "contentType: application/json; charset=utf-8"
./node_modules/skytrace/bin/run http post TEST_URL/api/load-tests/:uuid/note \
          -H "X-Auth-Token: API_KEY_HERE" \
          --json "{text: another note from skytrace}" \
          -e "statusCode: 204"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant