-
Notifications
You must be signed in to change notification settings - Fork 829
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
feat(e2e): add a job to run e2e on linux os #2796
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
cafd88c
add e2e functional job
yasserfaraazkhan 849cea1
add e2e functional job
yasserfaraazkhan 5b14461
run e2e tests linux
yasserfaraazkhan 45c1c29
run tests
yasserfaraazkhan 74fc1f0
Merge remote-tracking branch 'origin/master' into test_ci
yasserfaraazkhan 0ec7497
run tests linux os
yasserfaraazkhan d7c9850
add reporting
yasserfaraazkhan 973587e
add reporting
yasserfaraazkhan f5b5144
add reporting
yasserfaraazkhan 087625b
add reporting
yasserfaraazkhan c73b619
clean up
yasserfaraazkhan 4121962
clean up
yasserfaraazkhan 91a457c
clean up
yasserfaraazkhan 0dcb7e6
test env vars
yasserfaraazkhan 50f108c
Merge remote-tracking branch 'origin/master' into test_ci
yasserfaraazkhan 9dddbd4
test env vars
yasserfaraazkhan 7e00944
test env vars
yasserfaraazkhan 1c3c8f4
clean up
yasserfaraazkhan b0774d6
clean up
yasserfaraazkhan 7edfa70
fix tests
yasserfaraazkhan 1993d63
update workflow
yasserfaraazkhan 67c4354
fetching latest server release version
yasserfaraazkhan 4029b75
fetching latest server release version
yasserfaraazkhan c20f9f7
add MacOS job
yasserfaraazkhan db7b50f
add aws creds
yasserfaraazkhan 8dbbc96
add windows job
yasserfaraazkhan 885bf63
add windows job
yasserfaraazkhan 6f6d024
Merge remote-tracking branch 'origin/master' into test_ci
yasserfaraazkhan eda21c8
clean up
yasserfaraazkhan 494bc96
clean up
yasserfaraazkhan 10d67cf
fix win test
yasserfaraazkhan e5e900f
fix win test
yasserfaraazkhan e224141
fix win test
yasserfaraazkhan 1447f9a
fix win test
yasserfaraazkhan 1302bb1
fix win test
yasserfaraazkhan 9441bf0
add label
yasserfaraazkhan a4469a5
add label
yasserfaraazkhan dd9bfae
Merge remote-tracking branch 'origin/master' into test_ci
yasserfaraazkhan c1e0fd8
change url
yasserfaraazkhan 2e4e03b
change url
yasserfaraazkhan 81c023b
point at spinwick
yasserfaraazkhan 9d0c248
Merge branch 'master' into test_ci
mattermost-build c804706
Merge remote-tracking branch 'origin/master' into test_ci
yasserfaraazkhan b1a299d
clean up
yasserfaraazkhan 37933c2
Merge remote-tracking branch 'origin/master' into test_ci
yasserfaraazkhan d349c5b
Merge branch 'master' into test_ci
mattermost-build File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
name: Electron Playwright Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: | ||
- labeled | ||
|
||
env: | ||
AWS_S3_BUCKET: "mattermost-cypress-report" | ||
BRANCH: ${{ github.ref }} | ||
BUILD_SUFFIX: 'desktop-pr' | ||
JIRA_PROJECT_KEY: 'MM' | ||
MM_TEST_SERVER_URL: "https://mattermost-pr-23996.test.mattermost.cloud/" | ||
PULL_REQUEST_BASE_URL: "https://github.com/mattermost/desktop/pull/" | ||
TYPE: ${{ github.event_name == 'pull_request' && 'PR' || '' }} | ||
ZEPHYR_ENVIRONMENT_NAME: 'Desktop app' | ||
ZEPHYR_FOLDER_ID: "3256491" | ||
TEST_CYCLE_LINK_PREFIX: ${{ secrets.MM_DESKTOP_E2E_TEST_CYCLE_LINK_PREFIX }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.MM_DESKTOP_E2E_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.MM_DESKTOP_E2E_AWS_SECRET_ACCESS_KEY }} | ||
WEBHOOK_URL: ${{ secrets.MM_DESKTOP_E2E_WEBHOOK_URL }} | ||
ZEPHYR_API_KEY: ${{ secrets.MM_DESKTOP_E2E_ZEPHYR_API_KEY }} | ||
|
||
|
||
jobs: | ||
e2e-linux: | ||
if: ${{ github.event.label.name == 'Run Desktop E2E Tests' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: ci/checkout-repo | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
- name: ci/setup-node | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | ||
with: | ||
node-version-file: "package.json" | ||
cache: "npm" | ||
cache-dependency-path: package-lock.json | ||
|
||
- name: Install dependencies | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 0 | ||
run: | | ||
wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_22.04/Release.key | sudo apt-key add - | ||
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq | ||
sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata | ||
npm ci | ||
|
||
- name: Set Environment Variables | ||
run: | | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
echo "BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-pr" >> $GITHUB_ENV | ||
elif [ "${{ github.event_name }}" == "release" ]; then | ||
echo "BRANCH=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-release" >> $GITHUB_ENV | ||
echo "ZEPHYR_ENABLE=true" >> $GITHUB_ENV | ||
elif [ "${{ github.event_name }}" == "schedule" ]; then | ||
echo "BRANCH=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-nightly" >> $GITHUB_ENV | ||
fi | ||
echo "BUILD_ID=${{ github.run_id }}-${BUILD_SUFFIX}-${{ runner.os }}" >> $GITHUB_ENV | ||
echo "BUILD_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV | ||
echo "PULL_REQUEST=${PULL_REQUEST_BASE_URL}${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
|
||
if [ -n "${ZEPHYR_ENABLE}" ]; then | ||
echo "ZEPHYR_ENABLE=${ZEPHYR_ENABLE}" >> $GITHUB_ENV | ||
fi | ||
|
||
- name: Run Playwright tests (Ubuntu OS) | ||
run: | | ||
export DISPLAY=:99 | ||
Xvfb $DISPLAY -screen 0 1024x768x24 > /dev/null 2>&1 & | ||
npm run test:e2e || true # making job pass even if the tests fail due to flakyness | ||
npm run test:e2e:send-report | ||
|
||
- name: Remove "Run Desktop E2E Tests" label | ||
if: always() | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: | | ||
Run Desktop E2E Tests | ||
|
||
e2e-macos: | ||
if: ${{ github.event.label.name == 'Run Desktop E2E Tests' }} | ||
runs-on: macos-12 | ||
steps: | ||
- name: ci/checkout-repo | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
- name: ci/setup-node | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | ||
with: | ||
node-version-file: "package.json" | ||
cache: "npm" | ||
cache-dependency-path: package-lock.json | ||
|
||
- name: Setup Go environment | ||
uses: actions/[email protected] | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: ci/install-dependencies | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
run: | | ||
brew install yq | ||
jq '.mac.target=["zip"]' electron-builder.json | jq '.mac.gatekeeperAssess=false' > /tmp/electron-builder.json && cp /tmp/electron-builder.json . | ||
npm ci | ||
|
||
- name: Set Environment Variables | ||
run: | | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
echo "BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-pr" >> $GITHUB_ENV | ||
elif [ "${{ github.event_name }}" == "release" ]; then | ||
echo "BRANCH=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-release" >> $GITHUB_ENV | ||
echo "ZEPHYR_ENABLE=true" >> $GITHUB_ENV | ||
elif [ "${{ github.event_name }}" == "schedule" ]; then | ||
echo "BRANCH=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-nightly" >> $GITHUB_ENV | ||
fi | ||
echo "BUILD_ID=${{ github.run_id }}-${BUILD_SUFFIX}-${{ runner.os }}" >> $GITHUB_ENV | ||
echo "BUILD_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV | ||
echo "PULL_REQUEST=${PULL_REQUEST_BASE_URL}${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
|
||
if [ -n "${ZEPHYR_ENABLE}" ]; then | ||
echo "ZEPHYR_ENABLE=${ZEPHYR_ENABLE}" >> $GITHUB_ENV | ||
fi | ||
|
||
- name: Run Playwright tests (macOS) | ||
run: | | ||
npm run test:e2e || true # making job pass even if the tests fail due to flakyness | ||
npm run test:e2e:send-report | ||
|
||
e2e-windows: | ||
if: ${{ github.event.label.name == 'Run Desktop E2E Tests' }} | ||
runs-on: windows-latest | ||
steps: | ||
- name: ci/checkout-repo | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
- name: ci/setup-node | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | ||
with: | ||
node-version-file: "package.json" | ||
cache: "npm" | ||
cache-dependency-path: package-lock.json | ||
|
||
- name: ci/cache-node-modules | ||
id: cache-node-modules | ||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-build-node-modules-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-node-modules | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
|
||
- name: ci/install-node-gyp | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
run: | | ||
choco install yq --version 4.15.1 -y | ||
npm i -g node-gyp | ||
node-gyp install | ||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" | ||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 | ||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 | ||
|
||
- name: Set Environment Variables | ||
shell: bash | ||
run: | | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
echo "BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-pr" >> $GITHUB_ENV | ||
elif [ "${{ github.event_name }}" == "release" ]; then | ||
echo "BRANCH=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-release" >> $GITHUB_ENV | ||
echo "ZEPHYR_ENABLE=true" >> $GITHUB_ENV | ||
elif [ "${{ github.event_name }}" == "schedule" ]; then | ||
echo "BRANCH=${{ github.ref }}" >> $GITHUB_ENV | ||
echo "BUILD_SUFFIX=desktop-nightly" >> $GITHUB_ENV | ||
fi | ||
echo "BUILD_ID=${{ github.run_id }}-${BUILD_SUFFIX}-${{ runner.os }}" >> $GITHUB_ENV | ||
echo "BUILD_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV | ||
echo "PULL_REQUEST=${PULL_REQUEST_BASE_URL}${{ github.event.pull_request.number }}" >> $GITHUB_ENV | ||
|
||
if [ -n "${ZEPHYR_ENABLE}" ]; then | ||
echo "ZEPHYR_ENABLE=${ZEPHYR_ENABLE}" >> $GITHUB_ENV | ||
fi | ||
|
||
- name: Run Playwright tests (Windows OS) | ||
run: | | ||
npm run test:e2e || true | ||
npm run test:e2e:send-report | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
❤️