Skip to content

Commit 807c112

Browse files
committed
Update polling
1 parent 833bf17 commit 807c112

4 files changed

Lines changed: 25 additions & 51 deletions

File tree

example/ios/OPSQLiteExample.xcodeproj/project.pbxproj

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,10 @@
210210
inputFileListPaths = (
211211
"${PODS_ROOT}/Target Support Files/Pods-OPSQLiteExample/Pods-OPSQLiteExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
212212
);
213-
inputPaths = (
214-
);
215213
name = "[CP] Embed Pods Frameworks";
216214
outputFileListPaths = (
217215
"${PODS_ROOT}/Target Support Files/Pods-OPSQLiteExample/Pods-OPSQLiteExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
218216
);
219-
outputPaths = (
220-
);
221217
runOnlyForDeploymentPostprocessing = 0;
222218
shellPath = /bin/sh;
223219
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-OPSQLiteExample/Pods-OPSQLiteExample-frameworks.sh\"\n";
@@ -253,14 +249,10 @@
253249
inputFileListPaths = (
254250
"${PODS_ROOT}/Target Support Files/Pods-OPSQLiteExample/Pods-OPSQLiteExample-resources-${CONFIGURATION}-input-files.xcfilelist",
255251
);
256-
inputPaths = (
257-
);
258252
name = "[CP] Copy Pods Resources";
259253
outputFileListPaths = (
260254
"${PODS_ROOT}/Target Support Files/Pods-OPSQLiteExample/Pods-OPSQLiteExample-resources-${CONFIGURATION}-output-files.xcfilelist",
261255
);
262-
outputPaths = (
263-
);
264256
runOnlyForDeploymentPostprocessing = 0;
265257
shellPath = /bin/sh;
266258
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-OPSQLiteExample/Pods-OPSQLiteExample-resources.sh\"\n";
@@ -442,7 +434,10 @@
442434
);
443435
MTL_ENABLE_DEBUG_INFO = YES;
444436
ONLY_ACTIVE_ARCH = YES;
445-
OTHER_CFLAGS = "$(inherited) ";
437+
OTHER_CFLAGS = (
438+
"$(inherited)",
439+
" ",
440+
);
446441
OTHER_CPLUSPLUSFLAGS = (
447442
"$(OTHER_CFLAGS)",
448443
"-DFOLLY_NO_CONFIG",
@@ -529,7 +524,10 @@
529524
"\"$(inherited)\"",
530525
);
531526
MTL_ENABLE_DEBUG_INFO = NO;
532-
OTHER_CFLAGS = "$(inherited) ";
527+
OTHER_CFLAGS = (
528+
"$(inherited)",
529+
" ",
530+
);
533531
OTHER_CPLUSPLUSFLAGS = (
534532
"$(OTHER_CFLAGS)",
535533
"-DFOLLY_NO_CONFIG",

example/ios/Podfile.lock

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ PODS:
12841284
- React-RCTFBReactNativeSpec
12851285
- ReactCommon/turbomodule/core
12861286
- ReactNativeDependencies
1287-
- react-native-http-bridge-refurbished (1.3.2):
1287+
- react-native-http-bridge-refurbished (1.2.9):
12881288
- GCDWebServer
12891289
- React
12901290
- react-native-restart (0.0.27):
@@ -1638,28 +1638,6 @@ PODS:
16381638
- React-utils (= 0.81.0)
16391639
- ReactNativeDependencies
16401640
- ReactNativeDependencies (0.81.0)
1641-
- RNShare (12.2.0):
1642-
- hermes-engine
1643-
- RCTRequired
1644-
- RCTTypeSafety
1645-
- React-Core
1646-
- React-Core-prebuilt
1647-
- React-debug
1648-
- React-Fabric
1649-
- React-featureflags
1650-
- React-graphics
1651-
- React-ImageManager
1652-
- React-jsi
1653-
- React-NativeModulesApple
1654-
- React-RCTFabric
1655-
- React-renderercss
1656-
- React-rendererdebug
1657-
- React-utils
1658-
- ReactCodegen
1659-
- ReactCommon/turbomodule/bridging
1660-
- ReactCommon/turbomodule/core
1661-
- ReactNativeDependencies
1662-
- Yoga
16631641
- Yoga (0.0.0)
16641642

16651643
DEPENDENCIES:
@@ -1733,7 +1711,6 @@ DEPENDENCIES:
17331711
- ReactCodegen (from `build/generated/ios`)
17341712
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
17351713
- ReactNativeDependencies (from `../node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec`)
1736-
- RNShare (from `../node_modules/react-native-share`)
17371714
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
17381715

17391716
SPEC REPOS:
@@ -1880,8 +1857,6 @@ EXTERNAL SOURCES:
18801857
:path: "../node_modules/react-native/ReactCommon"
18811858
ReactNativeDependencies:
18821859
:podspec: "../node_modules/react-native/third-party-podspecs/ReactNativeDependencies.podspec"
1883-
RNShare:
1884-
:path: "../node_modules/react-native-share"
18851860
Yoga:
18861861
:path: "../node_modules/react-native/ReactCommon/yoga"
18871862

@@ -1923,7 +1898,7 @@ SPEC CHECKSUMS:
19231898
React-logger: f044501f6f1e2d803ac5768ca2a9198f5fa55df2
19241899
React-Mapbuffer: 79ba3ee7405add8758e3c6d2df9d8e5deb5546ee
19251900
React-microtasksnativemodule: d7f49e916033c30e1f64bb6b91e5db6c619df220
1926-
react-native-http-bridge-refurbished: 6ca3d9e2a32f9f9107de554ff0de4e102f3f99de
1901+
react-native-http-bridge-refurbished: 1bd13b32a8e62abe61bab809c26e2dcf21256ed7
19271902
react-native-restart: 0bc732f4461709022a742bb29bcccf6bbc5b4863
19281903
React-NativeModulesApple: a93cccc5bd37290cf1e2f40cb32718e74df6e8b5
19291904
React-oscompat: eef0d02e3175b37e2c0eb99f69df82ea2f85f943
@@ -1956,9 +1931,8 @@ SPEC CHECKSUMS:
19561931
ReactCodegen: 01b282718505566651f65cbf92b139aca408f4e0
19571932
ReactCommon: 18f3e0fba262b222b8d3247e38f9ec9b36817b9c
19581933
ReactNativeDependencies: 4ddce14a45bb6fc7c36f2b50b65a6da87ec6835c
1959-
RNShare: 446a4a16e416c9daf64d381ed9196c3d972e71db
19601934
Yoga: 355cfee956cde5ae34c4e0cd752ec7096d665f7b
19611935

1962-
PODFILE CHECKSUM: 112148d3e8017b4453140f668e6e99073f86b783
1936+
PODFILE CHECKSUM: 6122e992682f69c8f83936c61b0197d2e91e6cee
19631937

19641938
COCOAPODS: 1.15.2

example/src/App.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
import {useEffect, useState} from 'react';
22
import {
3-
setServerError,
3+
// setServerError,
44
setServerResults,
55
startServer,
66
stopServer,
77
} from './server';
8-
import {displayResults, runTests} from '@op-engineering/op-test';
8+
import {
9+
displayResults,
10+
runTests,
11+
allTestsPassed,
12+
} from '@op-engineering/op-test';
913
import './tests'; // import all tests to register them
1014

1115
export default function App() {
1216
const [results, setResults] = useState<any>(null);
1317
useEffect(() => {
1418
runTests()
1519
.then(newResults => {
16-
console.log(newResults);
17-
setServerResults(newResults as any);
20+
setServerResults(allTestsPassed(newResults as any));
1821
setResults(newResults);
1922
})
20-
.catch(e => {
21-
setServerError(e);
23+
.catch(_ => {
24+
setServerResults(false);
2225
});
2326

2427
startServer();

scripts/poll-in-app-server.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@ const http = require('http');
22

33
async function pollInAppServer() {
44
const startTime = Date.now();
5-
const maxDuration = 5 * 60 * 1000; // 5 minutes
5+
const maxDuration = 1 * 60 * 1000; // 5 minutes
66
const pollInterval = 1000; // 1 second
77

88
while (Date.now() - startTime < maxDuration) {
99
try {
10+
console.log('Polling in-app server for results...');
1011
const response = await makeHttpRequest('http://127.0.0.1:9000/results');
1112

1213
if (response !== null) {
1314
let parsedResponse = JSON.parse(response);
1415

15-
if (response.passed === true) {
16-
console.log(
17-
`🟢🟢🟢🟢🟢 ${parsedResponse.results.length} tests passed!`
18-
);
16+
if (parsedResponse.passed === true) {
17+
console.log(`🟢🟢🟢🟢🟢 tests passed!`);
1918
process.exit(0);
2019
}
21-
if (response.passed === false) {
20+
if (parsedResponse.passed === false) {
2221
console.log('🟥🟥🟥🟥🟥 Some tests failed');
2322
process.exit(1);
2423
}

0 commit comments

Comments
 (0)