Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoQA] e2e: ignore "missing test" error #39009

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/libs/E2E/reactNativeLaunchingTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ E2EClient.getTestConfig()
return E2EClient.submitTestResults({
name: config.name,
error: `Test '${config.name}' not found`,
critical: false,
});
}

Expand Down
6 changes: 6 additions & 0 deletions src/libs/E2E/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ type TestResult = {
/** Optional, if set indicates that the test run failed and has no valid results. */
error?: string;

/**
* Whether error is critical. If `true`, then server will be stopped and `e2e` tests will fail. Otherwise will simply log a warning.
* Default value is `true`
*/
critical?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe our naming style guide in the App suggests to use:

Suggested change
critical?: boolean;
isCritical?: boolean;


/** Render count */
renderCount?: number;
};
Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ const runTests = async (): Promise<void> => {

// Collect results while tests are being executed
server.addTestResultListener((testResult) => {
if (testResult?.error != null) {
const {critical = true} = testResult;

if (testResult?.error != null && critical) {
throw new Error(`Test '${testResult.name}' failed with error: ${testResult.error}`);
}
if (testResult?.error != null && !critical) {
Logger.warn(`Test '${testResult.name}' failed with error: ${testResult.error}`);
}
let result = 0;

if (testResult?.duration !== undefined) {
Expand Down
Loading