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

Backport/backport lots of prs for discover 2.0 #9218

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/test/fixtures/scenarios
node_modules
target
cypress/fixtures

!/.eslintrc.js

Expand Down
48 changes: 22 additions & 26 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ jobs:
- group: 9
config: standard
test_location: ftr
# Query enhanced tests
# Dashboard tests with query enhanced
- group: 10
config: query_enhanced
test_location: ftr
# Dashboard tests
test_location: source
# Dashboard tests with no query enhanced
- group: 11
config: dashboard
test_location: source
Expand All @@ -90,7 +90,7 @@ jobs:
options: --user 1001
env:
START_CMD: ${{ matrix.config == 'query_enhanced' &&
'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 --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=true --uiSettings.overrides[''home:useNewHomePage'']=true --data_source.enabled=true --opensearch.ignoreVersionMismatch=true' ||
'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 --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=true --uiSettings.overrides[''home:useNewHomePage'']=true --data_source.enabled=true --workspace.enabled=true --opensearch.ignoreVersionMismatch=true --data.savedQueriesNewUI.enabled=true' ||
matrix.config == 'dashboard' &&
'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' ||
'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 --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=false' }}
Expand Down Expand Up @@ -177,12 +177,9 @@ jobs:
if: ${{ inputs.specs == '' && matrix.test_location == 'source' }}
shell: bash
run: |
IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.group }})
DASHBOARDS_SPEC=''
for i in "${SPEC_ARRAY[@]}"; do
DASHBOARDS_SPEC+="cypress/integration/core_opensearch_dashboards/${i},"
done
DASHBOARDS_SPEC="$(yarn --silent osd:ciGroup${{ matrix.group }})"
echo "DASHBOARDS_SPEC=${DASHBOARDS_SPEC}" >> $GITHUB_ENV
echo "DASHBOARDS_SPEC=${DASHBOARDS_SPEC}"

- name: Get Cypress version
id: cypress_version
Expand All @@ -201,8 +198,8 @@ jobs:
- run: npx cypress cache path

# Run tests based on configuration
- name: Run FT repo tests with no query enhancements
if: matrix.test_location == 'ftr' && matrix.config == 'standard'
- name: Run FT repo tests
if: matrix.test_location == 'ftr'
uses: cypress-io/github-action@v2
with:
working-directory: ${{ env.FTR_PATH }}
Expand All @@ -211,48 +208,47 @@ jobs:
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}

- name: Download OpenSearch
if: matrix.test_location == 'ftr' && matrix.config == 'query_enhanced'
if: matrix.config == 'query_enhanced'
uses: suisei-cn/[email protected]
with:
url: https://artifacts.opensearch.org/releases/bundle/opensearch/${{ env.LATEST_VERSION }}/opensearch-${{ env.LATEST_VERSION }}-linux-x64.tar.gz

- name: Extract OpenSearch
if: matrix.test_location == 'ftr' && matrix.config == 'query_enhanced'
if: matrix.config == 'query_enhanced'
run: |
tar -xzf opensearch-*.tar.gz
rm -f opensearch-*.tar.gz
shell: bash

- name: Remove security plugin
if: matrix.test_location == 'ftr' && matrix.config == 'query_enhanced'
if: matrix.config == 'query_enhanced'
run: |
/bin/bash -c "yes | ./opensearch-${{ env.LATEST_VERSION }}/bin/opensearch-plugin remove opensearch-security"
shell: bash

- name: Run OpenSearch
if: matrix.test_location == 'ftr' && matrix.config == 'query_enhanced'
if: matrix.config == 'query_enhanced'
run: |
/bin/bash -c "./opensearch-2.17.0/opensearch-tar-install.sh &"
sleep 30
shell: bash

- name: Run FT repo tests with query enhancements
if: matrix.test_location == 'ftr' && matrix.config == 'query_enhanced'
uses: cypress-io/github-action@v2
with:
working-directory: ${{ env.FTR_PATH }}
start: ${{ env.START_CMD }}
wait-on: 'http://localhost:9200, http://localhost:5601'
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}

# Clear Cypress Cache before running Dashboards tests
- name: Clear Cypress Cache
if: matrix.test_location == 'source'
run: npx cypress cache clear

