Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

EVEREST-358 Disable list commands #165

Merged
merged 5 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions cli-tests/tests/list/database-engines.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,45 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { test, expect } from '@fixtures';
import { waitForDBEngines } from '@tests/support/kubernetes';

let kubernetesId = '';

test.beforeAll(async ({ cli, request }) => {
const kubernetesList = await request.get('/v1/kubernetes');

kubernetesId = (await kubernetesList.json())[0].id;
expect(kubernetesId).toBeTruthy();

// Wait until all dbengines are ready
await expect.poll(() => waitForDBEngines(cli), {
message: 'dbengine not yet installed',
intervals: [1000],
timeout: 240 * 1000,
}).toBe(true);
});

test.describe('Database engines', async () => {
test('list', async ({ cli }) => {
const out = await cli.everestExecSilent(`list databaseengines --kubernetes-id ${kubernetesId}`);

await out.assertSuccess();
await out.outContainsNormalizedMany([
'postgresql',
'psmdb',
'pxc',
]);
});

test('list json', async ({ cli }) => {
const out = await cli.everestExecSilent(`--json list databaseengines --kubernetes-id ${kubernetesId}`);

await out.assertSuccess();
const res = JSON.parse(out.stdout);

expect(res?.postgresql?.version).toBeTruthy();
expect(res?.psmdb?.version).toBeTruthy();
expect(res?.pxc?.version).toBeTruthy();
});
});
//import { test, expect } from '@fixtures';
//import { waitForDBEngines } from '@tests/support/kubernetes';
//
//let kubernetesId = '';
//
//test.beforeAll(async ({ cli, request }) => {
// const kubernetesList = await request.get('/v1/kubernetes');
//
// kubernetesId = (await kubernetesList.json())[0].id;
// expect(kubernetesId).toBeTruthy();
//
// // Wait until all dbengines are ready
// await expect.poll(() => waitForDBEngines(cli), {
// message: 'dbengine not yet installed',
// intervals: [1000],
// timeout: 240 * 1000,
// }).toBe(true);
//});
//
//test.describe('Database engines', async () => {
// test('list', async ({ cli }) => {
// const out = await cli.everestExecSilent(`list databaseengines --kubernetes-id ${kubernetesId}`);
//
// await out.assertSuccess();
// await out.outContainsNormalizedMany([
// 'postgresql',
// 'psmdb',
// 'pxc',
// ]);
// });
//
// test('list json', async ({ cli }) => {
// const out = await cli.everestExecSilent(`--json list databaseengines --kubernetes-id ${kubernetesId}`);
//
// await out.assertSuccess();
// const res = JSON.parse(out.stdout);
//
// expect(res?.postgresql?.version).toBeTruthy();
// expect(res?.psmdb?.version).toBeTruthy();
// expect(res?.pxc?.version).toBeTruthy();
// });
//});
106 changes: 53 additions & 53 deletions cli-tests/tests/list/versions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,56 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { test, expect } from '@fixtures';
import { waitForDBEngines } from '@tests/support/kubernetes';

let kubernetesId = '';

test.beforeAll(async ({ cli, request }) => {
const kubernetesList = await request.get('/v1/kubernetes');

kubernetesId = (await kubernetesList.json())[0].id;
expect(kubernetesId).toBeTruthy();

// Wait until all dbengines are ready
await expect.poll(() => waitForDBEngines(cli), {
message: 'dbengine not yet installed',
intervals: [1000],
timeout: 240 * 1000,
}).toBe(true);
});

test.describe('Versions', async () => {
test('list', async ({ cli }) => {
const out = await cli.everestExecSilent(`list versions --kubernetes-id ${kubernetesId}`);

await out.assertSuccess();
await out.outContainsNormalizedMany([
'postgresql',
'psmdb',
'pxc',
]);
});

test('list json', async ({ cli }) => {
const out = await cli.everestExecSilent(`--json list versions --kubernetes-id ${kubernetesId}`);

await out.assertSuccess();
const res = JSON.parse(out.stdout);

expect(Array.isArray(res?.postgresql)).toBeTruthy();
expect(Array.isArray(res?.psmdb)).toBeTruthy();
expect(Array.isArray(res?.pxc)).toBeTruthy();
expect(res?.postgresql?.length).toBeTruthy();
expect(res?.psmdb?.length).toBeTruthy();
expect(res?.pxc?.length).toBeTruthy();
});

test('list supports --type', async ({ cli }) => {
const out = await cli.everestExecSilent(`list versions --kubernetes-id ${kubernetesId} --type pxc`);

await out.assertSuccess();
await out.outContainsNormalizedMany(['pxc']);
await out.outNotContains(['postgresql', 'psmdb']);
});
});
// import { test, expect } from '@fixtures';
// import { waitForDBEngines } from '@tests/support/kubernetes';
//
// let kubernetesId = '';
//
// test.beforeAll(async ({ cli, request }) => {
// const kubernetesList = await request.get('/v1/kubernetes');
//
// kubernetesId = (await kubernetesList.json())[0].id;
// expect(kubernetesId).toBeTruthy();
//
// // Wait until all dbengines are ready
// await expect.poll(() => waitForDBEngines(cli), {
// message: 'dbengine not yet installed',
// intervals: [1000],
// timeout: 240 * 1000,
// }).toBe(true);
// });
//
// test.describe('Versions', async () => {
// test('list', async ({ cli }) => {
// const out = await cli.everestExecSilent(`list versions --kubernetes-id ${kubernetesId}`);
//
// await out.assertSuccess();
// await out.outContainsNormalizedMany([
// 'postgresql',
// 'psmdb',
// 'pxc',
// ]);
// });
//
// test('list json', async ({ cli }) => {
// const out = await cli.everestExecSilent(`--json list versions --kubernetes-id ${kubernetesId}`);
//
// await out.assertSuccess();
// const res = JSON.parse(out.stdout);
//
// expect(Array.isArray(res?.postgresql)).toBeTruthy();
// expect(Array.isArray(res?.psmdb)).toBeTruthy();
// expect(Array.isArray(res?.pxc)).toBeTruthy();
// expect(res?.postgresql?.length).toBeTruthy();
// expect(res?.psmdb?.length).toBeTruthy();
// expect(res?.pxc?.length).toBeTruthy();
// });
//
// test('list supports --type', async ({ cli }) => {
// const out = await cli.everestExecSilent(`list versions --kubernetes-id ${kubernetesId} --type pxc`);
//
// await out.assertSuccess();
// await out.outContainsNormalizedMany(['pxc']);
// await out.outNotContains(['postgresql', 'psmdb']);
// });
// });
2 changes: 1 addition & 1 deletion commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewRootCmd(l *zap.SugaredLogger) *cobra.Command {

rootCmd.AddCommand(newInstallCmd(l))
// rootCmd.AddCommand(newProvisionCmd(l))
rootCmd.AddCommand(newListCmd(l))
// rootCmd.AddCommand(newListCmd(l))
rootCmd.AddCommand(newDeleteCmd(l))

return rootCmd
Expand Down
Loading