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

PMM-7 fix portal pipeline #652

Merged
merged 70 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
86631c7
Fix pipelines triggers
peterSirotnak Feb 20, 2023
f5c4704
Fixes the pipeline
peterSirotnak Feb 20, 2023
d2d70f6
correct versions in upgrade
peterSirotnak Feb 20, 2023
ea341b9
fix server version
peterSirotnak Feb 20, 2023
dee5a89
check versions
peterSirotnak Feb 20, 2023
a17b31e
check
peterSirotnak Feb 20, 2023
2abb576
revert changes
peterSirotnak Feb 20, 2023
50a94aa
Merge branch 'PMM-7-fix-portal-pipeline' of https://github.com/percon…
peterSirotnak Feb 20, 2023
8d2c60a
Fix trigger for the pipeline
peterSirotnak Feb 21, 2023
da49d61
Delete pmm-portal-tests.yml
Jun 29, 2023
91decae
Delete pmm-portal-upgrade-tests.yml
Jun 29, 2023
1a0f815
Merge branch 'main' into PMM-7-fix-portal-pipeline
Jun 29, 2023
b01561d
Merge branch 'main' into PMM-7-fix-portal-pipeline
Jul 5, 2023
d9c4015
PMM-7 fixed outdated changes
Jul 5, 2023
46acb32
PMM-7 fixed outdated changes
Jul 5, 2023
bdd28bd
PMM-7 added portal upgrade
Jul 5, 2023
b5ae7df
PMM-7 added portal upgrade
Jul 5, 2023
0956580
PMM-7 fixed conditionals and matrix flow
Jul 5, 2023
6ed4b7e
PMM-7 removed sha error
Jul 5, 2023
bf163df
PMM-7 syntax fix
Jul 5, 2023
ce12a17
PMM-7 fixed empty sha error
Jul 6, 2023
42dfef1
Merge branch 'main' into PMM-7-fix-portal-pipeline
Jul 6, 2023
24e8d99
PMM-7 fixed conflicts
Jul 6, 2023
5629b5a
PMM-7 disabled portal upgrade
Jul 6, 2023
00c5642
PMM-7 removed reties and trace
Jul 7, 2023
9260df8
PMM-7 add eslint and format files, update codeowners
yurkovychv Jul 7, 2023
9e8fb94
PMM-7 update libs
yurkovychv Jul 7, 2023
e536c1f
PMM-7 update libs
yurkovychv Jul 7, 2023
0fa1d0a
PMM-7 update libs
yurkovychv Jul 7, 2023
6028dcb
PMM-7 update libs
yurkovychv Jul 7, 2023
e130fac
PMM-7 fixed eslint plugins
Jul 7, 2023
40885f8
Merge remote-tracking branch 'origin/PMM-7-fix-portal-pipeline' into …
Jul 7, 2023
47550a6
PMM-7 fixed eslint plugins
Jul 7, 2023
209fd19
PMM-7 linter fixes
Jul 7, 2023
8d2e080
Merge branch 'main' into PMM-7-fix-portal-pipeline
yurkovychv Jul 26, 2023
927cd06
Merge branch 'main' into PMM-7-fix-portal-pipeline
Aug 7, 2023
ce6b958
PMM-7 Added base portal refactoring
Aug 16, 2023
09b1b35
Merge remote-tracking branch 'origin/main' into PMM-7-fix-portal-pipe…
Aug 16, 2023
af975d4
PMM-7 Added matrix for test
Aug 16, 2023
ef5f431
PMM-7 Added matrix for test
Aug 16, 2023
0e62d05
PMM-7 fixed versions for matrix
Aug 16, 2023
0b89b4f
PMM-7 fixed versions for matrix
Aug 16, 2023
ef9f6ee
PMM-7 fixed versions for matrix
Aug 16, 2023
0fa8ec1
PMM-7 fixed syntax
Aug 16, 2023
32bbac9
PMM-7 added tests
Aug 16, 2023
041a9e5
PMM-7 fixed more tests
Aug 16, 2023
6436096
PMM-7 fixed syntax
Aug 16, 2023
8823099
PMM-7 fixed syntax
Aug 16, 2023
05b9bd6
PMM-7 removed retries
Aug 16, 2023
9efffda
PMM-7 annotations push clean up
Aug 16, 2023
b34c113
PMM-7 fixed jobs vars
Aug 16, 2023
0dab673
PMM-7 fixed jobs vars
Aug 16, 2023
02035f8
PMM-7 fixed jobs vars
Aug 16, 2023
510d662
PMM-7 fixed skip
Aug 16, 2023
f093e5d
PMM-7 fixed skip 2
Aug 16, 2023
769d8de
PMM-7 fixed skip 2
Aug 16, 2023
dc48937
PMM-7 skipping SSO tests
Aug 16, 2023
3474af3
PMM-7 skipping file
Aug 16, 2023
d98aa63
PMM-7 refactored portal errors
Aug 16, 2023
ab4f2a7
PMM-7 adjusted test pipelines
Aug 16, 2023
307bbc1
PMM-7 adjusted test pipelines
Aug 17, 2023
a3fd444
PMM-7 adjusted test pipelines
Aug 17, 2023
07fcb4b
PMM-7 added portal setup
Aug 17, 2023
b15c5bf
PMM-7 huge file names refactoring
Aug 18, 2023
7db022f
PMM-7 added fixtures
Aug 21, 2023
b77dc22
PMM-7 debug clean up
Aug 21, 2023
bfc7511
PMM-7 added auth method
Aug 21, 2023
af0862b
Merge branch 'main' into PMM-7-fix-portal-pipeline
Aug 21, 2023
b2f771e
PMM-7 styling fixes
Aug 21, 2023
4132de0
PMM-7 fixed file name
Aug 21, 2023
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
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"browser": true
},
"root": true,
"plugins": ["eslint-plugin-no-inline-styles"],
"rules": {
"comma-dangle": [
"error",
Expand Down
68 changes: 37 additions & 31 deletions .github/workflows/pmm-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:

steps:
- name: PMM server version ${{ inputs.pmm_server_version }} and UI tests for flag "${{ inputs.pmm_test_flag }}" and pmm-ui-tests branch ${{ inputs.pmm_ui_tests_branch }}
uses: percona-platform/github-status-action@v1
if: ${{ github.event_name != 'pull_request' }}
if: ${{ env.SHA != 'null' }}
uses: percona/gh-action-Sibz-github-status-action@v1
continue-on-error: true
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -116,34 +116,37 @@ jobs:
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
sha: ${{ env.SHA }}

- name: Checkout UI tests
- name: 'Checkout UI tests: "${{ inputs.pmm_ui_tests_branch }}"'
uses: actions/checkout@v3
with:
ref: ${{ env.UI_TESTS_BRANCH }}
ref: ${{ inputs.pmm_ui_tests_branch }}
repository: percona/pmm-ui-tests
path: ./pmm-ui-tests

- name: Checkout pmm-qa Repo
- name: 'Install playwright'
working-directory: ./pmm-ui-tests/playwright-tests
run: |
npm install
npx playwright install

- name: 'Checkout pmm-qa: "${{ inputs.pmm_qa_branch }}"'
uses: actions/checkout@v3
with:
# token: ${{ secrets.ROBOT_TOKEN }}
repository: percona/pmm-qa
ref: ${{ inputs.pmm_qa_branch }}
path: ./pmm-qa
ref: ${{ env.PMM_QA_BRANCH }}

- name: Setup PMM-Sever
- name: 'Setup <PMM Sever>: "${{ inputs.pmm_server_version }}"'
working-directory: pmm-qa/pmm-integration
run: |
npm install
sudo npx ts-node ./integration-setup.ts --ci --setup-docker-pmm-server --rbac --pmm-server-docker-tag=${{ env.PMM_SERVER_VERSION }} --pmm-client-version=${{ env.PMM_CLIENT_VERSION }}
timeout 100 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost/ping)" != "200" ]]; do sleep 5; done' || false

- name: Health check for PMM2-server
run: timeout 100 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost/ping)" != "200" ]]; do sleep 5; done' || false

