Files
mattermostest/.github/workflows/e2e-functional-template.yml
dependabot[bot] 34963cbaa8 Bump the github-actions-updates group with 10 updates (#3343)
Bumps the github-actions-updates group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.1.1` | `4.2.2` |
| [actions/setup-node](https://github.com/actions/setup-node) | `4.0.2` | `4.2.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.3.1` | `4.6.0` |
| [actions/cache](https://github.com/actions/cache) | `4.0.2` | `4.2.0` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4.1.4` | `4.1.8` |
| [EnricoMi/publish-unit-test-result-action](https://github.com/enricomi/publish-unit-test-result-action) | `2.3.0` | `2.18.0` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5.0.0` | `5.4.0` |
| [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `1.7.0` | `4.1.0` |
| [mattermost/action-mattermost-notify](https://github.com/mattermost/action-mattermost-notify) | `60f5da6e1796b033cf5a038b57031fa011962e27` | `d317daebed2a792679f68fd0248557a8d21d82b6` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.3.1` | `2.4.0` |


Updates `actions/checkout` from 4.1.1 to 4.2.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](b4ffde65f4...11bd71901b)

Updates `actions/setup-node` from 4.0.2 to 4.2.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](60edb5dd54...1d0ff469b7)

Updates `actions/upload-artifact` from 4.3.1 to 4.6.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](5d5d22a312...65c4c4a1dd)

Updates `actions/cache` from 4.0.2 to 4.2.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](0c45773b62...1bd1e32a3b)

Updates `actions/download-artifact` from 4.1.4 to 4.1.8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](c850b930e6...fa0a91b85d)

Updates `EnricoMi/publish-unit-test-result-action` from 2.3.0 to 2.18.0
- [Release notes](https://github.com/enricomi/publish-unit-test-result-action/releases)
- [Commits](a3caf02865...170bf24d20)

Updates `actions/setup-python` from 5.0.0 to 5.4.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](0a5c615913...42375524e2)

Updates `aws-actions/configure-aws-credentials` from 1.7.0 to 4.1.0
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](67fbcbb121...ececac1a45)

Updates `mattermost/action-mattermost-notify` from 60f5da6e1796b033cf5a038b57031fa011962e27 to d317daebed2a792679f68fd0248557a8d21d82b6
- [Release notes](https://github.com/mattermost/action-mattermost-notify/releases)
- [Commits](60f5da6e17...d317daebed)

Updates `ossf/scorecard-action` from 2.3.1 to 2.4.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](0864cf1902...62b2cac7ed)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-updates
- dependency-name: EnricoMi/publish-unit-test-result-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
- dependency-name: aws-actions/configure-aws-credentials
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
- dependency-name: mattermost/action-mattermost-notify
  dependency-type: direct:production
  dependency-group: github-actions-updates
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-18 15:35:42 +00:00

215 lines
8.6 KiB
YAML

