Skip to content

Commit

Permalink
Merge pull request Expensify#32167 from margelo/e2e/fix-test-failing-…
Browse files Browse the repository at this point in the history
…on-aws
  • Loading branch information
mountiny authored Nov 29, 2023
2 parents 1234b0d + 859fba2 commit e909316
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ jobs:
test_spec_file: tests/e2e/TestSpec.yml
test_spec_type: APPIUM_NODE_TEST_SPEC
remote_src: false
file_artifacts: Customer Artifacts.zip
file_artifacts: |
Customer Artifacts.zip
Test spec output.txt
log_artifacts: debug.log
cleanup: true
timeout: 5400
Expand All @@ -220,6 +222,7 @@ jobs:
if: failure()
run: |
echo ${{ steps.schedule-awsdf-main.outputs.data }}
cat "./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/Test spec output.txt"
unzip "Customer Artifacts.zip" -d mainResults
cat ./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/debug.log
Expand Down
10 changes: 6 additions & 4 deletions tests/e2e/TestSpec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ phases:
# Install correct version of node
- export NVM_DIR=$HOME/.nvm
- . $NVM_DIR/nvm.sh
- nvm install 20.9.0
- nvm use 20.9.0
# Note: Node v16 is the latest supported version of node for AWS Device Farm
# using v20 will not work!
- nvm install 16
- nvm use --delete-prefix 16

# Reverse ports using AWS magic
- PORT=4723
- IP_ADDRESS=$(ip -4 addr show eth0 | grep -Po "(?<=inet\s)\d+(\.\d+){3}")
- reverse_values="{\"ip_address\":\"$IP_ADDRESS\",\"local_port\":\"$PORT\",\"remote_port\":\"$PORT\"}"
- "curl -H \"Content-Type: application/json\" -X POST -d \"$reverse_values\" http://localhost:31007/reverse_forward_tcp"
- 'curl -H "Content-Type: application/json" -X POST -d "$reverse_values" http://localhost:31007/reverse_forward_tcp'
- adb reverse tcp:$PORT tcp:$PORT

test:
Expand All @@ -23,4 +25,4 @@ phases:
- node e2e/testRunner.js -- --skipInstallDeps --buildMode "skip" --skipCheckout --mainAppPath app-e2eRelease.apk --deltaAppPath app-e2edeltaRelease.apk

artifacts:
- $WORKING_DIRECTORY
- $WORKING_DIRECTORY
8 changes: 4 additions & 4 deletions tests/e2e/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ if (args.includes('--config')) {
}

// Important set app path after correct config file has been set
let mainAppPath = config.MAIN_APP_PATH;
let deltaAppPath = config.DELTA_APP_PATH;
let mainAppPath = args[args.indexOf('--mainAppPath') + 1] || config.MAIN_APP_PATH;
let deltaAppPath = args[args.indexOf('--deltaAppPath') + 1] || config.DELTA_APP_PATH;

// Create some variables after the correct config file has been loaded
const OUTPUT_FILE = `${config.OUTPUT_DIR}/${label}.json`;
Expand Down Expand Up @@ -205,8 +205,8 @@ const runTests = async () => {

let progressLog = Logger.progressInfo('Installing apps and reversing port');

await installApp('android', config.MAIN_APP_PACKAGE, defaultConfig.MAIN_APP_PATH);
await installApp('android', config.DELTA_APP_PACKAGE, defaultConfig.DELTA_APP_PATH);
await installApp('android', config.MAIN_APP_PACKAGE, mainAppPath);
await installApp('android', config.DELTA_APP_PACKAGE, deltaAppPath);
await reversePort();
progressLog.done();

Expand Down

0 comments on commit e909316

Please sign in to comment.