Open madhugod opened 6 months ago
Very odd, looks like the dependencies are not being discovered as expected. Will try to repro here!
Did some tests again this morning and I believe this has to do with the fact that the yamls are stored in subfolders.
If I move the yml and js file to the root, I can see all files being bundled.
Test bundle contents:
┌─────────────────────┬─────────┬───────┐
│ Name │ Type │ Notes │
├─────────────────────┼─────────┼───────┤
│ login.yml │ file │ │
├─────────────────────┼─────────┤ │
│ functions.js │ file │ │
├─────────────────────┼─────────┤ │
│ package.json │ file │ │
├─────────────────────┼─────────┤ │
│ package-lock.json │ file │ │
├─────────────────────┼─────────┼───────┤
│ @types/artillery │ package │ │
├─────────────────────┼─────────┼───────┤
│ @types/bcrypt │ package │ │
├─────────────────────┼─────────┼───────┤
│ @types/jsonwebtoken │ package │ │
├─────────────────────┼─────────┼───────┤
│ @types/node │ package │ │
├─────────────────────┼─────────┼───────┤
│ axios │ package │ │
├─────────────────────┼─────────┼───────┤
│ bcrypt │ package │ │
├─────────────────────┼─────────┼───────┤
│ jsonwebtoken │ package │ │
And everything goes as expected.
Note I had another issue when installing packages (error 401) because my package-lock.json
files references our own internal npm repository, which the workers don't have access too because missing the NPM_TOKEN, not sure if their is a solution for this yet, but in my case I didn't use any private package so I just removed the package-lock file in order to let the workers download from the public npmjs repository.
@madhugod 👋 Glad you got it working.
Could you let me know what was your original folder structure like (and where you were running the test from, relative to that)? I'm interested in trying to reproduce your original issue.
Note I had another issue when installing packages (error 401) because my package-lock.json files references our own internal npm repository, which the workers don't have access too because missing the NPM_TOKEN, not sure if their is a solution for this yet, but in my case I didn't use any private package so I just removed the package-lock file in order to let the workers download from the public npmjs repository.
We have to document this better, but yes there is a way. It depends what private registry you're using, but it's possible to set some variables that Artillery will pick up to use a private registry. If you end up needing this, let us know!
Hello @bernardobridge
My original folder structure looks like this (minus node_modules folder):
.
├── login
│ ├── full-funnel.yml
│ ├── functions.js
│ └── login.yml
├── package.json
├── package-lock.json
└── players-data
├── bulk.yml
├── functions.js
├── generateTokens.js
├── get.yml
├── patch-inventory.yml
├── sample-inventory.json
└── tokens.csv
I was running artillery commands at the root, example:
artillery run-fargate login/login.yml --region eu-west-1 --count 2 --record --key XXX
Thanks @madhugod 🙇 ! Can't reproduce it on Mac, so it could be windows-specific. Will try it out on a windows machine when I have a chance.
Version info:
Running this command:
I expected to see this happen:
I expect the test to be ran successfully.
Instead, this happened:
But the console says:
And in the CloudWatch logs I can see the following error:
Files being used:
Note that
bcrypt
package is installed (in both package.json, package-lock.json and node_modules)It is also used (via require keyword) in the function.js file that is referenced in the
processor
field of the login.yml file