Skip to content

Commit

Permalink
Merge branch 'RHOAIENG-15752' of https://github.com/antowaddle/odh-da…
Browse files Browse the repository at this point in the history
…shboard into RHOAIENG-15752
  • Loading branch information
antowaddle committed Jan 13, 2025
2 parents 7ff1c06 + 560b747 commit 259e041
Show file tree
Hide file tree
Showing 58 changed files with 3,475 additions and 391 deletions.
14 changes: 12 additions & 2 deletions frontend/src/__mocks__/mockHardwareProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type MockResourceConfigType = {
enabled?: boolean;
nodeSelectors?: NodeSelector[];
tolerations?: Toleration[];
annotations?: Record<string, string>;
};

export const mockHardwareProfile = ({
Expand All @@ -29,10 +30,17 @@ export const mockHardwareProfile = ({
{
displayName: 'Memory',
identifier: 'memory',
minCount: '5Gi',
maxCount: '2Gi',
minCount: '2Gi',
maxCount: '5Gi',
defaultCount: '2Gi',
},
{
displayName: 'CPU',
identifier: 'cpu',
minCount: '1',
maxCount: '2',
defaultCount: '1',
},
],
description = '',
enabled = true,
Expand All @@ -49,6 +57,7 @@ export const mockHardwareProfile = ({
value: 'va;ue',
},
],
annotations,
}: MockResourceConfigType): HardwareProfileKind => ({
apiVersion: 'dashboard.opendatahub.io/v1alpha1',
kind: 'HardwareProfile',
Expand All @@ -59,6 +68,7 @@ export const mockHardwareProfile = ({
namespace,
resourceVersion: '1309350',
uid,
annotations,
},
spec: {
identifiers,
Expand Down
74 changes: 43 additions & 31 deletions frontend/src/__mocks__/mockModelRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ type MockModelRegistryType = {
name?: string;
namespace?: string;
conditions?: K8sCondition[];
sslRootCertificateConfigMap?: { name: string; key: string } | null;
sslRootCertificateSecret?: { name: string; key: string } | null;
};

export const mockModelRegistry = ({
Expand All @@ -25,37 +27,47 @@ export const mockModelRegistry = ({
type: 'Available',
},
],
}: MockModelRegistryType): ModelRegistryKind => ({
apiVersion: 'modelregistry.opendatahub.io/v1alpha1',
kind: 'ModelRegistry',
metadata: {
name,
creationTimestamp: '2024-03-14T08:01:42Z',
namespace,
},
spec: {
grpc: {},
rest: {},
istio: {
gateway: {
grpc: { tls: {} },
rest: { tls: {} },
},
sslRootCertificateConfigMap = null,
sslRootCertificateSecret = null,
}: MockModelRegistryType): ModelRegistryKind => {
const data: ModelRegistryKind = {
apiVersion: 'modelregistry.opendatahub.io/v1alpha1',
kind: 'ModelRegistry',
metadata: {
name,
creationTimestamp: '2024-03-14T08:01:42Z',
namespace,
},
postgres: {
database: 'model-registry',
host: 'model-registry-db',
passwordSecret: {
key: 'database-password',
name: 'model-registry-db',
spec: {
grpc: {},
rest: {},
istio: {
gateway: {
grpc: { tls: {} },
rest: { tls: {} },
},
},
mysql: {
database: 'model-registry',
host: 'model-registry-db',
passwordSecret: {
key: 'database-password',
name: 'model-registry-db',
},
port: 5432,
skipDBCreation: false,
username: 'mlmduser',
},
port: 5432,
skipDBCreation: false,
sslMode: 'disable',
username: 'mlmduser',
},
},
status: {
conditions,
},
});
status: {
conditions,
},
};

if (sslRootCertificateConfigMap && data.spec.mysql) {
data.spec.mysql.sslRootCertificateConfigMap = sslRootCertificateConfigMap;
} else if (sslRootCertificateSecret && data.spec.mysql) {
data.spec.mysql.sslRootCertificateSecret = sslRootCertificateSecret;
}
return data;
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class Modal {
}

find(): Cypress.Chainable<JQuery<HTMLElement>> {
// FIXME Remove `hidden: true` once issue with PF modals is fixed.
// FIXME Remove `hidden: true` once PF version is upgraded to 6.1.0.
// https://issues.redhat.com/browse/RHOAIENG-11946
// https://github.com/patternfly/patternfly-react/issues/11041
return cy.findByRole('dialog', { name: this.title, hidden: true });
Expand Down
Loading

0 comments on commit 259e041

Please sign in to comment.