# Run Dashboards Cypress tests within the source repo
- name: Run Dashboards Cypress tests
if: matrix.test_location == 'source'
- name: Run Dashboards Cypress tests with query enhancements
if: matrix.test_location == 'source' && matrix.config == 'query_enhanced'
uses: cypress-io/github-action@v6
with:
install-command: npx cypress install --force
start: ${{ env.START_CMD }}
wait-on: 'http://localhost:9200, http://localhost:5601'
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.DASHBOARDS_SPEC }}
- name: Run Dashboards Cypress tests without query enhancements
if: matrix.test_location == 'source' && matrix.config == 'dashboard'
uses: cypress-io/github-action@v6
with:
install-command: npx cypress install --force
Expand Down
148 changes: 148 additions & 0 deletions .github/workflows/cypress_workflow_with_s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Run cypress tests with S3

# trigger once PR has been merged
on:
push:
branches: ['main', '[0-9]+\.x', '[0-9]+\.[0-9]+']
paths-ignore:
- '**/*.md'
- '.lycheeignore'
- 'changelogs/fragments/**'
workflow_dispatch:
inputs:
test_repo:
description: 'Cypress test repo'
default: 'opensearch-project/opensearch-dashboards-functional-test'
required: true
type: string
test_branch:
description: 'Cypress test branch (default: source branch)'
required: false
type: string
specs:
description: 'Tests to run (default: osd:ciGroup10)'
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'
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
NODE_OPTIONS: '--max-old-space-size=6144 --dns-result-order=ipv4first'
LATEST_VERSION: '2.17.0'

jobs:
cypress-tests:
runs-on: ubuntu-latest
environment: flint-test
container:
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
options: --user 1001
env:
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 --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=true --uiSettings.overrides[''home:useNewHomePage'']=true --data_source.enabled=true --workspace.enabled=true --opensearch.ignoreVersionMismatch=true'
OPENSEARCH_SNAPSHOT_CMD: '/bin/bash -c "./opensearch-2.17.0/opensearch-tar-install.sh &"'
name: Run cypress tests (osd:ciGroup10)
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g [email protected]

- name: Run bootstrap
run: yarn osd bootstrap

- name: Build plugins
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 12

- name: Checkout FT repo
uses: actions/checkout@v2
with:
path: ${{ env.FTR_PATH }}
repository: ${{ env.TEST_REPO }}
ref: '${{ env.TEST_BRANCH }}'

- name: Setup spec files
if: ${{ inputs.specs == '' }}
shell: bash
run: |
DASHBOARDS_SPEC="$(yarn --silent osd:ciGroup10)"
echo "DASHBOARDS_SPEC=${DASHBOARDS_SPEC}" >> $GITHUB_ENV
echo "DASHBOARDS_SPEC=${DASHBOARDS_SPEC}"

- name: Download OpenSearch
uses: suisei-cn/[email protected]
with:
url: https://artifacts.opensearch.org/releases/bundle/opensearch/${{ env.LATEST_VERSION }}/opensearch-${{ env.LATEST_VERSION }}-linux-x64.tar.gz

- name: Extract OpenSearch
run: |
tar -xzf opensearch-*.tar.gz
rm -f opensearch-*.tar.gz
shell: bash

- name: Remove security plugin
run: |
/bin/bash -c "yes | ./opensearch-${{ env.LATEST_VERSION }}/bin/opensearch-plugin remove opensearch-security"
shell: bash

- name: Run OpenSearch
run: |
/bin/bash -c "./opensearch-2.17.0/opensearch-tar-install.sh &"
sleep 30
shell: bash

- name: Clear Cypress Cache
run: npx cypress cache clear

- name: Run Dashboards Cypress tests with query enhancements
uses: cypress-io/github-action@v6
env:
S3_CONNECTION_URL: ${{ secrets.S3_CONNECTION_URL }}
S3_CONNECTION_USERNAME: ${{ secrets.S3_CONNECTION_USERNAME }}
S3_CONNECTION_PASSWORD: ${{ secrets.S3_CONNECTION_PASSWORD }}
with:
install-command: npx cypress install --force
start: ${{ env.START_CMD }}
wait-on: 'http://localhost:9200, http://localhost:5601'
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.DASHBOARDS_SPEC }}

- name: Upload Dashboards screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: dashboards-cypress-screenshots-10
path: cypress/screenshots
retention-days: 1

