Skip to content

Commit

Permalink
feat: enable setup Signed-off-by: yubonluo <yubonluo@amazon.com>
Browse files Browse the repository at this point in the history
  • Loading branch information
yubonluo committed Mar 13, 2024
1 parent 855186a commit 7c2cef4
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
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/**/dashboards-workspace/**'
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_DASHBOARDS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-workspace/*'
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_DASHBOARDS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/dashboards-workspace/*'
osd-serve-args: --workspace.enabled=true --savedObjects.permission.enabled=true
security-enabled: false
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,
"DASHBOARDS_WORKSPACE_ENABLED": false
}
}
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('DASHBOARDS_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);
});
});
});
});
}

0 comments on commit 7c2cef4

Please sign in to comment.