extract lib in caching flow

pull/496/head
Frostebite 2023-02-13 18:23:06 +00:00
parent fa274bd3ae
commit 63597a8e98
1 changed files with 3 additions and 3 deletions

View File

@ -52,16 +52,16 @@ describe('Cloud Runner Locking', () => {
await SharedWorkspaceLocking.ReadLines( await SharedWorkspaceLocking.ReadLines(
`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParameters.cacheKey}/`, `aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParameters.cacheKey}/`,
) )
).filter((x) => x.includes(`${newWorkspaceName}_workspace_lock`)), ).filter((x) => x.endsWith(`${newWorkspaceName}_workspace_lock`)),
).toHaveLength(1); ).toHaveLength(1);
expect( expect(
( (
await SharedWorkspaceLocking.ReadLines( await SharedWorkspaceLocking.ReadLines(
`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParameters.cacheKey}/`, `aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParameters.cacheKey}/`,
) )
).filter((x) => x.includes(`${newWorkspaceName}_workspace`)), ).filter((x) => x.endsWith(`${newWorkspaceName}_workspace`)),
).toHaveLength(1); ).toHaveLength(1);
expect(allLocks.filter((x) => x.includes(`${newWorkspaceName}_workspace_lock`)).length).toBeGreaterThan(0); expect(allLocks.filter((x) => x.endsWith(`${newWorkspaceName}_workspace_lock`)).length).toBeGreaterThan(0);
const isExpectedLockedAfterLocking = const isExpectedLockedAfterLocking =
(await SharedWorkspaceLocking.IsWorkspaceLocked(newWorkspaceName, buildParameters)) === true; (await SharedWorkspaceLocking.IsWorkspaceLocked(newWorkspaceName, buildParameters)) === true;
expect(isExpectedLockedAfterLocking).toBeTruthy(); expect(isExpectedLockedAfterLocking).toBeTruthy();