Skip to content

Commit

Permalink
Move e2e to tests folder and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGable committed Nov 2, 2022
1 parent b06342f commit 7bec64d
Show file tree
Hide file tree
Showing 29 changed files with 7 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ storybook-static
.jest-cache

# E2E test reports
e2e/.results/
tests/e2e/.results/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ variables referenced here get updated since your local `.env` file is ignored.
- `ONYX_METRICS` (optional) - Set this to `true` to capture even more performance metrics and see them in Flipper
see [React-Native-Onyx#benchmarks](https://github.com/Expensify/react-native-onyx#benchmarks) for more information
- `E2E_TESTING` (optional) - This needs to be set to `true` when running the e2e tests for performance regression testing.
This happens usually automatically, read [this](e2e/README.md) for more information
This happens usually automatically, read [this](tests/e2e/README.md) for more information

----

Expand Down
6 changes: 0 additions & 6 deletions e2e/utils/androidReversePort.js

This file was deleted.

39 changes: 0 additions & 39 deletions e2e/utils/startRecordingVideo.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"analyze-packages": "ANALYZE_BUNDLE=true webpack --config config/webpack/webpack.common.js --env envFile=.env.production",
"symbolicate:android": "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map",
"symbolicate:ios": "npx metro-symbolicate main.jsbundle.map",
"test:e2e": "node ./e2e/testRunner.js"
"test:e2e": "node tests/e2e/testRunner.js"
},
"dependencies": {
"@expensify/react-native-web": "0.18.9",
Expand Down
4 changes: 2 additions & 2 deletions src/libs/E2E/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Routes from '../../../e2e/server/routes';
import Config from '../../../e2e/config';
import Routes from '../../../tests/e2e/server/routes';
import Config from '../../../tests/e2e/config';

const SERVER_ADDRESS = `http://localhost:${Config.SERVER_PORT}`;

Expand Down
2 changes: 1 addition & 1 deletion src/libs/E2E/reactNativeLaunchingTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Performance.markStart('regularAppStart');
import '../../../index';
Performance.markEnd('regularAppStart');

import E2EConfig from '../../../e2e/config';
import E2EConfig from '../../../tests/e2e/config';
import E2EClient from './client';

console.debug('==========================');
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/README.md → tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ It will run the tests of a test case multiple time to average out the results.

## Adding tests

To add a test checkout the [designed guide](./ADDING_TESTS.md).
To add a test checkout the [designed guide](tests/e2e/ADDING_TESTS.md).

## Structure

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions e2e/testRunner.js → tests/e2e/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ const killApp = require('./utils/killApp');
const launchApp = require('./utils/launchApp');
const createServerInstance = require('./server');
const installApp = require('./utils/installApp');
const reversePort = require('./utils/androidReversePort');
const math = require('./measure/math');
const writeTestStats = require('./measure/writeTestStats');
const withFailTimeout = require('./utils/withFailTimeout');
const startRecordingVideo = require('./utils/startRecordingVideo');

const args = process.argv.slice(2);

Expand Down Expand Up @@ -121,8 +119,6 @@ const runTestsOnBranch = async (branch, baselineOrCompare) => {
const progressText = `(${testIndex + 1}/${numOfTests}) Running test '${config.name}' (iteration ${i + 1}/${RUNS})`;
testLog.updateText(progressText);

const stopVideoRecording = startRecordingVideo();

await restartApp();

// Wait for a test to finish by waiting on its done call to the http server
Expand All @@ -134,10 +130,8 @@ const runTestsOnBranch = async (branch, baselineOrCompare) => {
resolve();
});
}), progressText);
await stopVideoRecording(false);
} catch (e) {
// When we fail due to a timeout it's interesting to take a screenshot of the emulator to see whats going on
await stopVideoRecording(true);
testLog.done();
throw e; // Rethrow to abort execution
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7bec64d

Please sign in to comment.