- name: Setup Client for PMM-Server
- name: 'Setup <PMM Client: ${{ inputs.pmm_client_version }}>'
run: |
sudo bash ./pmm-qa/pmm-tests/pmm2-client-setup.sh --pmm_server_ip 127.0.0.1 --client_version ${{ env.PMM_CLIENT_VERSION }} --admin_password admin --use_metrics_mode no

shell: bash

- name: Setup Databases for the PMM-Server
Expand All @@ -160,35 +163,38 @@ jobs:
id: ui-tests-all
working-directory: pmm-ui-tests
run: |
npm install
npx playwright install
npx playwright test --config="playwright-tests/playwright.config.ts"
env:
NODE_TLS_REJECT_UNAUTHORIZED: 0
npx playwright test --config="playwright-tests/playwright.config.ts" --quiet
# env:
# NODE_TLS_REJECT_UNAUTHORIZED: 0

- name: Execute Flagged UI tests
- name: 'Run UI tests: ${{ env.PMM_TEST_FLAG }}'
if: ${{ inputs.pmm_test_flag != 'null' }}
id: ui-tests-flagged
working-directory: pmm-ui-tests
run: |
npm install
npx playwright install
npx playwright test --config="playwright-tests/playwright.config.ts" --grep="${{ env.PMM_TEST_FLAG }}"
env:
NODE_TLS_REJECT_UNAUTHORIZED: 0
npx playwright test --config="playwright-tests/playwright.config.ts" --grep="${{ env.PMM_TEST_FLAG }}" --quiet
# env:
# NODE_TLS_REJECT_UNAUTHORIZED: 0

