Skip to content

Commit ad95ee6

Browse files
committed
Update tests
1 parent 82fea2b commit ad95ee6

File tree

8 files changed

+40
-11
lines changed

8 files changed

+40
-11
lines changed

components/public-api/typescript-common/fixtures/toWorkspaceSession_1.golden

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@
8585
"creationTime": "2023-10-16T20:18:24.923Z",
8686
"startedTime": "2023-10-16T20:18:26.923Z",
8787
"stoppingTime": "2023-10-16T20:28:24.923Z",
88-
"stoppedTime": "2023-10-16T20:28:44.923Z"
88+
"stoppedTime": "2023-10-16T20:28:44.923Z",
89+
"metrics": {
90+
"workspaceImageSize": "25600000",
91+
"totalImageSize": "35600000"
92+
}
8993
},
9094
"err": ""
9195
}

components/public-api/typescript-common/fixtures/toWorkspaceSession_1.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@
7575
"stoppedByRequest": false,
7676
"headlessTaskFailed": ""
7777
},
78-
"exposedPorts": []
78+
"exposedPorts": [],
79+
"metrics": {
80+
"image": {
81+
"totalSize": 35600000,
82+
"workspaceImageSize": 25600000
83+
}
84+
}
7985
},
8086
"gitStatus": null,
8187
"phasePersisted": "creating",

components/public-api/typescript-common/fixtures/toWorkspaceSession_2.golden

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@
8787
"creationTime": "2024-05-13T07:06:47.659Z",
8888
"startedTime": "2024-05-13T07:09:16.390Z",
8989
"stoppingTime": "2024-05-13T07:09:16.615Z",
90-
"stoppedTime": "2024-05-13T07:09:29.912Z"
90+
"stoppedTime": "2024-05-13T07:09:29.912Z",
91+
"metrics": {
92+
"workspaceImageSize": "25600000",
93+
"totalImageSize": "0"
94+
}
9195
},
9296
"err": ""
9397
}

components/public-api/typescript-common/fixtures/toWorkspaceSession_2.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@
9090
"headlessTaskFailed": ""
9191
},
9292
"ownerToken": "M4GknXYd6ihLf6PLyPlVEghWy3TLvj7X",
93-
"exposedPorts": []
93+
"exposedPorts": [],
94+
"metrics": {
95+
"image": {
96+
"workspaceImageSize": 25600000
97+
}
98+
}
9499
},
95100
"gitStatus": {
96101
"branch": "master",

components/public-api/typescript-common/fixtures/toWorkspaceSession_3.golden

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@
8787
"creationTime": "2024-05-13T07:12:42.536Z",
8888
"startedTime": "2024-05-13T07:12:45.421Z",
8989
"stoppingTime": "2024-05-13T07:12:51.802Z",
90-
"stoppedTime": "2024-05-13T07:12:52.461Z"
90+
"stoppedTime": "2024-05-13T07:12:52.461Z",
91+
"metrics": {
92+
"workspaceImageSize": "0",
93+
"totalImageSize": "0"
94+
}
9195
},
9296
"err": ""
9397
}

components/public-api/typescript-common/fixtures/toWorkspaceSession_3.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@
9090
"headlessTaskFailed": ""
9191
},
9292
"ownerToken": "6BCmFzg6t0e9hDrPP8.pc8KGee8rxWKA",
93-
"exposedPorts": []
93+
"exposedPorts": [],
94+
"metrics": {
95+
"image": {}
96+
}
9497
},
9598
"gitStatus": {
9699
"branch": "master",

components/public-api/typescript-common/fixtures/toWorkspaceSession_4.golden

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@
8787
"creationTime": "2024-05-13T07:14:11.048Z",
8888
"startedTime": "2024-05-13T07:14:13.406Z",
8989
"stoppingTime": "2024-05-13T07:14:45.263Z",
90-
"stoppedTime": "2024-05-13T07:14:45.466Z"
90+
"stoppedTime": "2024-05-13T07:14:45.466Z",
91+
"metrics": {
92+
"workspaceImageSize": "0",
93+
"totalImageSize": "0"
94+
}
9195
},
9296
"err": ""
9397
}

components/public-api/typescript-common/src/public-api-converter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,10 @@ export class PublicAPIConverter {
200200
result.stoppedTime = Timestamp.fromDate(new Date(arg.instance.stoppedTime));
201201
}
202202

203-
// todo(ft): update fixture tests
204-
const { metrics: statistics } = arg.instance.status;
203+
const { metrics } = arg.instance.status;
205204
result.metrics = new WorkspaceSession_Metrics({
206-
totalImageSize: statistics?.image?.totalSize ? BigInt(statistics.image.totalSize) : undefined,
207-
workspaceImageSize: statistics?.image?.workspaceImageSize ? BigInt(statistics.image.workspaceImageSize) : undefined,
205+
totalImageSize: metrics?.image?.totalSize ? BigInt(metrics.image.totalSize) : undefined,
206+
workspaceImageSize: metrics?.image?.workspaceImageSize ? BigInt(metrics.image.workspaceImageSize) : undefined,
208207
});
209208

210209
return result;

0 commit comments

Comments
 (0)