1- import { describe , test , expect , beforeAll , jest , afterAll } from '@jest/globals' ;
1+ import { describe , test , expect , beforeAll , jest } from '@jest/globals' ;
22import RunClient from '../src/tracking/RunClient' ;
33import ModelManager from '../src/workflows/ModelManager' ;
44import ModelRegistryClient from '../src/model-registry/ModelRegistryClient' ;
@@ -38,7 +38,6 @@ describe('ModelManager', () => {
3838) ;
3939expect ( newModelVersion . name ) . toBe ( modelName2 ) ;
4040expect ( newModelVersion . version ) . toBe ( '1' ) ;
41- // await modelRegistryClient.deleteRegisteredModel(modelName2);
4241} ) ;
4342test ( 'Should throw an error for duplicate model name' , async ( ) => {
4443// Making it so console.error doesn't show up in the console
@@ -63,7 +62,6 @@ describe('ModelManager', () => {
6362expect ( consoleErrorMock ) . toHaveBeenCalled ( ) ;
6463// restoring the console to show console.error again to not affect other tests
6564consoleErrorMock . mockRestore ( ) ;
66- // await modelRegistryClient.deleteRegisteredModel(modelName3);
6765} ) ;
6866test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
6967// Making it so console.error doesn't show up in the console
@@ -101,7 +99,6 @@ describe('ModelManager', () => {
10199) ;
102100expect ( updatedModelDescriptionAndTag . tags [ 0 ] . key ) . toBe ( 'modelTagKey' ) ;
103101expect ( updatedModelDescriptionAndTag . tags [ 0 ] . value ) . toBe ( 'modelTagValue' ) ;
104- // await modelRegistryClient.deleteRegisteredModel(modelName2);
105102} ) ;
106103test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
107104// Making it so console.error doesn't show up in the console
@@ -154,7 +151,6 @@ describe('ModelManager', () => {
154151expect ( updateAllLatestModelVersionObject . tags [ 0 ] . value ) . toBe (
155152'modelVersionTagValue'
156153) ;
157- // await modelRegistryClient.deleteRegisteredModel(modelName2);
158154} ) ;
159155test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
160156// Making it so console.error doesn't show up in the console
@@ -196,7 +192,6 @@ describe('ModelManager', () => {
196192expect ( latestModelVersion [ 0 ] . name ) . toBe ( modelName2 ) ;
197193expect ( latestModelVersion [ 0 ] . tags [ 0 ] . key ) . toBe ( 'modelVersionTagKey' ) ;
198194expect ( latestModelVersion [ 0 ] . tags [ 0 ] . value ) . toBe ( 'modelVersionTagValue' ) ;
199- // await modelRegistryClient.deleteRegisteredModel(modelName2);
200195} ) ;
201196test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
202197// Making it so console.error doesn't show up in the console
@@ -236,7 +231,6 @@ describe('ModelManager', () => {
236231expect ( latestModelVersion [ 0 ] . version ) . toBe ( '2' ) ;
237232expect ( latestModelVersion [ 0 ] . name ) . toBe ( modelName2 ) ;
238233expect ( latestModelVersion [ 0 ] . aliases [ 0 ] ) . toBe ( 'modelVersionAlias' ) ;
239- // await modelRegistryClient.deleteRegisteredModel(modelName2);
240234} ) ;
241235test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
242236// Making it so console.error doesn't show up in the console
@@ -275,7 +269,6 @@ describe('ModelManager', () => {
275269expect ( latestModelVersion . version ) . toBe ( '2' ) ;
276270expect ( latestModelVersion . name ) . toBe ( modelName2 ) ;
277271expect ( latestModelVersion . description ) . toBe ( 'modelDescription' ) ;
278- // await modelRegistryClient.deleteRegisteredModel(modelName2);
279272} ) ;
280273test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
281274// Making it so console.error doesn't show up in the console
@@ -322,7 +315,6 @@ describe('ModelManager', () => {
322315expect ( updatedModelVersionAll . description ) . toBe (
323316'modelVersionDescription'
324317) ;
325- // await modelRegistryClient.deleteRegisteredModel(modelName2);
326318} ) ;
327319test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
328320// Making it so console.error doesn't show up in the console
@@ -357,7 +349,6 @@ describe('ModelManager', () => {
357349const latestModelVersion :keyable =
358350await modelRegistryClient . getLatestModelVersions ( modelName2 ) ;
359351expect ( latestModelVersion [ 0 ] . version ) . toBe ( '1' ) ;
360- // await modelRegistryClient.deleteRegisteredModel(modelName2);
361352} ) ;
362353test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
363354// Making it so console.error doesn't show up in the console
@@ -396,8 +387,6 @@ describe('ModelManager', () => {
396387expect ( maxModel . latest_versions [ 0 ] . source ) . toBe (
397388runData . info . artifact_uri
398389) ;
399- // await modelRegistryClient.deleteRegisteredModel(modelName2);
400- // await runClient.deleteRun(run2.info.run_id);
401390} ) ;
402391
403392test ( 'Should create model from run with best(minimum) metric' , async ( ) => {
@@ -420,8 +409,6 @@ describe('ModelManager', () => {
420409expect ( minModel . latest_versions [ 0 ] . source ) . toBe (
421410runData2 . info . artifact_uri
422411) ;
423- // await modelRegistryClient.deleteRegisteredModel(modelName2);
424- // await runClient.deleteRun(run2.info.run_id);
425412} ) ;
426413
427414test ( 'Should throw and console.error if no parameters are passed to the method' , async ( ) => {
@@ -439,8 +426,4 @@ describe('ModelManager', () => {
439426consoleErrorMock . mockRestore ( ) ;
440427} ) ;
441428} ) ;
442-
443- // afterAll(async () => {
444- // await runClient.deleteRun(run.info.run_id);
445- // });
446429} ) ;