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

Fix/e2e tests ts issues #37501

Merged
merged 8 commits into from
Mar 2, 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
23 changes: 23 additions & 0 deletions .github/workflows/checkE2ETestCode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check e2e test code builds correctly

on:
workflow_call:
pull_request:
types: [opened, synchronize]
paths:
- 'tests/e2e/**'
- 'src/libs/E2E/**'

jobs:
lint:
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Verify e2e tests compile correctly
run: npm run e2e-test-runner-build
20 changes: 4 additions & 16 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,11 @@ jobs:
- name: Rename delta APK
run: mv "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edelta-release.apk" "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edeltaRelease.apk"

- name: Copy e2e code into zip folder
run: cp -r tests/e2e zip
- name: Compile test runner to be executable in a nodeJS environment
run: npm run e2e-test-runner-build

# Note: we can't reuse the apps tsconfig, as it depends on modules that aren't available in the AWS Device Farm environment
- name: Write tsconfig.json to zip folder
run: |
echo '{
"compilerOptions": {
"target": "ESNext",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
}
}' > zip/tsconfig.json
- name: Copy e2e code into zip folder
run: cp tests/e2e/dist/index.js zip/testRunner.js

- name: Zip everything in the zip directory up
run: zip -qr App.zip ./zip
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"gh-actions-unused-styles": "./.github/scripts/findUnusedKeys.sh",
"workflow-test": "./workflow_tests/scripts/runWorkflowTests.sh",
"workflow-test:generate": "ts-node workflow_tests/utils/preGenerateTest.js",
"setup-https": "mkcert -install && mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1"
"setup-https": "mkcert -install && mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1",
"e2e-test-runner-build": "ncc build tests/e2e/testRunner.js -o tests/e2e/dist/"
},
"dependencies": {
"@dotlottie/react-player": "^1.6.3",
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/TestSpec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ phases:
test:
commands:
- cd zip
- npm install underscore ts-node typescript
- npx ts-node e2e/testRunner.js -- --mainAppPath app-e2eRelease.apk --deltaAppPath app-e2edeltaRelease.apk
- node testRunner.js -- --mainAppPath app-e2eRelease.apk --deltaAppPath app-e2edeltaRelease.apk

artifacts:
- $WORKING_DIRECTORY
Loading