mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Retry only failed Android E2E flows (#57998)
Summary: Android Maestro E2E jobs currently stop after the first flow that exhausts its in-process retries. The workflow-level retry then starts the whole suite again, including flows that already passed. This changes the retry model so that: - each CI attempt runs every selected flow once and continues after individual failures; - per-flow `passed`, `failed`, and `pending` state is saved atomically after every flow; - cumulative results and attempt counts are shown in the GitHub job summary and uploaded as an artifact; - retry workflows download that state and skip flows that already passed, running only failed or unfinished flows; - a flavor whose downloaded state is already fully passed skips emulator startup and APK installation entirely; - a missing state artifact falls back to running the full suite, so infrastructure failures remain retryable. The Android E2E timeout is increased from 60 to 90 minutes to give the initial all-flows attempt enough time to finish. The existing three workflow attempts now provide up to three executions per failing flow instead of multiplying workflow retries by in-process retries. ### CI follow-ups - RNTester Debug completed all 40 flows with 38 passes and 2 failures. Retry 1 downloaded its state, skipped exactly those 38 passing flows, and executed only the two failures, validating the selective retry behavior. - RNTester Release became unhealthy after an early flow failure and timed out while later flows were still pending. The state file was being written incrementally, but its artifact upload was inside the timed composite action and was killed by the same timeout. Moved state upload into the outer reusable workflow so `if: always()` preserves passed, failed, and pending results after an E2E timeout. - The next Release retry downloaded the preserved state, skipped its 7 prior passes, reran the remaining flows, and recovered to 40/40. A later matrix retry could still start that completed flavor and fail during an unnecessary APK installation, so retry jobs now skip the entire E2E action when downloaded state is fully passed. - Both `test_js` variants failed because the repository Jest preset throws whenever `console.error` is called, and the new failure-path unit test intentionally exercised a production error log. The test now mocks that expected log while continuing to assert the aggregate flow failure. - RNTester Debug consistently failed `image-wide-gamut.yml` with exactly 83.974% screenshot similarity and `legacy-native-module.yml` before the APIs search became visible, while Release passed both immediately. Reproducing Debug with an offline Android emulator showed the actual cause: importing `ImageExample.js` eagerly starts a Facebook image prefetch, and its promise could reject before the Image Loading Events example attached its rejection callback. That produced an `Uncaught (in promise): UnknownHostException` LogBox notification, which covered the screenshot and intercepted the APIs tab. The prefetch now attaches a rejection handler immediately while preserving the existing example-level success/failure reporting. No LogBox dismissal or E2E-specific workaround remains. - The remaining `image-wide-gamut.yml` failure was separate from LogBox: the flow explicitly accepted `P3: error` but then compared against a golden screenshot containing the successfully loaded Display-P3 fixture. The same ICC-profiled WebKit sample is now embedded as a compact data URI, removing the external network dependency, and the flow requires `P3: loaded` before screenshot comparison. ## Changelog: [INTERNAL] [CHANGED] - Retry only failed or unfinished Android Maestro E2E flows. Pull Request resolved: https://github.com/react/react-native/pull/57998 Test Plan: - `git diff --check` (passed) - `node --check .github/workflow-scripts/maestro-android.js` (passed) - `yarn jest .github/workflow-scripts/__tests__/maestro-android-test.js --runInBand --config '{"testEnvironment":"node","transform":{}}'` (passed) - `ruby -ryaml -e "ARGV.each { |file| YAML.parse_file(file) }" .github/actions/maestro-android/action.yml .github/workflows/e2e-android-rntester.yml .github/workflows/e2e-android-templateapp.yml .github/workflows/test-all.yml` (passed) - `yarn prettier --check .github/workflow-scripts/maestro-android.js .github/workflow-scripts/__tests__/maestro-android-test.js .github/actions/maestro-android/action.yml .github/workflows/e2e-android-rntester.yml .github/workflows/e2e-android-templateapp.yml .github/workflows/test-all.yml` (passed) - Verified the retry-state `jq` predicate returns false only when every recorded flow has passed. - `./node_modules/.bin/prettier --check packages/rn-tester/js/examples/Image/ImageExample.js` (passed) - Reproduced on a local Android Debug emulator with external DNS unavailable. Before the fix, `logcat` reported `Uncaught (in promise): UnknownHostException` and LogBox covered the bottom navigation. After the fix, no unhandled rejection or LogBox appeared, the APIs tab displayed `explorer_search`, and the wide-gamut example was unobstructed. - Verified on a local Android Debug emulator with external DNS unavailable that the embedded Display-P3 fixture reaches `P3: loaded` and renders without a network request. - The next Debug run passed the stricter `P3: loaded` gate but still reproduced the exact 83.974% screenshot mismatch, followed by the legacy APIs-search failure. This confirms the embedded Display-P3 fixture is loading and that a second Debug-only UI state remains. The previous action skipped its Maestro-log upload because the emulator wrapper masked the inner script failure, and it pulled `screen.mp4` before stopping the recorder, leaving an unplayable artifact. The runner now captures a PNG, UI hierarchy, logcat, and Metro output when each flow fails, stops `screenrecord` before pulling the MP4, and always uploads the diagnostic bundle. The next run will expose the actual obstructing UI so it can be fixed at its source. - The first diagnostic run exposed a flaw in the new evidence collection itself: Debug remained inside the E2E action far beyond its normal duration because the `uiautomator`/ADB capture commands were unbounded. Every diagnostic subprocess now has a 15-second timeout, so a problem collecting evidence is logged but can never stall later flows or prevent state persistence. - The captured screenshots and hierarchy identified the root cause shared by all remaining Debug failures (including one additional FlatList flow): `StaticViewConfigValidator` reported that `AndroidTextInput.validAttributes.fontVariationSettings` had the wrong value. The object-syntax change in https://github.com/react/react-native/issues/57929 added a JS processor to the static TextInput config, but runtime native view-config reflection still derived plain `true` from the native `String` prop. Debug validation therefore emitted a LogBox; its notifications covered the wide-gamut screenshot and FlatList controls, and its expanded console blocked the legacy APIs tab. Native view-config construction now recognizes `fontVariationSettings` and installs the same processor as the static config. This both makes validation agree and preserves object-to-string normalization when reflected native configs are active. A regression test verifies the reflected attribute matches the static processor and serializes object settings deterministically. - Targeted regression test: `yarn test packages/react-native/Libraries/ReactNative/__tests__/getNativeComponentAttributes-test.js --runInBand` (passed). - Both `test_js` variants then failed at ESLint before running tests because the new regression test lacked the required Flow file annotation and its CommonJS imports were not in repository order. Added `flow strict-local` and reordered the requires; the targeted Jest test and Prettier check remain green. - Final Android validation on `bd55f0aa4226`: the initial RNTester emulators lost ADB after three passing flows, so the outer state artifacts preserved those passes and marked the remaining work for retry. Retry 1 started fresh emulators, skipped the three prior passes, ran the remaining 37 flows, and finished with 40/40 passed in both Debug and Release; retry 2 was skipped. `image-wide-gamut.yml`, `legacy-native-module.yml`, and `flatlist-inverted-recycle-maintainvisible.yml` each passed on their first execution after the view-config fix. All Android checks are green, including Android builds, HelloWorld, TemplateApp E2E, and RNTester E2E. Reviewed By: Abbondanzo Differential Revision: D116463690 Pulled By: cipolleschi fbshipit-source-id: 20f6d04ac8e21cdbb1fd04618cd879df6d413276
This commit is contained in:
1 parent
83d0be8958
commit
4c022bbf7d
10 files changed
+561
-85
No files matched your search
@@ -26,6 +26,10 @@ inputs:
|
||||
required: false
|
||||
default: x86
|
||||
description: The architecture of the emulator to run
|
||||
test-state-path:
|
||||
required: false
|
||||
default: /tmp/maestro-android-state/results.json
|
||||
description: The path used to persist per-flow test results between retries
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
@@ -64,7 +68,7 @@ runs:
|
||||
cores: '4'
|
||||
disable-animations: false
|
||||
avd-name: e2e_emulator
|
||||
script: node .github/workflow-scripts/maestro-android.js ${{ inputs.app-path }} ${{ inputs.app-id }} ${{ inputs.maestro-flow }} ${{ inputs.flavor }} ${{ inputs.working-directory }}
|
||||
script: node .github/workflow-scripts/maestro-android.js ${{ inputs.app-path }} ${{ inputs.app-id }} ${{ inputs.maestro-flow }} ${{ inputs.flavor }} ${{ inputs.working-directory }} ${{ inputs.test-state-path }}
|
||||
- name: Normalize APP_ID
|
||||
id: normalize-app-id
|
||||
shell: bash
|
||||
@@ -82,9 +86,10 @@ runs:
|
||||
report.xml
|
||||
screen.mp4
|
||||
- name: Store Logs
|
||||
if: steps.run-tests.outcome == 'failure'
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.flavor }}-${{ inputs.emulator-arch }}-NewArch
|
||||
overwrite: true
|
||||
if-no-files-found: ignore
|
||||
path: /tmp/MaestroLogs
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
const {
|
||||
collectFlows,
|
||||
executeFlowSuite,
|
||||
loadState,
|
||||
} = require('../maestro-android');
|
||||
|
||||
describe('Maestro Android runner', () => {
|
||||
let temporaryDirectory;
|
||||
|
||||
beforeEach(() => {
|
||||
temporaryDirectory = fs.mkdtempSync(
|
||||
path.join(os.tmpdir(), 'maestro-android-test-'),
|
||||
);
|
||||
jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
fs.rmSync(temporaryDirectory, {recursive: true, force: true});
|
||||
});
|
||||
|
||||
it('collects flows recursively in a stable order', () => {
|
||||
const nestedDirectory = path.join(temporaryDirectory, 'nested');
|
||||
fs.mkdirSync(nestedDirectory);
|
||||
fs.writeFileSync(path.join(temporaryDirectory, 'second.yaml'), 'appId: x');
|
||||
fs.writeFileSync(path.join(temporaryDirectory, 'image.png'), 'not a flow');
|
||||
fs.writeFileSync(path.join(nestedDirectory, 'first.yml'), 'appId: x');
|
||||
|
||||
expect(collectFlows(temporaryDirectory)).toEqual([
|
||||
path.join(nestedDirectory, 'first.yml'),
|
||||
path.join(temporaryDirectory, 'second.yaml'),
|
||||
]);
|
||||
});
|
||||
|
||||
it('runs every flow and retries only flows that have not passed', () => {
|
||||
const flows = ['first.yml', 'second.yml', 'third.yml'].map(file =>
|
||||
path.join(temporaryDirectory, file),
|
||||
);
|
||||
const statePath = path.join(temporaryDirectory, 'state', 'results.json');
|
||||
const firstAttempt = jest.fn(flow => {
|
||||
if (flow.endsWith('second.yml')) {
|
||||
throw new Error('failed assertion');
|
||||
}
|
||||
});
|
||||
|
||||
expect(() =>
|
||||
executeFlowSuite({
|
||||
flows,
|
||||
appId: 'com.example',
|
||||
state: loadState(statePath),
|
||||
statePath,
|
||||
executeFlow: firstAttempt,
|
||||
}),
|
||||
).toThrow('1 Maestro flow(s) failed');
|
||||
expect(firstAttempt).toHaveBeenCalledTimes(3);
|
||||
|
||||
const retry = jest.fn();
|
||||
executeFlowSuite({
|
||||
flows,
|
||||
appId: 'com.example',
|
||||
state: loadState(statePath),
|
||||
statePath,
|
||||
executeFlow: retry,
|
||||
});
|
||||
|
||||
expect(retry).toHaveBeenCalledTimes(1);
|
||||
expect(retry.mock.calls[0][0]).toBe(flows[1]);
|
||||
|
||||
const finalState = loadState(statePath);
|
||||
expect(Object.values(finalState.flows)).toEqual([
|
||||
{status: 'passed', attempts: 1},
|
||||
{status: 'passed', attempts: 2},
|
||||
{status: 'passed', attempts: 1},
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -9,86 +9,293 @@
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const usage = `
|
||||
=== Usage ===
|
||||
node maestro-android.js <path to app> <app_id> <maestro_flow> <flavor> <working_directory>
|
||||
node maestro-android.js <path to app> <app_id> <maestro_flow> <flavor> <working_directory> [test_state_path]
|
||||
|
||||
@param {string} appPath - Path to the app APK
|
||||
@param {string} appId - App ID that needs to be launched
|
||||
@param {string} maestroFlow - Path to the maestro flow to be executed
|
||||
@param {string} maestroFlow - Path to the Maestro flow or folder to execute
|
||||
@param {string} flavor - Flavor of the app to be launched. Can be 'release' or 'debug'
|
||||
@param {string} workingDirectory - Working directory from where to run Metro
|
||||
@param {string} testStatePath - File used to persist per-flow results between CI retries
|
||||
==============
|
||||
`;
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const DEFAULT_STATE_PATH = '/tmp/maestro-android-state/results.json';
|
||||
const MAESTRO_LOG_DIRECTORY = '/tmp/MaestroLogs';
|
||||
const DIAGNOSTIC_COMMAND_TIMEOUT = 15000;
|
||||
const STATE_VERSION = 1;
|
||||
|
||||
if (args.length !== 5) {
|
||||
throw new Error(`Invalid number of arguments.\n${usage}`);
|
||||
}
|
||||
|
||||
const APP_PATH = args[0];
|
||||
const APP_ID = args[1];
|
||||
const MAESTRO_FLOW = args[2];
|
||||
const IS_DEBUG = args[3] === 'debug';
|
||||
const WORKING_DIRECTORY = args[4];
|
||||
|
||||
const MAX_ATTEMPTS = 3;
|
||||
|
||||
async function executeFlowWithRetries(flow, currentAttempt) {
|
||||
try {
|
||||
console.info(`Executing flow: ${flow}`);
|
||||
const timeout = 1000 * 60 * 10; // 10 minutes
|
||||
childProcess.execSync(
|
||||
`MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 $HOME/.maestro/bin/maestro test ${flow} --format junit -e APP_ID=${APP_ID} --debug-output /tmp/MaestroLogs`,
|
||||
{stdio: 'inherit', timeout},
|
||||
);
|
||||
} catch (err) {
|
||||
if (currentAttempt < MAX_ATTEMPTS) {
|
||||
console.info(`Retrying...`);
|
||||
await executeFlowWithRetries(flow, currentAttempt + 1);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
function collectFlows(flowPath) {
|
||||
if (!fs.existsSync(flowPath) || !fs.lstatSync(flowPath).isDirectory()) {
|
||||
return [flowPath];
|
||||
}
|
||||
}
|
||||
|
||||
async function executeFlowInFolder(flowFolder) {
|
||||
const files = fs.readdirSync(flowFolder);
|
||||
for (const file of files) {
|
||||
const filePath = `${flowFolder}/${file}`;
|
||||
const flows = [];
|
||||
for (const file of fs.readdirSync(flowPath).sort()) {
|
||||
const filePath = path.join(flowPath, file);
|
||||
if (fs.lstatSync(filePath).isDirectory()) {
|
||||
await executeFlowInFolder(filePath);
|
||||
flows.push(...collectFlows(filePath));
|
||||
} else if (file.endsWith('.yml') || file.endsWith('.yaml')) {
|
||||
await executeFlowWithRetries(filePath, 0);
|
||||
flows.push(filePath);
|
||||
}
|
||||
// Skip non-flow files (e.g. screenshot baselines under screenshots/).
|
||||
}
|
||||
return flows;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
function getFlowKey(flow) {
|
||||
return path
|
||||
.relative(process.cwd(), path.resolve(flow))
|
||||
.split(path.sep)
|
||||
.join('/');
|
||||
}
|
||||
|
||||
function createEmptyState() {
|
||||
return {version: STATE_VERSION, flows: {}};
|
||||
}
|
||||
|
||||
function loadState(statePath) {
|
||||
if (!fs.existsSync(statePath)) {
|
||||
return createEmptyState();
|
||||
}
|
||||
|
||||
const state = JSON.parse(fs.readFileSync(statePath, 'utf8'));
|
||||
if (
|
||||
state.version !== STATE_VERSION ||
|
||||
state.flows == null ||
|
||||
typeof state.flows !== 'object'
|
||||
) {
|
||||
throw new Error(`Invalid Maestro test state at ${statePath}`);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
function saveState(statePath, state) {
|
||||
fs.mkdirSync(path.dirname(statePath), {recursive: true});
|
||||
const temporaryPath = `${statePath}.tmp`;
|
||||
fs.writeFileSync(temporaryPath, `${JSON.stringify(state, null, 2)}\n`);
|
||||
fs.renameSync(temporaryPath, statePath);
|
||||
}
|
||||
|
||||
function runMaestroFlow(flow, appId) {
|
||||
console.info(`Executing flow: ${flow}`);
|
||||
const timeout = 1000 * 60 * 10; // 10 minutes
|
||||
try {
|
||||
childProcess.execSync(
|
||||
`MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 $HOME/.maestro/bin/maestro test "${flow}" --format junit -e APP_ID="${appId}" --debug-output ${MAESTRO_LOG_DIRECTORY}`,
|
||||
{stdio: 'inherit', timeout},
|
||||
);
|
||||
} catch (error) {
|
||||
captureFailureArtifacts(flow);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function captureFailureArtifacts(flow) {
|
||||
fs.mkdirSync(MAESTRO_LOG_DIRECTORY, {recursive: true});
|
||||
const artifactName = path.basename(flow, path.extname(flow));
|
||||
|
||||
try {
|
||||
const screenshot = childProcess.execFileSync(
|
||||
'adb',
|
||||
['exec-out', 'screencap', '-p'],
|
||||
{maxBuffer: 20 * 1024 * 1024, timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
|
||||
);
|
||||
fs.writeFileSync(
|
||||
path.join(MAESTRO_LOG_DIRECTORY, `${artifactName}-failure.png`),
|
||||
screenshot,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(`Failed to capture screenshot for ${flow}: ${error}`);
|
||||
}
|
||||
|
||||
try {
|
||||
childProcess.execFileSync(
|
||||
'adb',
|
||||
['shell', 'uiautomator', 'dump', '/sdcard/window.xml'],
|
||||
{stdio: 'ignore', timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
|
||||
);
|
||||
const hierarchy = childProcess.execFileSync(
|
||||
'adb',
|
||||
['exec-out', 'cat', '/sdcard/window.xml'],
|
||||
{maxBuffer: 20 * 1024 * 1024, timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
|
||||
);
|
||||
fs.writeFileSync(
|
||||
path.join(MAESTRO_LOG_DIRECTORY, `${artifactName}-failure.xml`),
|
||||
hierarchy,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(`Failed to capture UI hierarchy for ${flow}: ${error}`);
|
||||
}
|
||||
|
||||
try {
|
||||
const logcat = childProcess.execFileSync(
|
||||
'adb',
|
||||
['logcat', '-d', '-v', 'threadtime'],
|
||||
{maxBuffer: 50 * 1024 * 1024, timeout: DIAGNOSTIC_COMMAND_TIMEOUT},
|
||||
);
|
||||
fs.writeFileSync(
|
||||
path.join(MAESTRO_LOG_DIRECTORY, `${artifactName}-logcat.txt`),
|
||||
logcat,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(`Failed to capture logcat for ${flow}: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function stopScreenRecording(screenrecordProcess) {
|
||||
try {
|
||||
childProcess.execFileSync('adb', ['shell', 'pkill', '-2', 'screenrecord'], {
|
||||
stdio: 'ignore',
|
||||
});
|
||||
} catch {
|
||||
screenrecordProcess.kill('SIGINT');
|
||||
}
|
||||
|
||||
if (
|
||||
screenrecordProcess.exitCode == null &&
|
||||
screenrecordProcess.signalCode == null
|
||||
) {
|
||||
await Promise.race([
|
||||
new Promise(resolve => screenrecordProcess.once('close', resolve)),
|
||||
sleep(5000),
|
||||
]);
|
||||
}
|
||||
|
||||
if (
|
||||
screenrecordProcess.exitCode == null &&
|
||||
screenrecordProcess.signalCode == null
|
||||
) {
|
||||
screenrecordProcess.kill('SIGKILL');
|
||||
}
|
||||
}
|
||||
|
||||
function formatResults(flowKeys, state) {
|
||||
const results = flowKeys.map(flow => ({flow, ...state.flows[flow]}));
|
||||
const counts = results.reduce(
|
||||
(result, flow) => {
|
||||
result[flow.status] += 1;
|
||||
return result;
|
||||
},
|
||||
{passed: 0, failed: 0, pending: 0},
|
||||
);
|
||||
const rows = results
|
||||
.map(
|
||||
result =>
|
||||
`| ${result.status} | \`${result.flow.replaceAll('|', '\\|')}\` | ${result.attempts} |`,
|
||||
)
|
||||
.join('\n');
|
||||
|
||||
return `### Android Maestro E2E results
|
||||
|
||||
Passed: ${counts.passed} · Failed: ${counts.failed} · Pending: ${counts.pending}
|
||||
|
||||
| Status | Flow | CI attempts |
|
||||
| --- | --- | ---: |
|
||||
${rows}
|
||||
`;
|
||||
}
|
||||
|
||||
function writeResultsSummary(flowKeys, state) {
|
||||
const summary = formatResults(flowKeys, state);
|
||||
console.info(`\n${summary}`);
|
||||
if (process.env.GITHUB_STEP_SUMMARY) {
|
||||
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, summary);
|
||||
}
|
||||
}
|
||||
|
||||
function executeFlowSuite({
|
||||
flows,
|
||||
appId,
|
||||
state,
|
||||
statePath,
|
||||
executeFlow = runMaestroFlow,
|
||||
}) {
|
||||
const flowKeys = flows.map(getFlowKey);
|
||||
|
||||
for (const flow of flowKeys) {
|
||||
state.flows[flow] ??= {status: 'pending', attempts: 0};
|
||||
}
|
||||
saveState(statePath, state);
|
||||
|
||||
const failedFlows = [];
|
||||
for (let index = 0; index < flows.length; index++) {
|
||||
const flow = flows[index];
|
||||
const flowKey = flowKeys[index];
|
||||
const result = state.flows[flowKey];
|
||||
|
||||
if (result.status === 'passed') {
|
||||
console.info(`Skipping previously passed flow: ${flow}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
result.attempts += 1;
|
||||
try {
|
||||
executeFlow(flow, appId);
|
||||
result.status = 'passed';
|
||||
delete result.error;
|
||||
} catch (error) {
|
||||
result.status = 'failed';
|
||||
result.error = error instanceof Error ? error.message : String(error);
|
||||
failedFlows.push(flowKey);
|
||||
console.error(`Flow failed: ${flow}`);
|
||||
} finally {
|
||||
saveState(statePath, state);
|
||||
}
|
||||
}
|
||||
|
||||
writeResultsSummary(flowKeys, state);
|
||||
|
||||
if (failedFlows.length > 0) {
|
||||
throw new Error(
|
||||
`${failedFlows.length} Maestro flow(s) failed:\n${failedFlows.join('\n')}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function main(args = process.argv.slice(2)) {
|
||||
if (args.length < 5 || args.length > 6) {
|
||||
throw new Error(`Invalid number of arguments.\n${usage}`);
|
||||
}
|
||||
|
||||
const appPath = args[0];
|
||||
const appId = args[1];
|
||||
const maestroFlow = args[2];
|
||||
const isDebug = args[3] === 'debug';
|
||||
const workingDirectory = args[4];
|
||||
const statePath = args[5] ?? DEFAULT_STATE_PATH;
|
||||
|
||||
console.info('\n==============================');
|
||||
console.info('Running tests for Android with the following parameters:');
|
||||
console.info(`APP_PATH: ${APP_PATH}`);
|
||||
console.info(`APP_ID: ${APP_ID}`);
|
||||
console.info(`MAESTRO_FLOW: ${MAESTRO_FLOW}`);
|
||||
console.info(`IS_DEBUG: ${IS_DEBUG}`);
|
||||
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
|
||||
console.info(`APP_PATH: ${appPath}`);
|
||||
console.info(`APP_ID: ${appId}`);
|
||||
console.info(`MAESTRO_FLOW: ${maestroFlow}`);
|
||||
console.info(`IS_DEBUG: ${isDebug}`);
|
||||
console.info(`WORKING_DIRECTORY: ${workingDirectory}`);
|
||||
console.info(`TEST_STATE_PATH: ${statePath}`);
|
||||
console.info('==============================\n');
|
||||
|
||||
console.info('Install app');
|
||||
childProcess.execSync(`adb install ${APP_PATH}`, {stdio: 'ignore'});
|
||||
childProcess.execSync(`adb install ${appPath}`, {stdio: 'ignore'});
|
||||
|
||||
let metroProcess = null;
|
||||
if (IS_DEBUG) {
|
||||
if (isDebug) {
|
||||
console.info('Start Metro');
|
||||
childProcess.execSync(`cd ${WORKING_DIRECTORY}`, {stdio: 'ignore'});
|
||||
metroProcess = childProcess.spawn('yarn', ['start', '&'], {
|
||||
cwd: WORKING_DIRECTORY,
|
||||
stdio: 'ignore',
|
||||
fs.mkdirSync(MAESTRO_LOG_DIRECTORY, {recursive: true});
|
||||
const metroLog = fs.openSync(
|
||||
path.join(MAESTRO_LOG_DIRECTORY, 'metro.log'),
|
||||
'a',
|
||||
);
|
||||
metroProcess = childProcess.spawn('yarn', ['start'], {
|
||||
cwd: workingDirectory,
|
||||
stdio: ['ignore', metroLog, metroLog],
|
||||
detached: true,
|
||||
});
|
||||
fs.closeSync(metroLog);
|
||||
metroProcess.unref();
|
||||
console.info(`- Metro PID: ${metroProcess.pid}`);
|
||||
|
||||
@@ -97,51 +304,44 @@ async function main() {
|
||||
}
|
||||
|
||||
console.info('Start the app');
|
||||
childProcess.execSync(`adb shell monkey -p ${APP_ID} 1`, {stdio: 'ignore'});
|
||||
childProcess.execSync(`adb shell monkey -p ${appId} 1`, {stdio: 'ignore'});
|
||||
|
||||
if (IS_DEBUG) {
|
||||
if (isDebug) {
|
||||
console.info('Wait For App to warm from Metro');
|
||||
await sleep(10000);
|
||||
}
|
||||
|
||||
console.info('Start recording to /sdcard/screen.mp4');
|
||||
childProcess
|
||||
.exec('adb shell screenrecord /sdcard/screen.mp4', {
|
||||
stdio: 'ignore',
|
||||
detached: true,
|
||||
})
|
||||
.unref();
|
||||
const screenrecordProcess = childProcess.spawn(
|
||||
'adb',
|
||||
['shell', 'screenrecord', '/sdcard/screen.mp4'],
|
||||
{stdio: 'ignore'},
|
||||
);
|
||||
|
||||
console.info(`Start testing ${MAESTRO_FLOW}`);
|
||||
let error = null;
|
||||
try {
|
||||
//check if MAESTRO_FLOW is a folder
|
||||
if (
|
||||
fs.existsSync(MAESTRO_FLOW) &&
|
||||
fs.lstatSync(MAESTRO_FLOW).isDirectory()
|
||||
) {
|
||||
await executeFlowInFolder(MAESTRO_FLOW);
|
||||
} else {
|
||||
await executeFlowWithRetries(MAESTRO_FLOW, 0);
|
||||
}
|
||||
} catch (err) {
|
||||
error = err;
|
||||
const flows = collectFlows(maestroFlow);
|
||||
const state = loadState(statePath);
|
||||
console.info(`Start testing ${flows.length} flow(s)`);
|
||||
executeFlowSuite({flows, appId, state, statePath});
|
||||
} catch (caughtError) {
|
||||
error = caughtError;
|
||||
} finally {
|
||||
console.info('Stop recording');
|
||||
await stopScreenRecording(screenrecordProcess);
|
||||
childProcess.execSync('adb pull /sdcard/screen.mp4', {stdio: 'ignore'});
|
||||
|
||||
if (IS_DEBUG && metroProcess != null) {
|
||||
if (isDebug && metroProcess != null) {
|
||||
const pid = metroProcess.pid;
|
||||
console.info(`Kill Metro. PID: ${pid}`);
|
||||
process.kill(pid);
|
||||
console.info(`Metro Killed`);
|
||||
console.info('Metro Killed');
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
process.exit();
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
@@ -150,4 +350,16 @@ function sleep(ms) {
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
if (require.main === module) {
|
||||
main().catch(error => {
|
||||
console.error(error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
collectFlows,
|
||||
executeFlowSuite,
|
||||
formatResults,
|
||||
loadState,
|
||||
};
|
||||
@@ -9,6 +9,9 @@ on:
|
||||
fail-on-error:
|
||||
type: boolean
|
||||
default: false
|
||||
retry-attempt:
|
||||
type: number
|
||||
default: 0
|
||||
outputs:
|
||||
status:
|
||||
description: 'The result of the E2E tests (success or failure)'
|
||||
@@ -37,16 +40,42 @@ jobs:
|
||||
path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/
|
||||
- name: Print folder structure
|
||||
run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/
|
||||
- name: Download previous per-flow test state
|
||||
if: ${{ inputs.retry-attempt > 0 }}
|
||||
continue-on-error: true
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: e2e_android_rntester_state_${{ matrix.flavor }}_x86_NewArch
|
||||
path: /tmp/maestro-android-state
|
||||
- name: Check for unfinished E2E flows
|
||||
id: test-state
|
||||
shell: bash
|
||||
run: |
|
||||
SHOULD_RUN=true
|
||||
if [[ -f /tmp/maestro-android-state/results.json ]] && \
|
||||
jq -e '(.flows | length > 0) and all(.flows[]; .status == "passed")' /tmp/maestro-android-state/results.json > /dev/null; then
|
||||
SHOULD_RUN=false
|
||||
fi
|
||||
echo "should-run=$SHOULD_RUN" >> "$GITHUB_OUTPUT"
|
||||
- name: Run E2E Tests
|
||||
id: run-tests
|
||||
if: steps.test-state.outputs.should-run == 'true'
|
||||
continue-on-error: true
|
||||
uses: ./.github/actions/maestro-android
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 90
|
||||
with:
|
||||
app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/app-x86-${{ matrix.flavor }}.apk
|
||||
app-id: com.facebook.react.uiapp
|
||||
maestro-flow: ./packages/rn-tester/.maestro
|
||||
flavor: ${{ matrix.flavor }}
|
||||
- name: Store per-flow test state
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: e2e_android_rntester_state_${{ matrix.flavor }}_x86_NewArch
|
||||
overwrite: true
|
||||
if-no-files-found: warn
|
||||
path: /tmp/maestro-android-state/results.json
|
||||
- name: Report status
|
||||
id: report-status
|
||||
if: ${{ always() && steps.run-tests.outcome == 'failure' }}
|
||||
|
||||
@@ -9,6 +9,9 @@ on:
|
||||
fail-on-error:
|
||||
type: boolean
|
||||
default: false
|
||||
retry-attempt:
|
||||
type: number
|
||||
default: 0
|
||||
outputs:
|
||||
status:
|
||||
description: 'The result of the E2E tests (success or failure)'
|
||||
@@ -73,11 +76,29 @@ jobs:
|
||||
CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}')
|
||||
./gradlew assemble$CAPITALIZED_FLAVOR --no-daemon -PreactNativeArchitectures=x86
|
||||
|
||||
- name: Download previous per-flow test state
|
||||
if: ${{ inputs.retry-attempt > 0 }}
|
||||
continue-on-error: true
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: e2e_android_templateapp_state_${{ matrix.flavor }}_x86_NewArch
|
||||
path: /tmp/maestro-android-state
|
||||
- name: Check for unfinished E2E flows
|
||||
id: test-state
|
||||
shell: bash
|
||||
run: |
|
||||
SHOULD_RUN=true
|
||||
if [[ -f /tmp/maestro-android-state/results.json ]] && \
|
||||
jq -e '(.flows | length > 0) and all(.flows[]; .status == "passed")' /tmp/maestro-android-state/results.json > /dev/null; then
|
||||
SHOULD_RUN=false
|
||||
fi
|
||||
echo "should-run=$SHOULD_RUN" >> "$GITHUB_OUTPUT"
|
||||
- name: Run E2E Tests
|
||||
id: run-tests
|
||||
if: steps.test-state.outputs.should-run == 'true'
|
||||
continue-on-error: true
|
||||
uses: ./.github/actions/maestro-android
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 90
|
||||
with:
|
||||
app-path: /tmp/RNTestProject/android/app/build/outputs/apk/${{ matrix.flavor }}/app-${{ matrix.flavor }}.apk
|
||||
app-id: com.rntestproject
|
||||
@@ -85,6 +106,14 @@ jobs:
|
||||
install-java: 'false'
|
||||
flavor: ${{ matrix.flavor }}
|
||||
working-directory: /tmp/RNTestProject
|
||||
- name: Store per-flow test state
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: e2e_android_templateapp_state_${{ matrix.flavor }}_x86_NewArch
|
||||
overwrite: true
|
||||
if-no-files-found: warn
|
||||
path: /tmp/maestro-android-state/results.json
|
||||
- name: Report status
|
||||
id: report-status
|
||||
if: ${{ always() && steps.run-tests.outcome == 'failure' }}
|
||||
|
||||
@@ -247,6 +247,8 @@ jobs:
|
||||
needs: test_e2e_android_templateapp
|
||||
if: ${{ always() && needs.test_e2e_android_templateapp.outputs.status == 'failure' }}
|
||||
uses: ./.github/workflows/e2e-android-templateapp.yml
|
||||
with:
|
||||
retry-attempt: 1
|
||||
secrets: inherit
|
||||
|
||||
test_e2e_android_templateapp_retry_2:
|
||||
@@ -255,6 +257,7 @@ jobs:
|
||||
uses: ./.github/workflows/e2e-android-templateapp.yml
|
||||
with:
|
||||
fail-on-error: true
|
||||
retry-attempt: 2
|
||||
secrets: inherit
|
||||
|
||||
build_fantom_runner:
|
||||
@@ -336,6 +339,8 @@ jobs:
|
||||
needs: test_e2e_android_rntester
|
||||
if: ${{ always() && needs.test_e2e_android_rntester.outputs.status == 'failure' }}
|
||||
uses: ./.github/workflows/e2e-android-rntester.yml
|
||||
with:
|
||||
retry-attempt: 1
|
||||
secrets: inherit
|
||||
|
||||
test_e2e_android_rntester_retry_2:
|
||||
@@ -344,6 +349,7 @@ jobs:
|
||||
uses: ./.github/workflows/e2e-android-rntester.yml
|
||||
with:
|
||||
fail-on-error: true
|
||||
retry-attempt: 2
|
||||
secrets: inherit
|
||||
|
||||
build_npm_package:
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
jest.mock('../UIManager', () => ({
|
||||
__esModule: true,
|
||||
default: {
|
||||
getConstants: () => ({ViewManagerNames: []}),
|
||||
getDefaultEventTypes: () => ({}),
|
||||
getViewManagerConfig: name =>
|
||||
name === 'TestView'
|
||||
? {
|
||||
NativeProps: {fontVariationSettings: 'String'},
|
||||
bubblingEventTypes: {},
|
||||
directEventTypes: {},
|
||||
}
|
||||
: null,
|
||||
},
|
||||
}));
|
||||
|
||||
const {
|
||||
fontVariationSettingsAttribute,
|
||||
} = require('../../Components/View/ReactNativeStyleAttributes');
|
||||
const getNativeComponentAttributes =
|
||||
require('../getNativeComponentAttributes').default;
|
||||
|
||||
describe('getNativeComponentAttributes', () => {
|
||||
it('processes object font variation settings from native view configs', () => {
|
||||
const viewConfig = getNativeComponentAttributes('TestView');
|
||||
|
||||
expect(viewConfig.validAttributes.fontVariationSettings).toEqual(
|
||||
fontVariationSettingsAttribute,
|
||||
);
|
||||
expect(
|
||||
viewConfig.validAttributes.fontVariationSettings.process({
|
||||
wght: 552.5,
|
||||
opsz: 17.25,
|
||||
}),
|
||||
).toBe("'opsz' 17.25, 'wght' 552.5");
|
||||
});
|
||||
});
|
||||
+11
-2
@@ -26,6 +26,8 @@ const processBackgroundSize =
|
||||
const processColor = require('../StyleSheet/processColor').default;
|
||||
const processColorArray = require('../StyleSheet/processColorArray').default;
|
||||
const processFilter = require('../StyleSheet/processFilter').default;
|
||||
const processFontVariationSettings =
|
||||
require('../StyleSheet/processFontVariationSettings').default;
|
||||
const insetsDiffer = require('../Utilities/differ/insetsDiffer').default;
|
||||
const matricesDiffer = require('../Utilities/differ/matricesDiffer').default;
|
||||
const pointsDiffer = require('../Utilities/differ/pointsDiffer').default;
|
||||
@@ -74,7 +76,7 @@ function getNativeComponentAttributes(uiViewClassName: string): any {
|
||||
for (const key in nativeProps) {
|
||||
const typeName = nativeProps[key];
|
||||
const diff = getDifferForType(typeName);
|
||||
const process = getProcessorForType(typeName);
|
||||
const process = getProcessorForAttribute(key, typeName);
|
||||
|
||||
// If diff or process == null, omit the corresponding property from the Attribute
|
||||
// Why:
|
||||
@@ -183,7 +185,14 @@ function getDifferForType(
|
||||
return null;
|
||||
}
|
||||
|
||||
function getProcessorForType(typeName: string): ?(nextProp: any) => any {
|
||||
function getProcessorForAttribute(
|
||||
attributeName: string,
|
||||
typeName: string,
|
||||
): ?(nextProp: any) => any {
|
||||
if (attributeName === 'fontVariationSettings') {
|
||||
return processFontVariationSettings;
|
||||
}
|
||||
|
||||
switch (typeName) {
|
||||
// iOS Types
|
||||
case 'CGColor':
|
||||
|
||||
@@ -36,9 +36,8 @@ tags:
|
||||
direction: DOWN
|
||||
speed: 40
|
||||
timeout: 20000
|
||||
# External URL; accept loaded or error.
|
||||
- scrollUntilVisible:
|
||||
element: 'P3: (loaded|error)'
|
||||
element: 'P3: loaded'
|
||||
direction: DOWN
|
||||
speed: 40
|
||||
timeout: 20000
|
||||
|
||||
@@ -39,13 +39,62 @@ const base64Icon =
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAQAAACSR7JhAAADtUlEQVR4Ac3YA2Bj6QLH0XPT1Fzbtm29tW3btm3bfLZtv7e2ObZnms7d8Uw098tuetPzrxv8wiISrtVudrG2JXQZ4VOv+qUfmqCGGl1mqLhoA52oZlb0mrjsnhKpgeUNEs91Z0pd1kvihA3ULGVHiQO2narKSHKkEMulm9VgUyE60s1aWoMQUbpZOWE+kaqs4eLEjdIlZTcFZB0ndc1+lhB1lZrIuk5P2aib1NBpZaL+JaOGIt0ls47SKzLC7CqrlGF6RZ09HGoNy1lYl2aRSWL5GuzqWU1KafRdoRp0iOQEiDzgZPnG6DbldcomadViflnl/cL93tOoVbsOLVM2jylvdWjXolWX1hmfZbGR/wjypDjFLSZIRov09BgYmtUqPQPlQrPapecLgTIy0jMgPKtTeob2zWtrGH3xvjUkPCtNg/tm1rjwrMa+mdUkPd3hWbH0jArPGiU9ufCsNNWFZ40wpwn+62/66R2RUtoso1OB34tnLOcy7YB1fUdc9e0q3yru8PGM773vXsuZ5YIZX+5xmHwHGVvlrGPN6ZSiP1smOsMMde40wKv2VmwPPVXNut4sVpUreZiLBHi0qln/VQeI/LTMYXpsJtFiclUN+5HVZazim+Ky+7sAvxWnvjXrJFneVtLWLyPJu9K3cXLWeOlbMTlrIelbMDlrLenrjEQOtIF+fuI9xRp9ZBFp6+b6WT8RrxEpdK64BuvHgDk+vUy+b5hYk6zfyfs051gRoNO1usU12WWRWL73/MMEy9pMi9qIrR4ZpV16Rrvduxazmy1FSvuFXRkqTnE7m2kdb5U8xGjLw/spRr1uTov4uOgQE+0N/DvFrG/Jt7i/FzwxbA9kDanhf2w+t4V97G8lrT7wc08aA2QNUkuTfW/KimT01wdlfK4yEw030VfT0RtZbzjeMprNq8m8tnSTASrTLti64oBNdpmMQm0eEwvfPwRbUBywG5TzjPCsdwk3IeAXjQblLCoXnDVeoAz6SfJNk5TTzytCNZk/POtTSV40NwOFWzw86wNJRpubpXsn60NJFlHeqlYRbslqZm2jnEZ3qcSKgm0kTli3zZVS7y/iivZTweYXJ26Y+RTbV1zh3hYkgyFGSTKPfRVbRqWWVReaxYeSLarYv1Qqsmh1s95S7G+eEWK0f3jYKTbV6bOwepjfhtafsvUsqrQvrGC8YhmnO9cSCk3yuY984F1vesdHYhWJ5FvASlacshUsajFt2mUM9pqzvKGcyNJW0arTKN1GGGzQlH0tXwLDgQTurS8eIQAAAABJRU5ErkJggg==';
|
||||
const IMAGE_PREFETCH_URL = `${IMAGE1}?r=1&t=${Date.now()}`;
|
||||
const prefetchTask = Image.prefetch(IMAGE_PREFETCH_URL);
|
||||
// The Image Loading Events example reports this failure when it consumes the
|
||||
// task. Handle rejection immediately as the prefetch can finish before that
|
||||
// example mounts, which would otherwise produce an unhandled rejection.
|
||||
void prefetchTask.catch(() => {});
|
||||
// Remote JPEG (RN OSS test fixture) used by the progressive example. Trusted by
|
||||
// the API 24 Android CI emulator and reachable on both platforms.
|
||||
const LARGE_JPEG =
|
||||
'https://www.facebook.com/assets/react_native_oss_tests/large-image@1x.jpg';
|
||||
// Display-P3 wide-gamut sample (WebKit color-gamut test image).
|
||||
const WIDE_GAMUT_P3_URL =
|
||||
'https://webkit.org/blog-files/color-gamut/Webkit-logo-P3.png';
|
||||
// Display-P3 wide-gamut sample from the WebKit color-gamut test. Keep the
|
||||
// ICC-profiled fixture inline so the example does not depend on network access.
|
||||
const WIDE_GAMUT_P3_DATA_URI =
|
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAB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Obr3s+YUAYwwrMzsufyRtHSHBQlAru35YSfPijUGmHqH85r/aQIAz2972PdXIEBmZOaQavm1Zv4CJQiY9pA6' +
|
||||
'TQBA2F6SMLIdZg8/a61JiHdN8DDtkTf9LzIAy9yR/e9R552AnwQ/u++L6VUOEcCLoPI3QCUIjL24Vlo5BPeUqoAddt70UkmqcG/m' +
|
||||
'i+lFDhPAC0DAeRTpC16WtaMAEZzHHBKQx+/s466YrMopBMSz7NSPx1REiFiritjWV4Em8GTcPDIFfqTk+anlVAI4VgEylldm9wQZ' +
|
||||
'CBBE+qV7FUHTzTmxtPPkQCTbM+V0AmpwsoeMZVC1zlo/BCFL0GdmfLneTQnIYrKZsnZNtjPvmqBTJa5nZ7teL/03ISCLfY7X0XPp' +
|
||||
'c8R+CqY7AafQ+I6d3CvgHSfvFOj3CjiFxnfs5H+w+5OV96hz8wAAAABJRU5ErkJggg==';
|
||||
|
||||
type ImageSource = Readonly<{
|
||||
uri: string,
|
||||
@@ -975,7 +1024,7 @@ function WideGamutTransparencyExample(): React.Node {
|
||||
<Image
|
||||
testID="wide-gamut-p3-image"
|
||||
style={styles.base}
|
||||
source={{uri: WIDE_GAMUT_P3_URL}}
|
||||
source={{uri: WIDE_GAMUT_P3_DATA_URI}}
|
||||
onLoad={() => setP3Status('loaded')}
|
||||
onError={() => setP3Status('error')}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user