Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fac2451
Increase the Node.js memory limit in workflow && test command
PiyushChandra17 Oct 30, 2025
5d470f1
Fix typo in test command
PiyushChandra17 Oct 30, 2025
507d191
Merge branch 'Expensify:main' into fix/73197
PiyushChandra17 Oct 30, 2025
f604900
update preDeploy.yml
PiyushChandra17 Oct 30, 2025
15ad621
Increase the memory limit in test.yml
PiyushChandra17 Oct 30, 2025
460022a
Merge branch 'Expensify:main' into fix/73197
PiyushChandra17 Oct 31, 2025
e57e1b4
update test.yml
PiyushChandra17 Oct 31, 2025
9d1c1f5
Merge branch 'Expensify:main' into fix/73197
PiyushChandra17 Nov 1, 2025
aa244bd
Set the memory limit to 4096
PiyushChandra17 Nov 1, 2025
ef072d2
Update the memory limit to 6144
PiyushChandra17 Nov 1, 2025
9d145dc
set limit in env
PiyushChandra17 Nov 1, 2025
10b0ed1
Merge branch 'Expensify:main' into fix/73197
PiyushChandra17 Nov 4, 2025
242ff51
Modified test.yml
PiyushChandra17 Nov 4, 2025
2abb677
remove single quote from test command in package.json
PiyushChandra17 Nov 4, 2025
b3a4fdb
Increase the memory limit to 12288 in package.json
PiyushChandra17 Nov 4, 2025
2d3ebc1
Bump limit to 4096
PiyushChandra17 Nov 4, 2025
2630134
set --maxWorkers=50% in test.yml
PiyushChandra17 Nov 4, 2025
5c6a860
Merge branch 'Expensify:main' into fix/73197
PiyushChandra17 Nov 5, 2025
ec5981a
set --maxWorkers flag to 2 in test.yml
PiyushChandra17 Nov 5, 2025
9043f08
set --maxWorkers to 3 in test.yml
PiyushChandra17 Nov 5, 2025
804ffb2
set --maxWorkers to 4 in test.yml
PiyushChandra17 Nov 5, 2025
fc4ba11
Modified errorThrowingMiddleware in RequestTest.ts to always resolve …
PiyushChandra17 Nov 6, 2025
27eee48
Merge branch 'Expensify:main' into fix/73197
PiyushChandra17 Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
key: ${{ runner.os }}-jest

- name: Jest tests
run: NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npm test -- --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --max-workers ${{ steps.cpu-cores.outputs.count }} --coverage --coverageDirectory=coverage/shard-${{ matrix.chunk }}
run: NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npm test -- --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --maxWorkers=4 --coverage --coverageDirectory=coverage/shard-${{ matrix.chunk }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this change needed? isnt steps.cpu-cores.outputs.count better/ safer option so we could use all the cpus available?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mountiny I think some tests were getting failed due to this, thats why we did this change


- name: Upload coverage to Codecov (PRs - tokenless)
if: ${{ github.event_name == 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"ios-hybrid-build": "bundle exec fastlane ios build_unsigned_hybrid",
"android-build": "bundle exec fastlane android build_local",
"android-hybrid-build": "bundle exec fastlane android build_local_hybrid",
"test": "TZ=utc NODE_OPTIONS=--experimental-vm-modules jest",
"test:verbose": "TZ=utc NODE_OPTIONS=--experimental-vm-modules JEST_VERBOSE=true jest",
"test": "TZ=utc NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" jest",
"test:verbose": "TZ=utc NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" JEST_VERBOSE=true jest",
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
Expand Down
20 changes: 9 additions & 11 deletions tests/unit/RequestTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,15 @@ test('Request.addMiddleware() can register two middlewares. They can pass a resp
});

// And another middleware that will throw when it sees this jsonCode
const errorThrowingMiddleware: Middleware = (promise: Promise<void | OnyxTypes.Response>) =>
promise.then(
(response: void | OnyxTypes.Response) =>
new Promise((resolve, reject) => {
if (typeof response === 'object' && response.jsonCode !== 404) {
return;
}

reject(new Error('Oops'));
}),
);
const errorThrowingMiddleware: Middleware = (promise) =>
promise.then((response) => {
if (typeof response === 'object' && response.jsonCode !== 404) {
// Pass the response through to the next middleware
return response;
}
// Reject so the chain receives an error
throw new Error('Oops');
});

Request.addMiddleware(testMiddleware);
Request.addMiddleware(errorThrowingMiddleware);
Expand Down