- name: Upload Dashboards repo videos
uses: actions/upload-artifact@v4
if: always()
with:
name: dashboards-cypress-videos-10
path: cypress/videos
retention-days: 1

- name: Upload Dashboards repo results
uses: actions/upload-artifact@v4
if: always()
with:
name: dashboards-cypress-results-10
path: cypress/results
retention-days: 1
20 changes: 10 additions & 10 deletions .github/workflows/links_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ name: Link Checker

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
linkchecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lychee Link Checker
uses: lycheeverse/lychee-action@v1
with:
fail: true
args: --accept=200,403,429 --base . --retry-wait-time=15 --max-retries=5 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" "**/*.js" "**/*.ts" "**/*.tsx"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- uses: actions/checkout@v4
- name: Lychee Link Checker
uses: lycheeverse/lychee-action@v1
with:
fail: true
args: --accept=200,403,429 --base . --retry-wait-time=15 --max-retries=5 --exclude-path cypress/fixtures "**/*.html" "**/*.md" "**/*.txt" "**/*.json" "**/*.js" "**/*.ts" "**/*.tsx"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ target
/test/*/screenshots/failure
/test/*/screenshots/session
/test/*/screenshots/visual_regression_gallery.html
cypress/videos/*
cypress/screenshots/*
/html_docs
.eslintcache
/data
Expand Down Expand Up @@ -70,4 +72,4 @@ snapshots.js
.yarn-local-mirror

# Ignore the generated antlr files
/src/plugins/data/public/antlr/**/grammar/.antlr/
/src/plugins/data/public/antlr/**/grammar/.antlr/
2 changes: 2 additions & 0 deletions changelogs/fragments/8799.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Discover] Makes cachign dataset options optional and configurable by the dataset type ([#8799](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8799))
2 changes: 2 additions & 0 deletions changelogs/fragments/8926.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chore:
- Update cypress to v12 ([#8926](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8926))
2 changes: 2 additions & 0 deletions changelogs/fragments/8993.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Support imports without extensions in cypress webpack build ([#8993](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8993))
2 changes: 2 additions & 0 deletions changelogs/fragments/9048.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Migrate query enhancement cypress tests to OSD repo ([#9048](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9048))
2 changes: 2 additions & 0 deletions changelogs/fragments/9074.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Query-enhancements testing utility updates and additions ([#9074](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9074))
2 changes: 2 additions & 0 deletions changelogs/fragments/9079.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chore:
- Use relative paths in cypress utilities ([#9079](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9079))
2 changes: 2 additions & 0 deletions changelogs/fragments/9082.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Re-enable dataset_selector.spec.js under workspace in ciGroup10 ([#9082](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9082))
2 changes: 2 additions & 0 deletions changelogs/fragments/9112.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add tests for saving search and loading it ([#9112](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9112))
2 changes: 2 additions & 0 deletions changelogs/fragments/9113.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Adding Cypress Tests for S3 Datasets ([#9113](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9113))
2 changes: 2 additions & 0 deletions changelogs/fragments/9119.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add cypress integration test for the new Data Explorer UI's Filtering. ([#9119](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9119))
2 changes: 2 additions & 0 deletions changelogs/fragments/9129.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Make createWorkspaceIndexPatterns to handle no default cluster and clean up ([#9129](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9129))
2 changes: 2 additions & 0 deletions changelogs/fragments/9151.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add tests for updating a saved search ([#9151](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9151))
2 changes: 2 additions & 0 deletions changelogs/fragments/9153.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- 0 rendered in discover when there are no results ([#9153](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9153))
2 changes: 2 additions & 0 deletions changelogs/fragments/9166.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
- Add cypress integration test for the old and new UI view saved queries. ([#9166](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9166))
2 changes: 1 addition & 1 deletion config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@

# Set the backend roles in groups or users, whoever has the backend roles or exactly match the user ids defined in this config will be regard as dashboard admin.
# Dashboard admin will have the access to all the workspaces(workspace.enabled: true) and objects inside OpenSearch Dashboards.
# The default config is [], and no one will be dashboard admin.
# The default config is [], and no one will be dashboard admin.
# If the user config is set to wildcard ["*"], anyone will be dashboard admin.
# opensearchDashboards.dashboardAdmin.groups: ["dashboard_admin"]
# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
Expand Down
Loading
Loading