Skip to content

Commit

Permalink
Updated to latest runners file list
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottGuymer committed Feb 10, 2022
1 parent 42a1b58 commit 75d423d
Show file tree
Hide file tree
Showing 2 changed files with 4,333 additions and 2,289 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ const objectExtension: Record<string, string> = {
};
const bucketObjectNames: Record<string, string> = {
linux: `actions-runner-linux${objectExtension['linux']}`,
win: `actions-runner-win${objectExtension['win']}`,
win: `actions-runner-windows${objectExtension['win']}`,
};

const bucketObjectKey = (os: string) => bucketObjectNames[os];

const runnerOs = [['linux'], ['win']];

const latestRelease = "2.287.0";
const latestPreRelease = "2.287.1";

beforeEach(() => {
jest.clearAllMocks();
});
Expand All @@ -77,7 +80,7 @@ describe('Synchronize action distribution.', () => {
return {
promise() {
return Promise.resolve({
TagSet: [{ Key: 'name', Value: `actions-runner-${os}-x64-2.285.1${objectExtension[os]}` }],
TagSet: [{ Key: 'name', Value: `actions-runner-${os}-x64-${latestRelease}${objectExtension[os]}` }],
});
},
};
Expand Down Expand Up @@ -107,7 +110,7 @@ describe('Synchronize action distribution.', () => {
return {
promise() {
return Promise.resolve({
TagSet: [{ Key: 'name', Value: `actions-runner-${os}-x64-2.285.1${objectExtension[os]}` }],
TagSet: [{ Key: 'name', Value: `actions-runner-${os}-x64-${latestRelease}${objectExtension[os]}` }],
});
},
};
Expand All @@ -131,7 +134,7 @@ describe('Synchronize action distribution.', () => {
return {
promise() {
return Promise.resolve({
TagSet: [{ Key: 'name', Value: `actions-runner-${os}-x64-2.286.0${objectExtension[os]}` }],
TagSet: [{ Key: 'name', Value: `actions-runner-${os}-x64-${latestPreRelease}${objectExtension[os]}` }],
});
},
};
Expand Down Expand Up @@ -167,7 +170,7 @@ describe('Synchronize action distribution.', () => {
});
expect(mockS3.upload).toBeCalledTimes(1);
const s3JsonBody = mockS3.upload.mock.calls[0][0];
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-2.285.1${objectExtension[os]}`);
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-${latestRelease}${objectExtension[os]}`);
});

test.each(runnerOs)('%p Distribution should update to release if there are no pre-releases.', async (os) => {
Expand Down Expand Up @@ -197,7 +200,7 @@ describe('Synchronize action distribution.', () => {
});
expect(mockS3.upload).toBeCalledTimes(1);
const s3JsonBody = mockS3.upload.mock.calls[0][0];
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-2.285.1${objectExtension[os]}`);
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-${latestRelease}${objectExtension[os]}`);
});

test.each(runnerOs)('%p Distribution should update to prerelease.', async (os) => {
Expand All @@ -222,7 +225,7 @@ describe('Synchronize action distribution.', () => {
});
expect(mockS3.upload).toBeCalledTimes(1);
const s3JsonBody = mockS3.upload.mock.calls[0][0];
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-2.286.0${objectExtension[os]}`);
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-${latestPreRelease}${objectExtension[os]}`);
});

test.each(runnerOs)('%p Distribution should not update to prerelease if there is a newer release.', async (os) => {
Expand Down Expand Up @@ -254,7 +257,7 @@ describe('Synchronize action distribution.', () => {
});
expect(mockS3.upload).toBeCalledTimes(1);
const s3JsonBody = mockS3.upload.mock.calls[0][0];
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-2.286.0${objectExtension[os]}`);
expect(s3JsonBody['Tagging']).toEqual(`name=actions-runner-${os}-x64-${latestPreRelease}${objectExtension[os]}`);
});

test.each(runnerOs)('%p No tag in S3, distribution should update.', async (os) => {
Expand Down
Loading

0 comments on commit 75d423d

Please sign in to comment.