mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-11 08:23:56 -07:00
Generalize unity-builder plugin contract (#832)
* refactor: generalize unity-builder plugin contract * test: preserve orchestrator plugin compatibility target * refactor: rename build plugin to plugin
This commit is contained in:
@@ -24,10 +24,10 @@ const mockPlugin = {
|
||||
handlePostBuild: jest.fn().mockResolvedValue(undefined),
|
||||
};
|
||||
|
||||
const mockLoadOrchestratorPlugin = jest.fn().mockResolvedValue(mockPlugin);
|
||||
const mockLoadPlugin = jest.fn().mockResolvedValue(mockPlugin);
|
||||
|
||||
jest.mock('./model/orchestrator-plugin', () => ({
|
||||
loadOrchestratorPlugin: mockLoadOrchestratorPlugin,
|
||||
jest.mock('./model/plugin', () => ({
|
||||
loadPlugin: mockLoadPlugin,
|
||||
}));
|
||||
|
||||
jest.mock('@actions/core');
|
||||
@@ -119,7 +119,7 @@ describe('index.ts plugin lifecycle wiring', () => {
|
||||
// Reset plugin to default behavior
|
||||
mockPlugin.canHandleBuild.mockReturnValue(false);
|
||||
mockPlugin.handleBuild.mockResolvedValue({ exitCode: 0 });
|
||||
mockLoadOrchestratorPlugin.mockResolvedValue(mockPlugin);
|
||||
mockLoadPlugin.mockResolvedValue(mockPlugin);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -226,7 +226,7 @@ describe('index.ts plugin lifecycle wiring', () => {
|
||||
describe('no plugin installed', () => {
|
||||
it('should build locally without errors when providerStrategy is local', async () => {
|
||||
const { Docker } = require('./model');
|
||||
mockLoadOrchestratorPlugin.mockResolvedValue(undefined);
|
||||
mockLoadPlugin.mockResolvedValue(undefined);
|
||||
|
||||
await runIndex({ providerStrategy: 'local' });
|
||||
|
||||
@@ -235,7 +235,7 @@ describe('index.ts plugin lifecycle wiring', () => {
|
||||
|
||||
it('should error when providerStrategy is non-local and no plugin', async () => {
|
||||
const core = require('@actions/core');
|
||||
mockLoadOrchestratorPlugin.mockResolvedValue(undefined);
|
||||
mockLoadPlugin.mockResolvedValue(undefined);
|
||||
|
||||
await runIndex({ providerStrategy: 'aws' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user