Skip to content

Commit

Permalink
[DC-758] Delete run-catalog-workflow and move to using existing works…
Browse files Browse the repository at this point in the history
…paces (#4188)
  • Loading branch information
s-rubenstein authored Sep 7, 2023
1 parent 77a1456 commit 113072a
Showing 7 changed files with 48 additions and 103 deletions.
10 changes: 2 additions & 8 deletions integration-tests/slack/slack-notify-channels.json
Original file line number Diff line number Diff line change
@@ -37,9 +37,6 @@
},
{
"name": "run-workflow"
},
{
"name": "run-catalog-workflow"
}
]
},
@@ -69,13 +66,10 @@
"name": "run-catalog-filter"
},
{
"name": "run-catalog-workflow"
},
{
"name": "export-tdr-dataset-to-new-workspace"
"name": "export-tdr-dataset-to-workspace"
},
{
"name": "export-workspace-dataset-to-new-workspace"
"name": "export-workspace-dataset-to-workspace"
},
{
"name": "import-cohort-data"
14 changes: 0 additions & 14 deletions integration-tests/tests/export-tdr-dataset-to-new-workspace.js

This file was deleted.

19 changes: 19 additions & 0 deletions integration-tests/tests/export-tdr-dataset-to-workspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const _ = require('lodash/fp');
const { withWorkspace } = require('../utils/integration-helpers');
const { testExportToWorkspace } = require('../utils/catalog-utils');
const { registerTest } = require('../utils/jest-utils');
const { withUserToken } = require('../utils/terra-sa-utils');

const exportTdrDatasetToWorkspace = _.flow(
withWorkspace,
withUserToken
)(async ({ billingProject, page, testUrl, token, workspaceName }) => {
await testExportToWorkspace(billingProject, page, testUrl, token, 'Readable Catalog Snapshot 1', workspaceName);
});

registerTest({
name: 'export-tdr-dataset-to-workspace',
fn: exportTdrDatasetToWorkspace,
timeout: 2 * 60 * 1000,
targetEnvironments: [],
});

This file was deleted.

18 changes: 18 additions & 0 deletions integration-tests/tests/export-workspace-dataset-to-workspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const _ = require('lodash/fp');
const { withWorkspace } = require('../utils/integration-helpers');
const { registerTest } = require('../utils/jest-utils');
const { withUserToken } = require('../utils/terra-sa-utils');
const { testExportToWorkspace } = require('../utils/catalog-utils');

const exportWorkspaceDatasetToWorkspace = _.flow(
withWorkspace,
withUserToken
)(async ({ billingProject, page, testUrl, token, workspaceName }) => {
await testExportToWorkspace(billingProject, page, testUrl, token, 'Readable Catalog Workspace 1', workspaceName);
});

registerTest({
name: 'export-workspace-dataset-to-workspace',
fn: exportWorkspaceDatasetToWorkspace,
timeout: 2 * 60 * 1000,
});
26 changes: 0 additions & 26 deletions integration-tests/tests/run-catalog-workflow.js

This file was deleted.

51 changes: 9 additions & 42 deletions integration-tests/utils/catalog-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { navigateToDataCatalog, testWorkspaceName } = require('./integration-helpers');
const { click, clickable, checkbox, clickTableCell, noSpinnersAfter, waitForNoSpinners, fillIn, select, findText } = require('./integration-utils');
const { navigateToDataCatalog } = require('./integration-helpers');
const { click, clickable, checkbox, clickTableCell, noSpinnersAfter, waitForNoSpinners, select, findText } = require('./integration-utils');

const eitherThrow = (testFailure, { cleanupFailure, cleanupMessage }) => {
if (testFailure) {
@@ -18,47 +18,14 @@ const linkDataToWorkspace = async (page, testUrl, token, datasetName) => {
await noSpinnersAfter(page, { action: () => click(page, clickable({ textContains: 'Prepare for analysis' })) });
};

const testExportToNewWorkspace = async (billingProject, page, testUrl, token, datasetName) => {
const testExportToWorkspace = async (billingProject, page, testUrl, token, datasetName, workspaceName) => {
await linkDataToWorkspace(page, testUrl, token, datasetName);
const newWorkspaceName = testWorkspaceName();
await waitForNoSpinners(page);
await click(page, clickable({ textContains: 'Start with a new workspace' }));
await fillIn(page, '//*[@placeholder="Enter a name"]', `${newWorkspaceName}`);
await select(page, 'Billing project', `${billingProject}`);
await noSpinnersAfter(page, { action: () => click(page, clickable({ textContains: 'Create Workspace' })) });

const waitForWorkspacePage = async () => {
try {
await findText(page, `${billingProject}/${newWorkspaceName}`);
await findText(page, 'Select a data type');
} catch (error) {
return error;
}
};

const cleanupFn = async () => {
try {
await page.evaluate(
async (name, billingProject) => {
return await window.Ajax().Workspaces.workspace(billingProject, name).delete();
},
newWorkspaceName,
billingProject
);
} catch (error) {
return error;
}
};

const workspaceFailure = await waitForWorkspacePage();
const cleanupFailure = await cleanupFn();

if (workspaceFailure || cleanupFailure) {
eitherThrow(workspaceFailure, {
cleanupFailure,
cleanupMessage: `Failed to delete workspace: ${newWorkspaceName} with billing project ${billingProject}`,
});
}
await click(page, clickable({ textContains: 'Start with an existing workspace' }));
await select(page, 'Select a workspace', `${workspaceName}`);
await noSpinnersAfter(page, { action: () => click(page, clickable({ text: 'Import' })) });
await findText(page, `${billingProject}/${workspaceName}`);
await findText(page, 'Select a data type');
};

module.exports = { eitherThrow, linkDataToWorkspace, testExportToNewWorkspace };
module.exports = { eitherThrow, linkDataToWorkspace, testExportToWorkspace };

0 comments on commit 113072a

Please sign in to comment.