- name: 'Create report name'
if: failure()
run: |
# TODO: add job id for matrix call
job_tag=$(echo "${{ inputs.pmm_test_flag }}" | sed -e "s/-pre-upgrade//" -e "s/@//")
report_name="$job_tag"-report
echo $report_name
echo "REPORT_NAME=$report_name" >> $GITHUB_ENV

- name: Generate and Attach the report
if: ${{ always() && steps.ui-tests.outcome != 'skipped' }}
uses: percona-platform/upload-artifact@v3
if: failure()
uses: actions/upload-artifact@v3
with:
name: ui-tests-videos-screenshots
path: |
pmm-ui-tests/playwright-report/data/*webm
pmm-ui-tests/playwright-report/data/*png
name: ${{ env.REPORT_NAME }}
path: ./pmm-ui-tests/playwright-tests/playwright-report

- name: Create status check
uses: percona-platform/github-status-action@v1
if: ${{ github.event_name != 'pull_request' && always() }}
uses: percona/gh-action-Sibz-github-status-action@v1
if: ${{ env.SHA != 'null' && always() }}
continue-on-error: true
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
Expand Down
29 changes: 20 additions & 9 deletions .github/workflows/pmm-upgrade-ui-tests-matrix-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,41 @@ jobs:
version_string_from: ${{needs.get_versions.outputs.start_version}}
version_string_to: ${{needs.get_versions.outputs.finish_version}}

# TODO: add / in the job names for good sub-jobs grouping
# portal:
# name: Portal
# ### '/' in the job name is for good sub-jobs grouping
# name: Portal / Portal
# uses: ./.github/workflows/upgrade-tests-pipeline.yml
# secrets: inherit
# needs: get_versions
# strategy:
# fail-fast: false
# matrix:
# old_version: ${{ fromJSON(needs.get_versions.outputs.version_matrix) }}
# upgrade_type: [ "UI way", "Docker way" ]
# with:
# pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch }}
# pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'main' }}
# pre_upgrade_tests: '@pre-pmm-portal-upgrade'
# post_upgrade_tests: '@post-pmm-portal-upgrade'
# pmm_server_start_version: ${{ inputs.pmm_server_start_version }}
# pmm_client_start_version: ${{ inputs.pmm_client_start_version }}
# upgrade_type: ${{ inputs.upgrade_type }}
# pmm_qa_branch: ${{ inputs.pmm_qa_branch }}
# pmm_server_start_version: ${{ matrix.old_version }}
# pmm_client_start_version: ${{ matrix.old_version }}
# upgrade_type: ${{ matrix.upgrade_type }}
# pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }}
# services_list: ''
# repository: ${{ inputs.repository }}
# repository: ${{ inputs.repository || 'dev-latest'}}
# version_string_from: ${{needs.get_versions.outputs.start_version}}
# version_string_to: ${{needs.get_versions.outputs.finish_version}}
#

# inventory:
# # TODO: add / in the job names for good sub-jobs grouping
# name: 'Inventory'
# uses: ./.github/workflows/upgrade-tests-pipeline.yml
# secrets: inherit
# needs: get_versions
# strategy:
# fail-fast: false
# matrix:
# old_version: ${{ fromJSON(needs.get_versions.outputs.version_matrix) }}
# upgrade_type: [ "UI way", "Docker way" ]
# with:
# pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch }}
# pre_upgrade_tests: '@inventory-pre-upgrade'
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/portal-tests-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Portal Tests Matrix"

on:
push:
branches:
- "PMM-7-fix-portal-pipeline"
vyarosh marked this conversation as resolved.
Show resolved Hide resolved

jobs:
get_versions:
name: Get versions
uses: ./.github/workflows/pmm-version-getter.yml
with:
repository: ${{ inputs.repository || 'dev-latest'}}
matrix_range: 5

portal:
name: 'Portal / Integration'
uses: ./.github/workflows/portal-ui-tests.yml
secrets: inherit
needs: get_versions
strategy:
fail-fast: false
matrix:
old_version: ${{ fromJSON(needs.get_versions.outputs.version_matrix) }}
with:
pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'main' }}
pmm_test_flag: '@portal'
pmm_server_version: ${{ matrix.old_version }}
pmm_client_version: ${{ matrix.old_version }}
pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }}
pmm_clients: ''
version_string_from: ${{needs.get_versions.outputs.start_version}}

167 changes: 167 additions & 0 deletions .github/workflows/portal-ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
---
name: portal-ui-tests

on:
workflow_call:
inputs:
pmm_ui_tests_branch:
description: 'Target branch for pmm-ui-tests repository'
type: string
default: 'main'
pmm_test_flag:
description: 'Flag to run only specific portion of the tests.'
type: string
pmm_server_version:
description: 'Version of the pmm server used for testing'
type: string
default: 'dev-latest'
required: true
pmm_client_version:
description: 'Version of the pmm client used for testing'
type: string
default: 'dev-latest'
required: true
pmm_clients:
description: 'Clients for pmm-server'
type: string
default: '--addclient=ps,1'
pmm_qa_branch:
description: 'Branch for the pmm-qa repository.'
type: string
default: 'main'
version_string_from:
description: 'start version string'
type: string

push:
branches:
- "PMM-7-fix-portal-pipeline"

jobs:
tests:
name: ${{ inputs.version_string_from || inputs.pmm_server_version || 'dev-latest' }}
runs-on: ubuntu-latest
timeout-minutes: 60
env:
SHA: ${{ inputs.sha || 'null' }}
PMM_BASE_URL: https://127.0.0.1
ADMIN_PASSWORD: admin

UI_TESTS_BRANCH: "PMM-7-fix-portal-pipeline"
PMM_CLIENTS: ${{ inputs.pmm_clients || '' }}
PMM_TEST_FLAG: ${{ inputs.pmm_test_flag || '@portal' }}

PMM_SERVER_VERSION: ${{ inputs.pmm_server_version || 'dev-latest' }}
PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || 'dev-latest' }}
PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch || 'main' }}

OKTA_TOKEN: ${{ secrets.OKTA_TOKEN }}
OAUTH_ISSUER_URL: 'https://id-dev.percona.com/oauth2/aus15pi5rjdtfrcH51d7'
OAUTH_CLIENT_ID: ${{ secrets.OKTA_OAUTH_CLIENT_ID }}
OAUTH_CLIENT_SECRET: ${{ secrets.OKTA_OAUTH_CLIENT_SECRET }}
OAUTH_PMM_CLIENT_ID: ${{ secrets.OKTA_OAUTH_PMM_CLIENT_ID }}
OAUTH_PMM_CLIENT_SECRET: ${{ secrets.OKTA_OAUTH_PMM_CLIENT_SECRET }}
OAUTH_DEV_HOST: ${{ secrets.OAUTH_DEV_HOST }}
OAUTH_SCOPES: percona

# Variables for E2E tests
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
MAILOSAUR_UI_TESTS_SERVER_ID: ${{ secrets.MAILOSAUR_UI_TESTS_SERVER_ID }}
MAILOSAUR_API_TESTS_SERVER_ID: ${{ secrets.MAILOSAUR_API_TESTS_SERVER_ID }}

SERVICENOW_LOGIN: percona_platform
SERVICENOW_PASSWORD: ${{ secrets.SERVICENOW_PASSWORD }}
SERVICENOW_DEV_URL: 'https://perconadev.service-now.com/api/x_pellc_percona_pl/platform/settest'

steps:
- name: PMM server version ${{ env.PMM_SERVER_VERSION }} and UI tests for flag "${{ env.PMM_TEST_FLAG }}" and pmm-ui-tests branch ${{ env.UI_TESTS_BRANCH }}
if: ${{ env.SHA != 'null' }}
uses: percona/gh-action-Sibz-github-status-action@v1
continue-on-error: true
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: "${{ env.PMM_TEST_FLAG }} UI tests"
description: "Test execution ${{ job.status }}"
state: "pending"
repository: ${{ github.repository }}
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
sha: ${{ env.SHA }}

- name: 'Checkout UI tests: "${{ env.UI_TESTS_BRANCH }}"'
uses: actions/checkout@v3
with:
ref: ${{ env.UI_TESTS_BRANCH }}
repository: percona/pmm-ui-tests
path: ./pmm-ui-tests

- name: 'Install playwright'
working-directory: ./pmm-ui-tests/playwright-tests
run: |
npm ci
npx playwright install

- name: 'Checkout pmm-qa: "${{ env.PMM_QA_BRANCH }}"'
uses: actions/checkout@v3
with:
repository: percona/pmm-qa
ref: ${{ env.PMM_QA_BRANCH }}
path: ./pmm-qa

- name: 'Setup <PMM Sever>: "${{ env.PMM_SERVER_VERSION }}"'
working-directory: pmm-qa/pmm-integration
run: |
npm install
sudo npx ts-node ./integration-setup.ts --ci --setup-docker-pmm-server --rbac --pmm-server-docker-tag=${{ format('perconalab/pmm-server:{0}', env.PMM_SERVER_VERSION) }} --pmm-client-version=${{ env.PMM_CLIENT_VERSION }}
timeout 100 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost/ping)" != "200" ]]; do sleep 5; done' || false

- name: 'Setup <PMM Client: ${{ inputs.pmm_client_version }}>'
run: |
sudo bash ./pmm-qa/pmm-tests/pmm2-client-setup.sh --pmm_server_ip 127.0.0.1 --client_version ${{ env.PMM_CLIENT_VERSION }} --admin_password admin --use_metrics_mode no
shell: bash

- name: Setup Databases for the PMM-Server
working-directory: pmm-qa/pmm-integration
run: |
sudo npx ts-node ./integration-setup.ts --ci \
${{ env.PMM_CLIENTS }}
sleep 30
sudo pmm-admin list
shell: bash

- name: 'Run UI tests: ${{ env.PMM_TEST_FLAG }}'
if: ${{ inputs.pmm_test_flag != 'null' }}
id: ui-tests-flagged
working-directory: pmm-ui-tests/playwright-tests
run: |
npx playwright test --config="playwright.config.ts" --grep="${{ env.PMM_TEST_FLAG }}"
# env:
# NODE_TLS_REJECT_UNAUTHORIZED: 0

- name: 'Create report name'
if: failure()
run: |
# TODO: add job id for matrix call
job_tag=$(echo "${{ env.PMM_TEST_FLAG }}" | sed -e "s/-pre-upgrade//" -e "s/@//")
report_name=${{ env.PMM_SERVER_VERSION }}"$job_tag"-report
echo $report_name
echo "REPORT_NAME=$report_name" >> $GITHUB_ENV

- name: Generate and Attach the report
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ env.REPORT_NAME }}
path: ./pmm-ui-tests/playwright-tests/playwright-report

- name: Create status check
uses: percona/gh-action-Sibz-github-status-action@v1
if: ${{ env.SHA != 'null' && always() }}
continue-on-error: true
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: "${{ env.PMM_TEST_FLAG }} UI tests"
description: "Test execution ${{ job.status }}"
state: ${{ job.status }}
repository: ${{ github.repository }}
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
sha: ${{ env.SHA }}
Loading
Loading