Skip to content

Commit

Permalink
Merge pull request #243 from IMDA-BTG/fix/scr-hard-corded-abs-path
Browse files Browse the repository at this point in the history
update paths in mock data file paths

The requested reviews are Approved. Proceeded to merge PR to Main.
  • Loading branch information
imda-benedictlee committed Jan 18, 2024
2 parents 00d1a2e + 7bb09af commit 85bb783
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
8 changes: 4 additions & 4 deletions ai-verify-portal/__mocks__/mockGqlResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const mockGqlDataE2E = [
name: 'pickle_pandas_tabular_compas_testing.sav',
filename: 'pickle_pandas_tabular_compas_testing.sav',
filePath:
'/home/aiverify/uploads/data/pickle_pandas_tabular_compas_testing.sav',
'/uploads/data/pickle_pandas_tabular_compas_testing.sav',
ctime: '2023-06-05T07:17:06.360Z',
size: '68.33 KB',
status: 'Valid',
Expand Down Expand Up @@ -143,7 +143,7 @@ export const mockGqlDataE2E = [
id: '64cb013aad81d1d5d0227bf5',
name: 'image-test.png',
filename: 'aiv-homescreen-v1.png',
filePath: '/home/aiverify/uploads/data/image-test.png',
filePath: '../aiverify/uploads/data/image-test.png',
ctime: '2023-08-03T01:22:02.814Z',
size: '71.09 KB',
status: 'Invalid',
Expand All @@ -154,7 +154,7 @@ export const mockGqlDataE2E = [
serializer: '',
dataFormat: '',
errorMessages:
'The dataset /home/amdlahir/aiverify/uploads/data/aiv-homescreen-v1.png is not supported. Please upload a supported dataset: Unable to get data instance: ',
'The dataset ../aiverify/uploads/data/aiv-homescreen-v1.png is not supported. Please upload a supported dataset: Unable to get data instance: ',
type: 'File',
},
],
Expand All @@ -174,7 +174,7 @@ export const mockGqlDataE2E = [
name: 'pickle_scikit_bc_compas.sav',
filename: 'pickle_scikit_bc_compas.sav',
filePath:
'/home/amdlahir/aiverify/uploads/model/pickle_scikit_bc_compas.sav',
'../aiverify/uploads/model/pickle_scikit_bc_compas.sav',
ctime: '2023-06-05T07:17:25.132Z',
size: '502.71 KB',
status: 'Valid',
Expand Down
26 changes: 13 additions & 13 deletions ai-verify-portal/__mocks__/mockPlugins.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ai-verify-portal/__tests__/modules/modelList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const mocks = [
name: 'tensorflow_tabular_compas_sequential.sav',
filename: 'tensorflow_tabular_compas_sequential.sav',
filePath:
'/home/user/aiverify/uploads/model/tensorflow_tabular_compas_sequential.sav',
'../aiverify/uploads/model/tensorflow_tabular_compas_sequential.sav',
ctime: '2023-03-30T02:28:33.890Z',
size: null,
status: 'Valid',
Expand All @@ -56,7 +56,7 @@ const mocks = [
name: 'joblib_scikit_ada_compas.sav',
filename: 'joblib_scikit_ada_compas.sav',
filePath:
'/home/user/aiverify/uploads/model/joblib_scikit_ada_compas.sav',
'../aiverify/uploads/model/joblib_scikit_ada_compas.sav',
ctime: '2023-04-03T04:30:02.414Z',
size: '561.89 KB',
status: 'Valid',
Expand Down
2 changes: 1 addition & 1 deletion ai-verify-portal/__tests__/modules/newDataset.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const uploadResponse = [
filename: 'file1.png',
name: 'file1.png',
type: 'File',
filePath: '/home/uploads/file1.png',
filePath: '../uploads/file1.png',
ctime: '2023-05-24T05:56:20.830Z',
description: '',
status: 'Pending',
Expand Down
4 changes: 4 additions & 0 deletions ai-verify-portal/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ const customJestConfig = {
'<rootDir>/test-report.html',
'<rootDir>/test-results.json',
],
transformIgnorePatterns: [
"/node_modules/(?!uuid)",
"/node_modules/(?!(@rjsf/core|nanoid)).+\\.js$"
],
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
Expand Down

0 comments on commit 85bb783

Please sign in to comment.