Skip to content

Commit 041fbec

Browse files
authored
[Workspace] Clean up workspace after tests and disable multi-tenancy when running workspace test (#1232)
Signed-off-by: yubonluo <yubonluo@amazon.com>
1 parent 0646ef7 commit 041fbec

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/workspace-release-e2e-workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
test-name: dashboards workspace
2424
test-command: env CYPRESS_WORKSPACE_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/*'
25-
osd-serve-args: --workspace.enabled=true --savedObjects.permission.enabled=true
25+
osd-serve-args: --workspace.enabled=true --savedObjects.permission.enabled=true --opensearch_security.multitenancy.enabled=false
2626
tests-without-security:
2727
needs: changes
2828
if: ${{ needs.changes.outputs.tests == 'true' }}

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/workspace_create.spec.js

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { BASE_PATH } from '../../../../utils/constants';
77

88
if (Cypress.env('WORKSPACE_ENABLED')) {
9+
let workspaceId;
910
describe('Workspace CRUD APIs', () => {
1011
describe('Create a workspace', () => {
1112
it('should successfully create a worksapce', () => {
@@ -24,9 +25,19 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
2425
body: body,
2526
}).as('createWorkspace');
2627
cy.get('@createWorkspace').should((res) => {
28+
workspaceId = res.body.result.id;
2729
expect(res.body.success).to.eql(true);
2830
});
2931
});
3032
});
33+
after(() => {
34+
cy.request({
35+
method: 'DELETE',
36+
url: `${BASE_PATH}/api/workspaces/${workspaceId}`,
37+
headers: {
38+
'osd-xsrf': true,
39+
},
40+
});
41+
});
3142
});
3243
}

0 commit comments

Comments
 (0)