-
Notifications
You must be signed in to change notification settings - Fork 91
ci: add Jenkinsfile and config for e2e mobile tests #19163
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
base: master
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (51)
|
42e0569 to
220c950
Compare
- wallet locators - app lifecycle management - toast message handling (visibility checks and logging). - saved addresses page
…ertions - Replaced instances of LambdaTest reporting with Cloud reporting - Assertion messages for clarity - Updated test methods for toast handling
162d5a5 to
a21a910
Compare
jakubgs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, but needs some more work. You make a few weird assumptions about availability of env variables.
| if [[ ! -f "${APK_PATH}" ]]; then | ||
| echo "Error: APK_PATH does not exist or is not a file: ${APK_PATH}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -r "${APK_PATH}" ]]; then | ||
| echo "Error: APK_PATH is not readable: ${APK_PATH}" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pointless double test, the -r will fail if -f would fail.
| if [[ -z "${APK_PATH:-}" ]]; then | ||
| echo "Error: APK_PATH environment variable is required" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an env variables rather than a positional argument?
| curl -s -u "${BROWSERSTACK_USERNAME}:${BROWSERSTACK_ACCESS_KEY}" \ | ||
| -X POST "https://api-cloud.browserstack.com/app-automate/upload" \ | ||
| -F "file=@${APK_PATH}" \ | ||
| -F "custom_id=${CUSTOM_ID}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use --show-error and --fail-with-body to make debugging less painful:
| -F "custom_id=${CUSTOM_ID}" | |
| curl --request POST "https://api-cloud.browserstack.com/app-automate/upload" | |
| --silent --show-error --fail-with-body \ | |
| --user "${BROWSERSTACK_USERNAME}:${BROWSERSTACK_ACCESS_KEY}" \ | |
| --form "file=@${APK_PATH}" \ | |
| --form "custom_id=${CUSTOM_ID}" |
And use full flag names instead of cryptic one letter flags. Those are for CLI use, not for scripts.
| } | ||
|
|
||
| parameters { | ||
| gitParameter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using gitParameter, see this PR for problem description:
| stage('Use provided BrowserStack app') { | ||
| when { | ||
| expression { params.BROWSERSTACK_APP_ID?.trim() } | ||
| } | ||
| steps { | ||
| script { | ||
| env.BROWSERSTACK_APP_ID = params.BROWSERSTACK_APP_ID.trim() | ||
| echo "Using provided BrowserStack app id: ${env.BROWSERSTACK_APP_ID}" | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pointless stage that achieves nothing.
| steps { | ||
| script { | ||
| dir('test/e2e_appium') { | ||
| println("Using TEST_DEVICE_ID: ${env.TEST_DEVICE_ID}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the point of this is since user can just look up job parameters.
| stage('Publish test results') { | ||
| steps { | ||
| script { | ||
| def runId = env.E2E_RUN_ID?.trim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this supposed to come from?
| def runId = env.E2E_RUN_ID?.trim() | ||
| def reportsPattern = runId ? "test/e2e_appium/reports/${runId}/**/*.xml" : "test/e2e_appium/reports/**/*.xml" | ||
| junit allowEmptyResults: true, testResults: reportsPattern | ||
| def archivePattern = runId ? "test/e2e_appium/reports/${runId}/**/*" : "test/e2e_appium/reports/**/*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this pattern wider than the one above? How are those artifacts useful?
| success { | ||
| script { | ||
| github.notifyPR(true) | ||
| } | ||
| } | ||
| failure { | ||
| script { | ||
| github.notifyPR(false) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| success { | |
| script { | |
| github.notifyPR(true) | |
| } | |
| } | |
| failure { | |
| script { | |
| github.notifyPR(false) | |
| } | |
| } | |
| success { script { github.notifyPR(true) } } | |
| failure { script { github.notifyPR(false) } } |
| } | ||
| } | ||
| cleanup { | ||
| cleanWs(disableDeferredWipeout: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cleanWs(disableDeferredWipeout: true) | |
| cleanWs(disableDeferredWipeout: true) | |
| dir(env.WORKSPACE_TMP) { deleteDir() } |
What does the PR do
ci/Jenkinsfile.test-e2e.androidso Jenkins can run Android smoke tests on BrowserStack (in preparation for PR checks and nightly runs)Successfully ran with simulated config locally but still to be tested from Jenkins directly