Skip to content

Commit

Permalink
Merge branch 'main' into backport/backport-1102-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
Hailong-am authored Mar 19, 2024
2 parents ba632f4 + 424f59c commit 9c2fc68
Show file tree
Hide file tree
Showing 25 changed files with 260 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/alerting-release-e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: Alerting
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/alerting-dashboards-plugin/*'
test-command: env CYPRESS_NO_COMMAND_LOG=1 yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/alerting-dashboards-plugin/*'
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: Anomaly Detection
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/anomaly-detection-dashboards-plugin/*'
test-command: env CYPRESS_NO_COMMAND_LOG=1 yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/anomaly-detection-dashboards-plugin/*'
25 changes: 25 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Releases

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/github-app-token@v1.5.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- uses: actions/checkout@v2
- uses: ncipollo/release-action@v1
with:
github_token: ${{ steps.github_app_token.outputs.token }}
body: "Functional tests for OpenSearch Dashboards and OpenSearch Dashboards Plugins ${GITHUB_REF/refs\/tags\//}"
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: Index Management
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/index-management-dashboards-plugin/*'
test-command: env CYPRESS_NO_COMMAND_LOG=1 yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/index-management-dashboards-plugin/*'
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: Security Analytics
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/security-analytics-dashboards-plugin/*'
test-command: env CYPRESS_NO_COMMAND_LOG=1 yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/security-analytics-dashboards-plugin/*'
2 changes: 1 addition & 1 deletion .github/workflows/security-release-e2e-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: Security
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/security/*'
test-command: env CYPRESS_NO_COMMAND_LOG=1 yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/security/*'
34 changes: 34 additions & 0 deletions .github/workflows/workspace-release-e2e-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Workspace Release tests workflow in Bundled OpenSearch Dashboards
on:
pull_request:
branches: ['**']

jobs:
changes:
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.filter.outputs.tests }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
tests:
- 'cypress/**/workspace-plugin/**'
tests-with-security:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: dashboards workspace
test-command: env CYPRESS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/*'
osd-serve-args: --workspace.enabled=true --savedObjects.permission.enabled=true
tests-without-security:
needs: changes
if: ${{ needs.changes.outputs.tests == 'true' }}
uses: ./.github/workflows/release-e2e-workflow-template.yml
with:
test-name: dashboards workspace
test-command: env CYPRESS_WORKSPACE_ENABLED=true yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/*'
osd-serve-args: --workspace.enabled=true --savedObjects.permission.enabled=false
security-enabled: false
55 changes: 55 additions & 0 deletions browser_downloader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

set -e

BROWSER_DIR=`dirname $(realpath $0)` && cd $BROWSER_DIR

function download_chromium {

# Set defaults
arch="x64"
os="linux"
chromium_version="112"
chromium_binary="chrome"
ARCHTYPE=`uname -m`
force=$1

# Architecture
if [ "$ARCHTYPE" = "aarch64" ] || [ "$ARCHTYPE" = "arm64" ]; then
arch="arm64"
fi

# Platform
if (echo "$OSTYPE" | grep -qi darwin); then
os="mac"
chromium_binary="Chromium.app/Contents/MacOS/Chromium"
elif [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "win32" ]; then
os="win"
chromium_binary="chrome.exe"
BROWSER_DIR=`pwd -W`
fi

# Variables
artifact="chromium-$os-$arch.zip"
chromium_url="https://ci.opensearch.org/ci/dbc/tools/chromium/$chromium_version/zip/$artifact"
chromium_path="$BROWSER_DIR/chromium/chrome-$os/$chromium_binary"

# Get artifact
if [ "$force" = "true" ] || [ ! -f "$chromium_path" ]; then
rm -rf chromium
mkdir -p chromium
cd chromium
curl -sSLO $chromium_url
unzip -qq $artifact
rm $artifact
fi

echo "$chromium_path chromium-$chromium_version os-$os arch-$arch"

# Verify binary
if [ "$os" = "win" ]; then
powershell -command "(Get-Item $chromium_path)".VersionInfo
else
$chromium_path --version
fi
}
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"DATASOURCE_MANAGEMENT_ENABLED": false,
"ML_COMMONS_DASHBOARDS_ENABLED": true,
"WAIT_FOR_LOADER_BUFFER_MS": 0,
"DASHBOARDS_ASSISTANT_ENABLED": false
"DASHBOARDS_ASSISTANT_ENABLED": false,
"WORKSPACE_ENABLED": false
}
}
28 changes: 14 additions & 14 deletions cypress/fixtures/plugins/dashboards-assistant/security-cert.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

export const certPublicKeyContent = `
-----BEGIN CERTIFICATE-----
MIIEmDCCA4CgAwIBAgIUZjrlDPP8azRDPZchA/XEsx0X2iYwDQYJKoZIhvcNAQEL
MIIEmDCCA4CgAwIBAgIUaYSlET3nzsotWTrWueVPPh10yLcwDQYJKoZIhvcNAQEL
BQAwgY8xEzARBgoJkiaJk/IsZAEZFgNjb20xFzAVBgoJkiaJk/IsZAEZFgdleGFt
cGxlMRkwFwYDVQQKDBBFeGFtcGxlIENvbSBJbmMuMSEwHwYDVQQLDBhFeGFtcGxl
IENvbSBJbmMuIFJvb3QgQ0ExITAfBgNVBAMMGEV4YW1wbGUgQ29tIEluYy4gUm9v
dCBDQTAeFw0yMzA4MjkyMDA2MzdaFw0zMzA4MjYyMDA2MzdaME0xCzAJBgNVBAYT
dCBDQTAeFw0yNDAyMjAxNzA0MjRaFw0zNDAyMTcxNzA0MjRaME0xCzAJBgNVBAYT
AmRlMQ0wCwYDVQQHDAR0ZXN0MQ8wDQYDVQQKDAZjbGllbnQxDzANBgNVBAsMBmNs
aWVudDENMAsGA1UEAwwEa2lyazCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAJVcOAQlCiuB9emCljROAXnlsPbG7PE3kNz2sN+BbGuw686Wgyl3uToVHvVs
Expand All @@ -23,18 +23,18 @@ O0l/BG9E3mRGo/r0w+jtTQ3aR2p6eoxaOYbVyEMYtFI4QZTkcgGIPGxm05y8xonx
vV5pbSW9L7qAVDzQC8EYGQMMI4ccu0NcHKWtmTYJA/wDPE2JwhngHwbcIbc4cDz6
cG0S3Fm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JomT8ixkARkWB2V4YW1wbGUxGTAXBgNVBAoMEEV4YW1wbGUgQ29tIEluYy4xITAf
BgNVBAsMGEV4YW1wbGUgQ29tIEluYy4gUm9vdCBDQTEhMB8GA1UEAwwYRXhhbXBs
ZSBDb20gSW5jLiBSb290IENBghQNZAmZZn3EFOxBR4630XlhI+mo4jANBgkqhkiG
9w0BAQsFAAOCAQEACEUPPE66/Ot3vZqRGpjDjPHAdtOq+ebaglQhvYcnDw8LOZm8
Gbh9M88CiO6UxC8ipQLTPh2yyeWArkpJzJK/Pi1eoF1XLiAa0sQ/RaJfQWPm9dvl
1ZQeK5vfD4147b3iBobwEV+CR04SKow0YeEEzAJvzr8YdKI6jqr+2GjjVqzxvRBy
KRVHWCFiR7bZhHGLq3br8hSu0hwjb3oGa1ZI8dui6ujyZt6nm6BoEkau3G/6+zq9
E6vX3+8Fj4HKCAL6i0SwfGmEpTNp5WUhqibK/fMhhmMT4Mx6MxkT+OFnIjdUU0S/
e3kgnG8qjficUr38CyEli1U0M7koIXUZI7r+LQ==
-----END CERTIFICATE-----
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ describe('date_nanos', () => {
});
miscUtils.visitPage('app/data-explorer/discover#/');
cy.waitForLoader();
cy.switchDiscoverTable('new');

cy.setTopNavDate(fromTime, toTime);
cy.waitForSearch();
cy.switchDiscoverTable('new');
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ describe('date_nanos_mixed', () => {
});
miscUtils.visitPage('app/data-explorer/discover#/');
cy.waitForLoader();
cy.switchDiscoverTable('new');

const fromTime = 'Jan 1, 2019 @ 00:00:00.000';
const toTime = 'Jan 1, 2019 @ 23:59:59.999';
cy.setTopNavDate(fromTime, toTime);
cy.waitForSearch();
cy.switchDiscoverTable('new');
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,15 @@ describe('discover app', { scrollBehavior: false }, () => {
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForLoader();
cy.switchDiscoverTable('new');
cy.waitForSearch();
cy.switchDiscoverTable('new');
});

after(() => {});

describe('save search', () => {
const saveSearch1 = 'Save Search # 1';
const saveSearch2 = 'Modified Save Search # 1';
beforeEach(() => {
cy.switchDiscoverTable('new');
});

it('should show correct time range string by timepicker', function () {
cy.verifyTimeConfig(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,13 @@ describe('discover tab', () => {
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForLoader();
cy.switchDiscoverTable('new');
cy.waitForSearch();
cy.switchDiscoverTable('new');
});

after(() => {});

describe('field data', function () {
before(() => {
cy.switchDiscoverTable('new');
});

it('search php should show the correct hit count', function () {
const expectedHitCount = '445';
cy.setTopNavQuery('php');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ describe('index pattern with encoded id', () => {

// Go to the Discover page
miscUtils.visitPage('app/data-explorer/discover#/');
cy.switchDiscoverTable('new');
cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME);
cy.switchDiscoverTable('new');
cy.waitForLoader();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ describe('index pattern without field spec', () => {
// Go to the Discover page
miscUtils.visitPage('app/data-explorer/discover#/');
cy.waitForLoader();
cy.switchDiscoverTable('new');
});

after(() => {
Expand All @@ -50,7 +49,6 @@ describe('index pattern without field spec', () => {

it('should display a timepicker after switching to an index pattern with timefield', () => {
const indexName = 'with-timefield';
cy.switchDiscoverTable('new');
cy.getElementByTestId('comboBoxToggleListButton')
.should('be.visible')
.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ describe.skip('saved queries saved objects', () => {
// Go to the Discover page
miscUtils.visitPage('app/data-explorer/discover#/');
cy.waitForLoader();
cy.switchDiscoverTable('new');

// Set time filter
cy.setTopNavDate(fromTime, toTime);
cy.switchDiscoverTable('new');

// Set up query and filter
cy.setTopNavQuery('response:200');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { BASE_PATH } from '../../../../utils/constants';

if (Cypress.env('WORKSPACE_ENABLED')) {
describe('Workspace CRUD APIs', () => {
describe('Create a workspace', () => {
it('should successfully create a worksapce', () => {
const body = {
attributes: {
name: 'test_workspace',
description: 'test_workspace_description',
},
};
cy.request({
method: 'POST',
url: `${BASE_PATH}/api/workspaces`,
headers: {
'osd-xsrf': true,
},
body: body,
}).as('createWorkspace');
cy.get('@createWorkspace').should((res) => {
expect(res.body.success).to.eql(true);
});
});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

import { BASE_PATH } from '../../../utils/constants';
import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
import { CURRENT_TENANT } from '../../../utils/commands';

const miscUtils = new MiscUtils(cy);
describe('Verify the presence of import custom map tab in region map plugin', () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.deleteAllIndices();
miscUtils.addSampleData();

Expand All @@ -25,8 +27,11 @@ describe('Verify the presence of import custom map tab in region map plugin', ()
});

it('checks import custom map tab is present', () => {
cy.wait(10000);
// Click on "Import Vector Map" tab, which is part of customImportMap plugin
cy.contains('Import Vector Map').click({ force: true });
cy.contains('Import Vector Map', { timeout: 120000 })
.should('be.visible')
.click({ force: true });
});

after(() => {
Expand Down
Loading

0 comments on commit 9c2fc68

Please sign in to comment.