name: E2E Functional Tests Template
on:
workflow_call:
inputs:
MM_TEST_SERVER_URL:
description: "The test server URL"
required: false
type: string
MM_TEST_USER_NAME:
description: "The admin username of the test instance"
required: false
type: string
MM_TEST_PASSWORD:
description: "The admin password of the test instance"
required: false
type: string
DESKTOP_VERSION:
description: "The desktop version to test"
required: false
default: ${{ github.ref }}
type: string
runs-on:
type: string
description: "The E2E tests underlying OS"
required: true
default: "ubuntu-22.04"
nightly:
type: boolean
description: "True if this is nigtly build"
required: false
default: false
cmt:
type: boolean
description: "True if this is Compatibility Matrix Testing"
required: false
default: false
MM_SERVER_VERSION:
type: string
required: false
default: "9.9.1"
outputs:
COMMENT_BODY:
description: "The output to comment"
value: ${{ jobs.e2e.outputs.COMMENT_BODY }}
env:
AWS_S3_BUCKET: "mattermost-cypress-report"
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_TAG: ${{ github.event.pull_request.head.sha || github.sha }}
JIRA_PROJECT_KEY: "MM"
MM_TEST_SERVER_URL: ${{ inputs.MM_TEST_SERVER_URL || secrets.MM_DESKTOP_E2E_SERVER_URL }}
MM_TEST_USER_NAME: ${{ inputs.MM_TEST_USER_NAME || secrets.MM_DESKTOP_E2E_USER_NAME }}
MM_TEST_PASSWORD: ${{ inputs.MM_TEST_PASSWORD || secrets.MM_DESKTOP_E2E_USER_CREDENTIALS }}
PULL_REQUEST: "https://github.com/mattermost/desktop/pull/${{ github.event.number }}"
ZEPHYR_ENVIRONMENT_NAME: "Desktop app"
ZEPHYR_FOLDER_ID: "12413253"
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 }}
AWS_REGION: "us-east-1"
WEBHOOK_URL: ${{ secrets.MM_DESKTOP_E2E_WEBHOOK_URL }}
ZEPHYR_API_KEY: ${{ secrets.MM_DESKTOP_E2E_ZEPHYR_API_KEY }}
REPORT_LINK: "none"
jobs:
e2e:
runs-on: ${{ inputs.runs-on }}
defaults:
run:
shell: bash
outputs:
COMMENT_BODY: ${{ steps.analyze-flaky-tests.outputs.COMMENT_BODY }}
steps:
- name: e2e/set-required-variables
id: variables
run: |
RUNNER_OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BUILD_SUFFIX=desktop-pr-${RUNNER_OS}" >> $GITHUB_OUTPUT
echo "TYPE=PR" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.cmt }}" ]; then
echo "BUILD_SUFFIX=desktop-release-${RUNNER_OS}" >> $GITHUB_OUTPUT
echo "TYPE=CMT" >> $GITHUB_ENV
echo "ZEPHYR_ENABLE=true" >> $GITHUB_ENV
echo "ZEPHYR_FOLDER_LINUX_REPORT=12358649" >> $GITHUB_ENV
echo "ZEPHYR_FOLDER_MACOS_REPORT=12358650" >> $GITHUB_ENV
echo "ZEPHYR_FOLDER_WIN_REPORT=12358651" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "workflow_dispatch" ] && ! ${{ inputs.nightly }}; then
echo "BUILD_SUFFIX=desktop-manual-trigger-${RUNNER_OS}" >> $GITHUB_OUTPUT
echo "TYPE=MANUAL" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/master" ]; then
echo "BUILD_SUFFIX=desktop-master-push-${RUNNER_OS}" >> $GITHUB_OUTPUT
echo "TYPE=MASTER" >> $GITHUB_ENV
echo "ZEPHYR_ENABLE=true" >> $GITHUB_ENV
elif ${{ inputs.nightly }}; then
echo "BUILD_SUFFIX=desktop-nightly-${RUNNER_OS}" >> $GITHUB_OUTPUT
echo "TYPE=NIGHTLY" >> $GITHUB_ENV
echo "ZEPHYR_ENABLE=true" >> $GITHUB_ENV
echo "ZEPHYR_FOLDER_LINUX_REPORT=12363689" >> $GITHUB_ENV
echo "ZEPHYR_FOLDER_MACOS_REPORT=12363687" >> $GITHUB_ENV
echo "ZEPHYR_FOLDER_WIN_REPORT=12363690" >> $GITHUB_ENV
fi
- name: e2e/set-build-id
run: echo "BUILD_ID=${{ github.run_id }}-${{ steps.variables.outputs.BUILD_SUFFIX }}" >> $GITHUB_ENV
- name: e2e/checkout-repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.DESKTOP_VERSION }}
- name: e2e/setup-node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: "package.json"
cache: "npm"
cache-dependency-path: package-lock.json
- name: e2e/cache-node-modules
id: cache-node-modules
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
node_modules
C:\Users\runneradmin\.electron-gyp
key: ${{ runner.os }}-build-node-modules-${{ hashFiles('./package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-node-modules
${{ runner.os }}-build-
${{ runner.os }}-
- name: e2e/setup-python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.10"
## Linux Depdendencies
- name: e2e/install-dependencies-linux
if: runner.os == 'Linux'
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 xsel
sudo apt-get install -y xvfb
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x24 &
npm ci
cd e2e
npm ci
npx electron-rebuild --platform=linux -f -t prod,optional,dev -w robotjs --module-dir ../
- name: e2e/install-dependencies-macos
if: runner.os == 'macOS'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: |
brew install nss
jq '.mac.target=["zip"]' electron-builder.json | jq '.mac.gatekeeperAssess=false' > /tmp/electron-builder.json && cp /tmp/electron-builder.json .
npm ci
cd e2e
npm ci
npx electron-rebuild --platform=darwin -f -t prod,optional,dev -w robotjs --module-dir ../
## Windows Dependencies
- name: e2e/install-dependencies-windows
if: runner.os == 'windows'
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
npm ci --openssl_fips=''
cd e2e
npm ci
npx electron-rebuild --platform=win32 -f -t prod,optional,dev -w robotjs --module-dir ../
npm install mochawesome-report-generator
- name: e2e/run-playright-tests-${{ runner.os }}
run: |
if [ ${{ runner.os }} == 'Linux' ]; then
export DISPLAY=:99
Xvfb $DISPLAY -screen 0 1280x960x24 > /dev/null 2>&1 &
fi
npm run build-test
cd e2e
npm run run:e2e || true # making job pass even if the tests fail due to flakyness
npm run send-report
env:
SERVER_VERSION: ${{ inputs.MM_SERVER_VERSION}}
DESKTOP_VERSION: ${{ inputs.DESKTOP_VERSION }}
- name: e2e/analyze-flaky-tests
id: analyze-flaky-tests
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
process.chdir('./e2e');
const { analyzeFlakyTests } = require('./utils/analyze-flaky-test.js');
const { commentBody, newFailedTests } = analyzeFlakyTests();
core.setOutput('COMMENT_BODY', commentBody);
if (newFailedTests.length > 0) {
core.setFailed('E2E tests failed.');
}