@artilleryio/int-core 2.4.0 → 2.5.0-4b6546e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -290,7 +290,8 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
290
290
  const requestParams = _.extend(_.clone(params), {
291
291
  url: maybePrependBase(params.url || params.uri, config), // *NOT* templating here
292
292
  method: method,
293
- timeout: timeout * 1000
293
+ timeout: timeout * 1000,
294
+ uuid: crypto.randomUUID()
294
295
  });
295
296
 
296
297
  if (context._enableCookieJar) {
@@ -562,7 +563,7 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
562
563
  let haveFailedCaptures = false;
563
564
 
564
565
  if (result !== null) {
565
- ee.emit('trace:http:capture', result, uuid);
566
+ ee.emit('trace:http:capture', result, requestParams.uuid);
566
567
  if (
567
568
  Object.keys(result.matches).length > 0 ||
568
569
  Object.keys(result.captures).length > 0
@@ -689,11 +690,10 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
689
690
 
690
691
  requestParams.retry = 0; // disable retries - ignored when using streams
691
692
 
692
- const uuid = crypto.randomUUID();
693
693
  let totalDownloaded = 0;
694
- request(requestParams)
694
+ request(_.omit(requestParams, ['uuid']))
695
695
  .on('request', function (req) {
696
- ee.emit('trace:http:request', requestParams, uuid);
696
+ ee.emit('trace:http:request', requestParams, requestParams.uuid);
697
697
 
698
698
  debugRequests('request start: %s', req.path);
699
699
  ee.emit('counter', 'http.requests', 1);
@@ -702,7 +702,7 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
702
702
  res.on('end', () => {
703
703
  ee.emit('counter', 'http.downloaded_bytes', totalDownloaded);
704
704
  });
705
- ee.emit('trace:http:response', res, uuid);
705
+ ee.emit('trace:http:response', res, requestParams.uuid);
706
706
  self._handleResponse(
707
707
  requestParams,
708
708
  res,
@@ -717,7 +717,7 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
717
717
  totalDownloaded = progress.total;
718
718
  })
719
719
  .on('error', function (err, body, res) {
720
- ee.emit('trace:http:error', err, uuid);
720
+ ee.emit('trace:http:error', err, requestParams.uuid);
721
721
  if (err.name === 'HTTPError') {
722
722
  return;
723
723
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@artilleryio/int-core",
3
- "version": "2.4.0",
3
+ "version": "2.5.0-4b6546e",
4
4
  "main": "./index.js",
5
5
  "license": "MPL-2.0",
6
6
  "dependencies": {
7
- "@artilleryio/int-commons": "2.0.4",
7
+ "@artilleryio/int-commons": "2.1.0-4b6546e",
8
8
  "@artilleryio/sketches-js": "^2.1.1",
9
9
  "agentkeepalive": "^4.1.0",
10
10
  "arrivals": "^2.1.2",
@@ -39,8 +39,8 @@
39
39
  "lint": "eslint --ext \".js,.ts,.tsx\" .",
40
40
  "lint-fix": "npm run lint -- --fix",
41
41
  "test": "npm run test:unit && npm run test:acceptance",
42
- "test:unit": "tap --no-coverage --color --timeout=300 test/core/unit/*.test.js",
43
- "test:acceptance": "bash test/core/run.sh"
42
+ "test:unit": "tap --no-coverage --color --timeout=300 test/unit/*.test.js",
43
+ "test:acceptance": "tap --no-coverage --color --timeout 300 test/acceptance/*.test.js && tap --no-coverage --color --timeout=300 test/acceptance/**/*.test.js"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@hapi/basic": "^6.0.0",