forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI][BWC] add BWC tests to github actions (opensearch-project#1624)
Add backwards compatibility tests to github workflow for PRs. Also, fix for checking status of OpenSearch Dashboards since api/status/ is not protected. Also, enable ability to create test data since migration from 1.0.0 to 3.0.0 is not supported for OpenSearch currently. Issue: opensearch-project#1465 opensearch-project#1651 Backport PR: opensearch-project#1624 Includes changes from: opensearch-project#1502 Signed-off-by: Kawika Avilla <[email protected]>
- Loading branch information
Showing
14 changed files
with
390 additions
and
18 deletions.
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 |
---|---|---|
|
@@ -23,9 +23,11 @@ env: | |
jobs: | ||
build-lint-test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 | ||
options: --user 1001 | ||
name: Build and Verify | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
|
@@ -61,6 +63,9 @@ jobs: | |
|
||
functional-tests: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 | ||
options: --user 1001 | ||
name: Run functional tests | ||
strategy: | ||
matrix: | ||
|
@@ -82,9 +87,9 @@ jobs: | |
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
# github virtual env is the latest chrome | ||
# image has the latest chrome v99 | ||
- name: Setup chromedriver | ||
run: yarn add --dev chromedriver@100.0.0 | ||
run: yarn add --dev chromedriver@99.0.0 | ||
|
||
- name: Run bootstrap | ||
run: yarn osd bootstrap | ||
|
@@ -100,3 +105,126 @@ jobs: | |
CI_PARALLEL_PROCESS_NUMBER: ciGroup${{ matrix.group }} | ||
JOB: ci${{ matrix.group }} | ||
CACHE_DIR: ciGroup${{ matrix.group }} | ||
|
||
build-min-artifact-tests: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 | ||
options: --user 1001 | ||
name: Build min release artifacts | ||
defaults: | ||
run: | ||
working-directory: ./artifacts | ||
strategy: | ||
matrix: | ||
include: | ||
- name: Linux x64 | ||
ext: tar.gz | ||
suffix: linux-x64 | ||
script: build-platform --linux --skip-os-packages | ||
- name: Linux ARM64 | ||
ext: tar.gz | ||
suffix: linux-arm64 | ||
script: build-platform --linux-arm --skip-os-packages | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ./artifacts | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version-file: "./artifacts/.nvmrc" | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Setup Yarn | ||
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
- name: Get package version | ||
run: | | ||
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV | ||
- name: Get artifact build name | ||
run: | | ||
echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $GITHUB_ENV | ||
- name: Run bootstrap | ||
run: yarn osd bootstrap | ||
|
||
- name: Build `${{ matrix.name }}` | ||
run: yarn ${{ matrix.script }} --release | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: success() | ||
with: | ||
name: ${{ matrix.suffix }}-${{ env.VERSION }} | ||
path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }} | ||
retention-days: 1 | ||
|
||
bwc-tests: | ||
needs: [ build-min-artifact-tests ] | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 | ||
options: --user 1001 | ||
name: Run backwards compatibility tests | ||
defaults: | ||
run: | ||
working-directory: ./artifacts | ||
strategy: | ||
matrix: | ||
version: [ osd-1.1.0,odfe-1.13.2,odfe-1.0.2,osd-2.0.0 ] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ./artifacts | ||
|
||
- run: echo Running backwards compatibility tests for version ${{ matrix.version }} | ||
- run: echo [NOTE] These tests will be ran using Linux x64 release builds without security | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version-file: "./artifacts/.nvmrc" | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Setup Yarn | ||
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
- name: Get package version | ||
run: | | ||
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV | ||
- name: Set OpenSearch URL | ||
run: | | ||
echo "OPENSEARCH_URL=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz" >> $GITHUB_ENV | ||
- name: Verify if OpenSearch is available for version | ||
id: verify-opensearch-exists | ||
run: | | ||
if curl -I -L ${{ env.OPENSEARCH_URL }}; then | ||
echo "::set-output name=version-exists::true" | ||
fi | ||
- name: Skipping tests | ||
if: steps.verify-opensearch-exists.outputs.version-exists != 'true' | ||
run: echo Tests were skipped because an OpenSearch release build does not exist for this version yet! | ||
|
||
- name: Download OpenSearch Dashboards | ||
uses: actions/download-artifact@v3 | ||
id: download | ||
with: | ||
name: linux-x64-${{ env.VERSION }} | ||
path: ./artifacts/ | ||
if: steps.verify-opensearch-exists.outputs.version-exists == 'true' | ||
|
||
- name: Run tests | ||
if: steps.verify-opensearch-exists.outputs.version-exists == 'true' | ||
run: | | ||
./bwctest.sh -s false -o ${{ env.OPENSEARCH_URL }} -d ${{ steps.download.outputs.download-path }}/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz |
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
86 changes: 86 additions & 0 deletions
86
cypress/integration/with-security/helpers/generate_data.js
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,86 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { | ||
MiscUtils, | ||
LoginPage, | ||
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
const loginPage = new LoginPage(cy); | ||
|
||
describe('Generating BWC test data with security', () => { | ||
beforeEach(() => { | ||
miscUtils.visitPage('app/management/opensearch-dashboards/settings'); | ||
loginPage.enterUserName('admin'); | ||
loginPage.enterPassword('admin'); | ||
loginPage.submit(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.clearCookies(); | ||
}); | ||
|
||
it('tenant-switch-modal page should show and be clicked', () => { | ||
cy.get('[data-test-subj="tenant-switch-modal"]'); | ||
cy.get('[data-test-subj="confirm"]').click(); | ||
}); | ||
|
||
it('adds advanced settings', () => { | ||
miscUtils.visitPage('app/management/opensearch-dashboards/settings'); | ||
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click(); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-defaultRoute"]') | ||
.clear() | ||
.type('/app/opensearch_dashboards_overview#/'); | ||
cy.get('[data-test-subj="advancedSetting-saveButton"]').click({ force: true }); | ||
cy.reload(); | ||
}); | ||
|
||
it('adds sample data', () => { | ||
miscUtils.addSampleData(); | ||
}); | ||
|
||
it('adds filters and queries', () => { | ||
miscUtils.visitPage('app/dashboards#'); | ||
cy.get('[data-test-subj="dashboardListingTitleLink-[Logs]-Web-Traffic"]').click(); | ||
cy.get('[data-test-subj="queryInput"]').clear().type('resp=200'); | ||
cy.get('[data-test-subj="addFilter"]').click(); | ||
cy.get('[data-test-subj="filterFieldSuggestionList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('machine.os{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterOperatorList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterParams"]') | ||
.find('input.euiFieldText[placeholder="Enter a value"]') | ||
.type('osx'); | ||
cy.get('[data-test-subj="createCustomLabel"]').click(); | ||
cy.get('[class="globalFilterItem__editorForm"]').find('input').last().type('osx filter'); | ||
cy.get('[data-test-subj="saveFilter"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover-button"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover"]') | ||
.find('[data-test-subj="saved-query-management-save-button"]') | ||
.click(); | ||
cy.get('[data-test-subj="saveQueryFormTitle"]').type('test-query'); | ||
cy.get('[data-test-subj="savedQueryFormSaveButton"]').click(); | ||
}); | ||
|
||
it('adds Timeline visualization', () => { | ||
miscUtils.visitPage('app/visualize#'); | ||
cy.get('[data-test-subj="visualizationLandingPage"]') | ||
.find('[data-test-subj="newItemButton"]') | ||
.click(); | ||
cy.get('[data-test-subj="visType-timelion"]').click(); | ||
cy.get('[data-test-subj="visualizeSaveButton"]').click(); | ||
cy.get('[data-test-subj="savedObjectTitle"]').type('test-timeline'); | ||
cy.get('[data-test-subj="confirmSaveSavedObjectButton"]').click(); | ||
}); | ||
}); |
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
69 changes: 69 additions & 0 deletions
69
cypress/integration/without-security/helpers/generate_data.js
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,69 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; | ||
|
||
const miscUtils = new MiscUtils(cy); | ||
|
||
describe('Generating BWC test data without security', () => { | ||
before(() => { | ||
miscUtils.visitPage('app'); | ||
}); | ||
it('adds advanced settings', () => { | ||
miscUtils.visitPage('app/management/opensearch-dashboards/settings'); | ||
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click(); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type( | ||
'{selectAll}4' | ||
); | ||
cy.get('[data-test-subj="advancedSetting-editField-defaultRoute"]') | ||
.clear() | ||
.type('/app/opensearch_dashboards_overview#/'); | ||
cy.get('[data-test-subj="advancedSetting-saveButton"]').click({ force: true }); | ||
cy.reload(); | ||
}); | ||
|
||
it('adds sample data', () => { | ||
miscUtils.addSampleData(); | ||
}); | ||
|
||
it('adds filters and queries', () => { | ||
miscUtils.visitPage('app/dashboards#'); | ||
cy.get('[data-test-subj="dashboardListingTitleLink-[Logs]-Web-Traffic"]').click(); | ||
cy.get('[data-test-subj="queryInput"]').clear().type('resp=200'); | ||
cy.get('[data-test-subj="addFilter"]').click(); | ||
cy.get('[data-test-subj="filterFieldSuggestionList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('machine.os{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterOperatorList"]') | ||
.find('[data-test-subj="comboBoxInput"]') | ||
.type('{downArrow}{enter}'); | ||
cy.get('[data-test-subj="filterParams"]') | ||
.find('input.euiFieldText[placeholder="Enter a value"]') | ||
.type('osx'); | ||
cy.get('[data-test-subj="createCustomLabel"]').click(); | ||
cy.get('[class="globalFilterItem__editorForm"]').find('input').last().type('osx filter'); | ||
cy.get('[data-test-subj="saveFilter"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover-button"]').click(); | ||
cy.get('[data-test-subj="saved-query-management-popover"]') | ||
.find('[data-test-subj="saved-query-management-save-button"]') | ||
.click(); | ||
cy.get('[data-test-subj="saveQueryFormTitle"]').type('test-query'); | ||
cy.get('[data-test-subj="savedQueryFormSaveButton"]').click(); | ||
}); | ||
|
||
it('adds Timeline visualization', () => { | ||
miscUtils.visitPage('app/visualize#'); | ||
cy.get('[data-test-subj="visualizationLandingPage"]') | ||
.find('[data-test-subj="newItemButton"]') | ||
.click(); | ||
cy.get('[data-test-subj="visType-timelion"]').click(); | ||
cy.get('[data-test-subj="visualizeSaveButton"]').click(); | ||
cy.get('[data-test-subj="savedObjectTitle"]').type('test-timeline'); | ||
cy.get('[data-test-subj="confirmSaveSavedObjectButton"]').click(); | ||
}); | ||
}); |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.