-
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ca9214
commit 5d52c1d
Showing
4 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { BuildParameters, ImageTag } from '../..'; | ||
import UnityVersioning from '../../unity-versioning'; | ||
import { Cli } from '../../cli/cli'; | ||
import GitHub from '../../github'; | ||
import setups from './cloud-runner-suite.test'; | ||
|
||
async function CreateParameters(overrides: any) { | ||
if (overrides) { | ||
Cli.options = overrides; | ||
} | ||
const originalValue = GitHub.githubInputEnabled; | ||
GitHub.githubInputEnabled = false; | ||
const results = await BuildParameters.create(); | ||
GitHub.githubInputEnabled = originalValue; | ||
delete Cli.options; | ||
|
||
return results; | ||
} | ||
|
||
describe('Cloud Runner Image', () => { | ||
setups(); | ||
const testSecretName = 'testSecretName'; | ||
const testSecretValue = 'testSecretValue'; | ||
it('Can create valid image from normal config', async () => { | ||
// Setup parameters | ||
const buildParameter = await CreateParameters({ | ||
versioning: 'None', | ||
projectPath: 'test-project', | ||
unityVersion: UnityVersioning.read('test-project'), | ||
targetPlatform: 'StandaloneWindows64', | ||
customJob: ` | ||
- name: 'step 1' | ||
image: 'ubuntu' | ||
commands: 'printenv' | ||
secrets: | ||
- name: '${testSecretName}' | ||
value: '${testSecretValue}' | ||
`, | ||
}); | ||
const baseImage = new ImageTag(buildParameter); | ||
if (buildParameter.targetPlatform === undefined) { | ||
throw new Error(`target platform includes undefined`); | ||
} | ||
if (baseImage.toString().includes('undefined')) { | ||
throw new Error(`Base image ${baseImage.toString()} includes undefined`); | ||
} | ||
}, 1_000_000_000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters