Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/model/unity/runner/runner-image-tag.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,22 @@ describe('RunnerImageTag', () => {
}
});

it('returns no specific build platform for generic targetPlatforms', () => {
// Real bug (game-ci/unity-activate#111): this used to resolve to an
// empty suffix, producing "ubuntu-2019.2.11f1-3" - a tag unityci/editor
// never publishes ("manifest unknown" on docker pull). NoTarget/generic
// now resolves to the same 'base' image StandaloneLinux64 uses.
it("resolves generic targetPlatforms to the 'base' image, not an empty suffix", () => {
const image = new RunnerImageTag({
targetPlatform: 'NoTarget',
hostPlatform: process.platform,
});

switch (process.platform) {
case 'win32':
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-3`);
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-base-3`);
break;
case 'linux':
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-3`);
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-base-3`);
break;
}
});
Expand Down
29 changes: 26 additions & 3 deletions src/model/unity/runner/runner-image-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ class RunnerImageTag {

static get targetPlatformSuffixes() {
return {
// Used only by the internal 'Test' targetPlatform (unit-test
// scaffolding, never a real Docker pull) - kept as-is.
generic: '',
// unityci/editor never publishes a bare "ubuntu-<version>-<n>" tag -
// every real image has a module suffix. 'base' is the same image
// StandaloneLinux64 (pre-il2cpp) resolves to, and is what NoTarget
// actually needs: an editor image, not tied to any build target.
// Found via unity-activate#111's thin-wrapper CI: `game-ci activate`
// (which defaults targetPlatform to NoTarget, see #79) tried to pull
// "unityci/editor:ubuntu-2019.2.17f1-3" - manifest unknown.
noTarget: 'base',
webgl: 'webgl',
mac: 'mac-mono',
windows: 'windows-mono',
Expand Down Expand Up @@ -82,8 +92,21 @@ class RunnerImageTag {

static getTargetPlatformToTargetPlatformSuffixMap(hostPlatform: string, targetPlatform: string, version: string) {
log.info(hostPlatform, targetPlatform, version);
const { generic, webgl, mac, windows, windowsIl2cpp, wsaPlayer, linux, linuxIl2cpp, android, ios, tvos, facebook } =
RunnerImageTag.targetPlatformSuffixes;
const {
generic,
noTarget,
webgl,
mac,
windows,
windowsIl2cpp,
wsaPlayer,
linux,
linuxIl2cpp,
android,
ios,
tvos,
facebook,
} = RunnerImageTag.targetPlatformSuffixes;

const [major, minor] = version.split('.').map(Number);

Expand Down Expand Up @@ -148,7 +171,7 @@ class RunnerImageTag {
case UnityTargetPlatform.Facebook:
return facebook;
case UnityTargetPlatform.NoTarget:
return generic;
return noTarget;

// Test specific
case UnityTargetPlatform.Test:
Expand Down
Loading