unity-builder/src/model/cloud-runner/tests/cloud-runner-run-once-custo...

58 lines
2.7 KiB
TypeScript
Raw Normal View History

Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
import CloudRunner from '../cloud-runner';
import { BuildParameters, ImageTag } from '../..';
import UnityVersioning from '../../unity-versioning';
import { Cli } from '../../cli/cli';
import CloudRunnerLogger from '../services/cloud-runner-logger';
import { v4 as uuidv4 } from 'uuid';
import CloudRunnerOptions from '../cloud-runner-options';
import setups from './cloud-runner-suite.test';
2022-10-08 01:29:11 +00:00
import { CloudRunnerCustomSteps } from '../services/cloud-runner-custom-steps';
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
async function CreateParameters(overrides) {
if (overrides) {
Cli.options = overrides;
}
return await BuildParameters.create();
}
describe('Cloud Runner Custom Hooks', () => {
it('Responds', () => {});
setups();
2022-10-08 01:29:11 +00:00
it('Check for pre and post custom hooks run contents', async () => {
CloudRunnerLogger.log(JSON.stringify(CloudRunnerCustomSteps.GetCustomStepsFromFiles(`before`), undefined, 4));
});
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
if (CloudRunnerOptions.cloudRunnerTests && CloudRunnerOptions.cloudRunnerCluster !== `k8s`) {
2022-10-06 21:35:52 +00:00
it('Check for pre and post custom hooks run contents', async () => {
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
const overrides = {
versioning: 'None',
projectPath: 'test-project',
unityVersion: UnityVersioning.determineUnityVersion('test-project', UnityVersioning.read('test-project')),
targetPlatform: 'StandaloneLinux64',
cacheKey: `test-case-${uuidv4()}`,
};
const buildParameter2 = await CreateParameters(overrides);
const baseImage2 = new ImageTag(buildParameter2);
const results2 = await CloudRunner.run(buildParameter2, baseImage2.toString());
CloudRunnerLogger.log(`run 2 succeeded`);
const build2ContainsBuildSucceeded = results2.includes('Build succeeded');
2022-10-07 00:33:07 +00:00
const build2ContainsPreBuildHookMessage = results2.includes('RunCustomHookFiles: before-build');
const build2ContainsPostBuildHookMessage = results2.includes('RunCustomHookFiles: after-build');
2022-10-07 23:32:52 +00:00
const build2ContainsPreBuildHookRunMessage = results2.includes('before-build hook test!');
const build2ContainsPostBuildHookRunMessage = results2.includes('after-build hook test!');
const build2ContainsPreBuildStepMessage = results2.includes('before-build step test!');
const build2ContainsPostBuildStepMessage = results2.includes('after-build step test!');
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
expect(build2ContainsBuildSucceeded).toBeTruthy();
expect(build2ContainsPreBuildHookMessage).toBeTruthy();
expect(build2ContainsPostBuildHookMessage).toBeTruthy();
2022-10-07 00:33:07 +00:00
expect(build2ContainsPreBuildHookRunMessage).toBeTruthy();
expect(build2ContainsPostBuildHookRunMessage).toBeTruthy();
2022-10-07 23:32:52 +00:00
expect(build2ContainsPreBuildStepMessage).toBeTruthy();
expect(build2ContainsPostBuildStepMessage).toBeTruthy();
Cloud Runner 1.0 (#459) * Fix: post build caching, use linux path conversion * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Fix: post build caching via CLI * Log if retained workspace option is present for testing * Log if retained workspace option is present for testing * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Use retained workspace :O * Ignore garbage creating lock actions in test for now * Lock workspace when using Get or Create Locked Workspace * Lock workspace before creating workspace file to allow for an unblockable creation sequence with guarenteed lock for the original creator * intuitive locking logs from the most important flow * test naming * consider lock folders without workspace file locked * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Use cache key to segment lock folders * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Skip all locking actions test as we now have two useful test flows * Copy all of data folder to docker volume to enable local-docker retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Fix: check for retained workspace * Skip main clone if game repo exists * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * handle cloud runner git sync via sha not only branch * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * transfer locked workspace to static CloudRunner field * custom hook files and test * custom hook files and test * custom hook files and test
2022-10-06 19:42:33 +00:00
}, 10000000);
}
});