Skip to content

Commit 4e13239

Browse files
committed
Cleanup
1 parent 7f54c2d commit 4e13239

4 files changed

Lines changed: 18 additions & 20 deletions

File tree

.github/workflows/reassurePerfTests.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,22 @@ jobs:
2424
with:
2525
node-version-file: '.nvmrc'
2626

27-
# - name: Install dependencies
28-
# run: npm install
27+
- name: Install dependencies
28+
run: npm install
2929

30-
# - name: Run Reassure baseline tests
31-
# run: npx reassure --baseline --verbose
30+
- name: Run Reassure baseline tests
31+
run: npx reassure --baseline --verbose
3232

33-
# - name: Checkout PR head SHA
34-
# run: |
35-
# git fetch origin ${{ github.event.pull_request.head.sha }} --no-tags --depth=1
36-
# git switch --force --detach ${{ github.event.pull_request.head.sha }}
37-
38-
# - name: Reinstall dependencies
39-
# run: npm install --force
40-
41-
# - name: Run Reassure delta tests
42-
# run: npx reassure --branch --verbose
43-
- name: Run Reassure tests
33+
- name: Checkout PR head SHA
4434
run: |
45-
npm install --force || (rm -rf node_modules && npm install --force)
46-
npx reassure --baseline --verbose
4735
git fetch origin ${{ github.event.pull_request.head.sha }} --no-tags --depth=1
4836
git switch --force --detach ${{ github.event.pull_request.head.sha }}
49-
npm install --force || (rm -rf node_modules && npm install --force)
50-
npx reassure --branch --verbose
37+
38+
- name: Reinstall dependencies
39+
run: npm install --force
40+
41+
- name: Run Reassure delta tests
42+
run: npx reassure --branch --verbose
5143

5244
- name: Upload Reassure results
5345
uses: actions/upload-artifact@v4

jest-sequencer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const Sequencer = require('@jest/test-sequencer').default;
22

3+
/**
4+
* Makes all unit tests run ordered by their path, reducing flakiness on Reassure.
5+
*/
36
class TestSequencer extends Sequencer {
47
shard(tests, {shardIndex, shardCount}) {
58
const shardSize = Math.ceil(tests.length / shardCount);

lib/Onyx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function init({
7373

7474
OnyxUtils.initStoreValues(keys, initialKeyStates, evictableKeys, fullyMergedSnapshotKeys);
7575

76-
// Initialize all of our keys with data provided then give green light to any pending connections........
76+
// Initialize all of our keys with data provided then give green light to any pending connections
7777
Promise.all([cache.addEvictableKeysToRecentlyAccessedList(OnyxUtils.isCollectionKey, OnyxUtils.getAllKeys), OnyxUtils.initializeWithDefaultKeyStates()]).then(
7878
OnyxUtils.getDeferredInitTask().resolve,
7979
);

lib/OnyxUtils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,9 @@ function updateSnapshots(data: OnyxUpdate[], mergeFn: typeof Onyx.merge): Array<
14501450
return promises;
14511451
}
14521452

1453+
/**
1454+
* Clear internal variables used in this file, useful in test environments.
1455+
*/
14531456
function clearOnyxUtilsInternals() {
14541457
mergeQueue = {};
14551458
mergeQueuePromise = {};

0 commit comments

Comments
 (0)