-
Notifications
You must be signed in to change notification settings - Fork 868
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
[CI] Cypress tests support ciGroups #5298
Merged
kavilla
merged 1 commit into
opensearch-project:main
from
kavilla:kavilla/cypress_ci_groups
Oct 13, 2023
Merged
Changes from all commits
Commits
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 |
---|---|---|
|
@@ -9,31 +9,29 @@ on: | |
workflow_dispatch: | ||
inputs: | ||
test_repo: | ||
description: 'Test repo' | ||
description: 'Cypress test repo' | ||
default: 'opensearch-project/opensearch-dashboards-functional-test' | ||
required: true | ||
type: string | ||
test_branch: | ||
description: 'Test branch (default: source branch)' | ||
description: 'Cypress test branch (default: source branch)' | ||
required: false | ||
type: string | ||
pr_number: | ||
description: 'PR Number' | ||
required: false | ||
type: number | ||
specs: | ||
description: 'Tests to run (default: core)' | ||
default: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' | ||
description: 'Tests to run (default: osd:ciGroup)' | ||
required: false | ||
type: string | ||
pr_number: | ||
description: 'PR Number (optional)' | ||
required: false | ||
type: number | ||
|
||
env: | ||
TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }} | ||
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}" | ||
FTR_PATH: 'ftr' | ||
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch' | ||
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true' | ||
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false' | ||
SPEC: ${{ inputs.specs != '' && inputs.specs || 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' }} | ||
CYPRESS_BROWSER: 'chromium' | ||
CYPRESS_VISBUILDER_ENABLED: true | ||
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false | ||
|
@@ -46,6 +44,10 @@ env: | |
jobs: | ||
cypress-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
group: [1, 2, 3, 4, 5, 6, 7, 8, 9] | ||
container: | ||
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 | ||
options: --user 1001 | ||
|
@@ -54,7 +56,7 @@ jobs: | |
CI: 1 | ||
# avoid warnings like "tput: No value for $TERM and no -T specified" | ||
TERM: xterm | ||
name: Run cypress tests | ||
name: Run cypress tests (osd:ciGroup${{ matrix.group }}) | ||
steps: | ||
- name: Get source information from PR number | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }} | ||
|
@@ -97,7 +99,7 @@ jobs: | |
run: yarn osd bootstrap | ||
|
||
- name: Build plugins | ||
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 | ||
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 12 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -106,6 +108,23 @@ jobs: | |
repository: ${{ env.TEST_REPO }} | ||
ref: '${{ env.TEST_BRANCH }}' | ||
|
||
- name: Setup spec files by input | ||
if: ${{ inputs.specs != '' }} | ||
run: | | ||
echo "SPEC=${{ inputs.specs }}" >> $GITHUB_ENV | ||
|
||
- name: Setup spec files | ||
if: ${{ inputs.specs == '' }} | ||
working-directory: ${{ env.FTR_PATH }} | ||
shell: bash | ||
run: | | ||
IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.group }}) | ||
FORMATTED_SPEC='' | ||
for i in "${SPEC_ARRAY[@]}"; do | ||
FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/opensearch-dashboards/${i}," | ||
done | ||
echo "SPEC=${FORMATTED_SPEC}" >> $GITHUB_ENV | ||
|
||
- name: Get Cypress version | ||
id: cypress_version | ||
run: | | ||
|
@@ -179,8 +198,6 @@ jobs: | |
|
||
#### Inputs: | ||
``` | ||
Source repo: '${{ env.SOURCE_REPO }}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got rid of this because unless set at a file level github env variables do not share between jobs. This information is already available within the test run. |
||
Source branch: '${{ env.SOURCE_BRANCH }}' | ||
Test repo: '${{ env.TEST_REPO }}' | ||
Test branch: '${{ env.TEST_BRANCH }}' | ||
|
||
|
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
Oops, something went wrong.
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.
@manasvinibs we should consider be able to distributing a common config like selenium tests.