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
7.85k stars 500 forks source link

Cannot find module 'artillery-engine-processor' #2570

Open poponuts opened 5 months ago

poponuts commented 5 months ago

Version info:

Artillery: 2.0.7
Node.js:   v19.9.0
OS:        darwin

I have multiple node versions but currently points to v19.9.0

Installed artillery globally too.

Running this command: artillery run hello-world.yml

I expected to see this happen: There shouldn't be any errors

Instead, this happened: I get the error:

WARNING: engine processor specified but module artillery-engine-processor could not be loaded
Error: Cannot find module 'artillery-engine-processor'
Require stack:
- /Users/nnn/.nvm/versions/node/v19.9.0/lib/node_modules/artillery/node_modules/@artilleryio/int-core/lib/runner.js
- /Users/nnn/.nvm/versions/node/v19.9.0/lib/node_modules/artillery/node_modules/@artilleryio/int-core/index.js
- /Users/nnn/.nvm/versions/node/v19.9.0/lib/node_modules/artillery/lib/artillery-global.js
- /Users/nnn/.nvm/versions/node/v19.9.0/lib/node_modules/artillery/lib/platform/local/worker.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
    at Module._load (node:internal/modules/cjs/loader:934:27)
    at Module.require (node:internal/modules/cjs/loader:1157:19)
    at require (node:internal/modules/helpers:119:18)

Files being used:

config:
  target: https://www.artillery.io
  engines:
    playwright: {}
    processor: './tests/load/helloWorld.spec.ts'
scenarios:
  - engine: playwright
    testFunction: 'helloFlow'
import { type Page } from '@playwright/test';
async function helloFlow(page: Page) {
  await page.goto('https://www.artillery.io/');
}
bernardobridge commented 5 months ago

Hello @poponuts 👋

processor should not be under engines, otherwise Artillery will try to use an engine with that name. It should be under the root of config (i.e. config.processor).

poponuts commented 5 months ago

Thanks for swift response. Sorry for the ignorance but I’m a bit confused on this as I just installed artillery globally as per instructions. Then on my project’s root directory, I run artillery via the yaml file.

bernardobridge commented 5 months ago

Thanks for swift response. Sorry for the ignorance but I’m a bit confused on this as I just installed artillery globally as per instructions. Then on my project’s root directory, I run artillery via the yaml file.

No problem @poponuts ! Just to confirm, this is what your YAML file should look like:

config:
  target: https://www.artillery.io
  processor: './tests/load/helloWorld.spec.ts'
  engines:
    playwright: {}

scenarios:
  - engine: playwright
    testFunction: 'helloFlow'

And the .ts processor file you point to:

import { type Page } from '@playwright/test';

export async function helloFlow(page: Page) {
  await page.goto('https://www.artillery.io/');
}

Let me know if that works for you!