local-system is now used for cloud runner test implementation AND correctly unset test CLI input
parent
3bc006b05d
commit
096443b669
|
|
@ -55,7 +55,7 @@ function runMain() {
|
|||
const { workspace, actionFolder } = model_1.Action;
|
||||
const buildParameters = yield model_1.BuildParameters.create();
|
||||
const baseImage = new model_1.ImageTag(buildParameters);
|
||||
if (buildParameters.cloudRunnerCluster !== undefined && buildParameters.cloudRunnerCluster !== '') {
|
||||
if (buildParameters.cloudRunnerCluster !== 'local') {
|
||||
yield model_1.CloudRunner.run(buildParameters, baseImage.toString());
|
||||
}
|
||||
else {
|
||||
|
|
@ -1870,7 +1870,7 @@ class CloudRunner {
|
|||
case 'test':
|
||||
CloudRunner.CloudRunnerProviderPlatform = new test_1.default();
|
||||
break;
|
||||
case 'local':
|
||||
case 'local-system':
|
||||
CloudRunner.CloudRunnerProviderPlatform = new local_1.default();
|
||||
break;
|
||||
case 'local-docker':
|
||||
|
|
@ -3804,8 +3804,9 @@ class ImageTag {
|
|||
this.editorVersion = editorVersion;
|
||||
this.targetPlatform = targetPlatform;
|
||||
this.cloudRunnerBuilderPlatform = cloudRunnerBuilderPlatform;
|
||||
const isCloudRunnerLocal = cloudRunnerBuilderPlatform === 'local' || cloudRunnerBuilderPlatform === undefined;
|
||||
this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion);
|
||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(process.platform);
|
||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform);
|
||||
this.imageRollingVersion = 1; // will automatically roll to the latest non-breaking version.
|
||||
}
|
||||
static get versionPattern() {
|
||||
|
|
@ -3909,7 +3910,7 @@ class ImageTag {
|
|||
}
|
||||
get tag() {
|
||||
const versionAndPlatform = `${this.editorVersion}-${this.builderPlatform}`.replace(/-+$/, '');
|
||||
return `${this.cloudRunnerBuilderPlatform ? this.cloudRunnerBuilderPlatform : this.imagePlatformPrefix}-${versionAndPlatform}-${this.imageRollingVersion}`;
|
||||
return `${this.imagePlatformPrefix}-${versionAndPlatform}-${this.imageRollingVersion}`;
|
||||
}
|
||||
get image() {
|
||||
return `${this.repository}/${this.name}`.replace(/^\/+/, '');
|
||||
|
|
@ -4224,8 +4225,8 @@ class Input {
|
|||
if (input) {
|
||||
return input;
|
||||
}
|
||||
if (this.cloudRunnerCluster) {
|
||||
return 'ubuntu';
|
||||
if (Input.cloudRunnerCluster !== 'local') {
|
||||
return 'linux';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -4349,7 +4350,7 @@ class Input {
|
|||
if (cli_1.CLI.cliMode) {
|
||||
return Input.getInput('cloudRunnerCluster') || 'aws';
|
||||
}
|
||||
return Input.getInput('cloudRunnerCluster') || undefined;
|
||||
return Input.getInput('cloudRunnerCluster') || 'local';
|
||||
}
|
||||
static get cloudRunnerCpu() {
|
||||
return Input.getInput('cloudRunnerCpu') || '1.0';
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -17,7 +17,7 @@ async function runMain() {
|
|||
const buildParameters = await BuildParameters.create();
|
||||
const baseImage = new ImageTag(buildParameters);
|
||||
|
||||
if (buildParameters.cloudRunnerCluster !== undefined && buildParameters.cloudRunnerCluster !== '') {
|
||||
if (buildParameters.cloudRunnerCluster !== 'local') {
|
||||
await CloudRunner.run(buildParameters, baseImage.toString());
|
||||
} else {
|
||||
core.info('Building locally');
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class BuildParameters {
|
|||
public androidSdkManagerParameters!: string;
|
||||
public customParameters!: string;
|
||||
public sshAgent!: string;
|
||||
public cloudRunnerCluster!: string | undefined;
|
||||
public cloudRunnerCluster!: string;
|
||||
public awsBaseStackName!: string;
|
||||
public gitPrivateToken!: string;
|
||||
public awsStackName!: string;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ describe('Cloud Runner', () => {
|
|||
versioning: 'None',
|
||||
projectPath: 'test-project',
|
||||
unityVersion: UnityVersioning.read('test-project'),
|
||||
cloudRunnerCluster: 'local',
|
||||
cloudRunnerCluster: 'local-system',
|
||||
targetPlatform: 'StandaloneLinux64',
|
||||
customJob: `
|
||||
- name: 'step 1'
|
||||
|
|
@ -44,7 +44,7 @@ describe('Cloud Runner', () => {
|
|||
// run the job
|
||||
await expect(CloudRunner.run(buildParameter, baseImage.toString())).resolves.not.toThrow();
|
||||
Input.githubInputEnabled = true;
|
||||
CLI.options = undefined;
|
||||
delete CLI.options;
|
||||
}, 1000000);
|
||||
it('Test cloud runner returns commands', async () => {
|
||||
// build parameters
|
||||
|
|
@ -62,7 +62,7 @@ describe('Cloud Runner', () => {
|
|||
// run the job
|
||||
await expect(CloudRunner.run(buildParameter, baseImage.toString())).resolves.not.toThrow();
|
||||
Input.githubInputEnabled = true;
|
||||
CLI.options = undefined;
|
||||
delete CLI.options;
|
||||
}, 1000000);
|
||||
if (Input.cloudRunnerTests) {
|
||||
it('All build parameters sent to cloud runner as env vars', async () => {
|
||||
|
|
@ -103,7 +103,7 @@ describe('Cloud Runner', () => {
|
|||
expect(newLinePurgedFile).toContain(`${element.name}=${element.value}`);
|
||||
}
|
||||
}
|
||||
CLI.options = undefined;
|
||||
delete CLI.options;
|
||||
}, 1000000);
|
||||
it('Run one build it should not use cache, run subsequent build which should use cache', async () => {
|
||||
CLI.options = {
|
||||
|
|
@ -122,7 +122,7 @@ describe('Cloud Runner', () => {
|
|||
expect(results).toContain(libraryString);
|
||||
const results2 = await CloudRunner.run(buildParameter, baseImage.toString());
|
||||
expect(results2).toEqual(expect.not.stringContaining(libraryString));
|
||||
CLI.options = undefined;
|
||||
delete CLI.options;
|
||||
}, 1000000);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class CloudRunner {
|
|||
case 'test':
|
||||
CloudRunner.CloudRunnerProviderPlatform = new TestCloudRunner();
|
||||
break;
|
||||
case 'local':
|
||||
case 'local-system':
|
||||
CloudRunner.CloudRunnerProviderPlatform = new LocalCloudRunner();
|
||||
break;
|
||||
case 'local-docker':
|
||||
|
|
|
|||
|
|
@ -30,8 +30,11 @@ class ImageTag {
|
|||
this.editorVersion = editorVersion;
|
||||
this.targetPlatform = targetPlatform;
|
||||
this.cloudRunnerBuilderPlatform = cloudRunnerBuilderPlatform;
|
||||
const isCloudRunnerLocal = cloudRunnerBuilderPlatform === 'local' || cloudRunnerBuilderPlatform === undefined;
|
||||
this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion);
|
||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(process.platform);
|
||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(
|
||||
isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform,
|
||||
);
|
||||
this.imageRollingVersion = 1; // will automatically roll to the latest non-breaking version.
|
||||
}
|
||||
|
||||
|
|
@ -143,9 +146,7 @@ class ImageTag {
|
|||
get tag() {
|
||||
const versionAndPlatform = `${this.editorVersion}-${this.builderPlatform}`.replace(/-+$/, '');
|
||||
|
||||
return `${
|
||||
this.cloudRunnerBuilderPlatform ? this.cloudRunnerBuilderPlatform : this.imagePlatformPrefix
|
||||
}-${versionAndPlatform}-${this.imageRollingVersion}`;
|
||||
return `${this.imagePlatformPrefix}-${versionAndPlatform}-${this.imageRollingVersion}`;
|
||||
}
|
||||
|
||||
get image() {
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ class Input {
|
|||
if (input) {
|
||||
return input;
|
||||
}
|
||||
if (this.cloudRunnerCluster) {
|
||||
return 'ubuntu';
|
||||
if (Input.cloudRunnerCluster !== 'local') {
|
||||
return 'linux';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ class Input {
|
|||
if (CLI.cliMode) {
|
||||
return Input.getInput('cloudRunnerCluster') || 'aws';
|
||||
}
|
||||
return Input.getInput('cloudRunnerCluster') || undefined;
|
||||
return Input.getInput('cloudRunnerCluster') || 'local';
|
||||
}
|
||||
|
||||
static get cloudRunnerCpu() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue