refactor: extract cloud runner test helpers
parent
259dcad3dc
commit
203ecf61e4
|
@ -25,9 +25,6 @@ module.exports = {
|
|||
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
||||
modulePathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/dist/'],
|
||||
|
||||
// A list of paths to modules that run some code before each test file
|
||||
setupFiles: ['<rootDir>/src/jest.globals.ts'],
|
||||
|
||||
// A list of paths to modules that run some code to configure or set up the testing framework after the environment is ready
|
||||
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
|
||||
setupFilesAfterEnv: ['<rootDir>/src/jest.globals.ts', '<rootDir>/src/jest.setup.ts'],
|
||||
};
|
||||
|
|
|
@ -1,18 +1,8 @@
|
|||
// Integration test for exercising real GitHub check creation and updates.
|
||||
import { BuildParameters } from '../model';
|
||||
import CloudRunner from '../model/cloud-runner/cloud-runner';
|
||||
import UnityVersioning from '../model/unity-versioning';
|
||||
import { Cli } from '../model/cli/cli';
|
||||
import GitHub from '../model/github';
|
||||
import { OptionValues } from 'commander';
|
||||
|
||||
export const TIMEOUT_INFINITE = 1e9;
|
||||
|
||||
async function createParameters(overrides?: OptionValues) {
|
||||
if (overrides) Cli.options = overrides;
|
||||
|
||||
return BuildParameters.create();
|
||||
}
|
||||
import { TIMEOUT_INFINITE, createParameters } from '../test-utils/cloud-runner-test-helpers';
|
||||
|
||||
const runIntegration = process.env.RUN_GITHUB_INTEGRATION_TESTS === 'true';
|
||||
const describeOrSkip = runIntegration ? describe : describe.skip;
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
import { BuildParameters } from '../..';
|
||||
import CloudRunner from '../cloud-runner';
|
||||
import UnityVersioning from '../../unity-versioning';
|
||||
import { Cli } from '../../cli/cli';
|
||||
import setups from './cloud-runner-suite.test';
|
||||
import { OptionValues } from 'commander';
|
||||
import GitHub from '../../github';
|
||||
export const TIMEOUT_INFINITE = 1e9;
|
||||
async function CreateParameters(overrides: OptionValues | undefined) {
|
||||
if (overrides) Cli.options = overrides;
|
||||
|
||||
return BuildParameters.create();
|
||||
}
|
||||
import { TIMEOUT_INFINITE, createParameters } from '../../../test-utils/cloud-runner-test-helpers';
|
||||
describe('Cloud Runner Github Checks', () => {
|
||||
setups();
|
||||
it('Responds', () => {});
|
||||
|
@ -36,7 +28,7 @@ describe('Cloud Runner Github Checks', () => {
|
|||
'Check Handling Direct',
|
||||
async () => {
|
||||
// Setup parameters
|
||||
const buildParameter = await CreateParameters({
|
||||
const buildParameter = await createParameters({
|
||||
versioning: 'None',
|
||||
projectPath: 'test-project',
|
||||
unityVersion: UnityVersioning.read('test-project'),
|
||||
|
@ -54,7 +46,7 @@ describe('Cloud Runner Github Checks', () => {
|
|||
'Check Handling Via Async Workflow',
|
||||
async () => {
|
||||
// Setup parameters
|
||||
const buildParameter = await CreateParameters({
|
||||
const buildParameter = await createParameters({
|
||||
versioning: 'None',
|
||||
projectPath: 'test-project',
|
||||
unityVersion: UnityVersioning.read('test-project'),
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import { BuildParameters } from '../model';
|
||||
import { Cli } from '../model/cli/cli';
|
||||
import { OptionValues } from 'commander';
|
||||
|
||||
export const TIMEOUT_INFINITE = 1e9;
|
||||
|
||||
export async function createParameters(overrides?: OptionValues) {
|
||||
if (overrides) Cli.options = overrides;
|
||||
return BuildParameters.create();
|
||||
}
|
Loading…
Reference in New Issue