This repo can be used for volume testing, with more messages than existing unit tests.
- The test starts by opening an inlang project with just one english message.
- It generates additional engish messages, overwriting ./locales/en/common.json.
- It can "mock-translate" those into 37 preconfigured languages using the inlang cli.
- Lint-rule plugins are configured in the project settings but lint reports are not subscribed, unless requested.
- The test uses the i18next message storage plugin.
To allow additional testing on the generated project e.g. with the ide-extension, the test calls pnpm clean
when it starts, but not after it runs.
USAGE:
pnpm test messageCount [translate] [subscribeToMessages] [subscribeToLintReports] [watchMode]
e.g.
pnpm test 300
pnpm test 100 1 1 0
Defaults: translate: 1, subscribeToMessages: 1, subscribeToLintReports: 0, watchMode: 0
This test expects the rpc server from PR #2108 running on localhost:3000 with MOCK_TRANSLATE=true.
# in your opral/monorepo
git checkout 1844-sdk-persistence-of-messages-in-project-direcory
pnpm install
pnpm build
MOCK_TRANSLATE=true pnpm --filter @inlang/server dev
git clone https://github.com/opral/load-test.git
cd load-test
pnpm install
This test is also available under /inlang/source-code/sdk/load-test in the monorepo, using workspace:* dependencies.
pnpm test messageCount [translate] [subscribeToMessages] [subscribeToLintReports] [watchMode]
Called before each test run, does rm -rf ./locales
.
pnpm clean
Passes --inpect-brk to node.
pnpm inspect messageCount [translate] [subscribeToMessages] [subscribeToLintReports] [watchMode]