Skip to content

Commit 8195ba6

Browse files
committed
refactor(e2e/artillery):
- moved inline import to top of the file - migrated to jest syntax - export utils from e2e and consumed by artillery - moved artillery as its own package - migrated script commands
1 parent 965c117 commit 8195ba6

35 files changed

+376
-756
lines changed

.env.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ LOG_LEVEL=silent
55
LIVE_MASTER_ACCOUNT=
66
LOCAL_MASTER_ACCOUNT=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
77

8-
NODE_NO_WARNINGS=1
8+
NODE_NO_WARNINGS=1
9+
NODE_OPTIONS=--no-deprecation

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55
"scripts": {
66
"reset": "rimraf dist pnpm-lock.yaml node_modules tmp yarn-error.log yarn.lock package-lock.json learn-debug.log .nx lit-auth-storage pkp-tokens lit-auth-local ./e2e/dist ./e2e/node_modules",
77
"build": "nx run-many --parallel=false --target=build --all --exclude=wrapped-keys,wrapped-keys-lit-actions",
8+
"build:affected": "nx affected --target=build --exclude=wrapped-keys,wrapped-keys-lit-actions",
9+
"test:local": "node ./local-tests/build.mjs && dotenvx run --env-file=.env -- node ./local-tests/build/test.mjs",
810
"gen:local-network-context": "dotenvx run --env-file=.env -- node --conditions=import --import tsx packages/networks/src/networks/vNaga/shared/scripts/generate-abi-signatures.ts",
911
"prettier": "npx nx format:write --all",
1012
"format:check": "npx nx format:check --all",
1113
"test:e2e": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000 -t",
12-
"test:custom": "npx jest --clearCache --config ./jest.e2e.config.ts && LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- jest --runInBand --detectOpenHandles --forceExit --config ./jest.e2e.config.ts --testTimeout=50000000"
14+
"artillery:init": "dotenvx run --env-file=.env -- tsx packages/artillery/src/init.ts",
15+
"artillery:balance-status": "LOG_LEVEL=${LOG_LEVEL:-silent} dotenvx run --env-file=.env -- tsx packages/artillery/src/balance-status.ts",
16+
"artillery:pkp-sign": "DEBUG_HTTP=true LOG_LEVEL=silent dotenvx run --env-file=.env -- sh -c 'artillery run ./packages/artillery/configs/pkp-sign.yml ${ARTILLERY_KEY:+--record --key $ARTILLERY_KEY}'",
17+
"artillery:encrypt-decrypt": "DEBUG_HTTP=true LOG_LEVEL=silent dotenvx run --env-file=.env -- sh -c 'artillery run ./packages/artillery/configs/encrypt-decrypt.yml ${ARTILLERY_KEY:+--record --key $ARTILLERY_KEY}'",
18+
"artillery:execute-js": "DEBUG_HTTP=true LOG_LEVEL=silent dotenvx run --env-file=.env -- sh -c 'artillery run ./packages/artillery/configs/execute.yml ${ARTILLERY_KEY:+--record --key $ARTILLERY_KEY}'",
19+
"artillery:mix": "DEBUG_HTTP=true LOG_LEVEL=silent dotenvx run --env-file=.env -- sh -c 'artillery run ./packages/artillery/configs/mix.yml ${ARTILLERY_KEY:+--record --key $ARTILLERY_KEY}'",
20+
"artillery:sign-session-key": "DEBUG_HTTP=true LOG_LEVEL=silent dotenvx run --env-file=.env -- sh -c 'artillery run ./packages/artillery/configs/sign-session-key.yml ${ARTILLERY_KEY:+--record --key $ARTILLERY_KEY}'"
1321
},
1422
"private": true,
1523
"dependencies": {

packages/e2e/artillery/README.md renamed to packages/artillery/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Standalone Artillery load-testing package for Lit Protocol. Moved from `packages
44

55
Usage via root scripts remains the same, now pointing to `packages/artillery`.
66

7-
# Run Artillery tests
7+
# 🚀 Run Artillery tests
88

99
- LOG_LEVEL= `debug` | `info` | `silent` | `debug2` (raw console.log)
1010
- NETWORK= `naga-dev` | `naga-staging`
File renamed without changes.

packages/artillery/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "@lit-protocol/artillery",
3+
"version": "0.0.1",
4+
"private": true,
5+
"type": "module",
6+
"dependencies": {
7+
"artillery": "^2.0.23",
8+
"@lit-protocol/e2e": "workspace:*"
9+
}
10+
}

packages/artillery/project.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "artillery",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "library",
5+
"sourceRoot": "packages/artillery/src",
6+
"targets": {
7+
"init": {
8+
"executor": "nx:run-commands",
9+
"options": {
10+
"command": "tsx packages/artillery/src/init.ts"
11+
}
12+
},
13+
"balance-status": {
14+
"executor": "nx:run-commands",
15+
"options": {
16+
"command": "tsx packages/artillery/src/balance-status.ts"
17+
}
18+
},
19+
"run:pkp-sign": {
20+
"executor": "nx:run-commands",
21+
"options": {
22+
"command": "artillery run packages/artillery/configs/pkp-sign.yml"
23+
}
24+
},
25+
"run:encrypt-decrypt": {
26+
"executor": "nx:run-commands",
27+
"options": {
28+
"command": "artillery run packages/artillery/configs/encrypt-decrypt.yml"
29+
}
30+
},
31+
"run:execute": {
32+
"executor": "nx:run-commands",
33+
"options": {
34+
"command": "artillery run packages/artillery/configs/execute.yml"
35+
}
36+
},
37+
"run:mix": {
38+
"executor": "nx:run-commands",
39+
"options": {
40+
"command": "artillery run packages/artillery/configs/mix.yml"
41+
}
42+
},
43+
"run:sign-session-key": {
44+
"executor": "nx:run-commands",
45+
"options": {
46+
"command": "artillery run packages/artillery/configs/sign-session-key.yml"
47+
}
48+
}
49+
},
50+
"tags": []
51+
}
52+
53+

0 commit comments

Comments
 (0)