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
|
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
||||||
modulePathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/dist/'],
|
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
|
// 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.
|
// Integration test for exercising real GitHub check creation and updates.
|
||||||
import { BuildParameters } from '../model';
|
|
||||||
import CloudRunner from '../model/cloud-runner/cloud-runner';
|
import CloudRunner from '../model/cloud-runner/cloud-runner';
|
||||||
import UnityVersioning from '../model/unity-versioning';
|
import UnityVersioning from '../model/unity-versioning';
|
||||||
import { Cli } from '../model/cli/cli';
|
|
||||||
import GitHub from '../model/github';
|
import GitHub from '../model/github';
|
||||||
import { OptionValues } from 'commander';
|
import { TIMEOUT_INFINITE, createParameters } from '../test-utils/cloud-runner-test-helpers';
|
||||||
|
|
||||||
export const TIMEOUT_INFINITE = 1e9;
|
|
||||||
|
|
||||||
async function createParameters(overrides?: OptionValues) {
|
|
||||||
if (overrides) Cli.options = overrides;
|
|
||||||
|
|
||||||
return BuildParameters.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
const runIntegration = process.env.RUN_GITHUB_INTEGRATION_TESTS === 'true';
|
const runIntegration = process.env.RUN_GITHUB_INTEGRATION_TESTS === 'true';
|
||||||
const describeOrSkip = runIntegration ? describe : describe.skip;
|
const describeOrSkip = runIntegration ? describe : describe.skip;
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
import { BuildParameters } from '../..';
|
|
||||||
import CloudRunner from '../cloud-runner';
|
import CloudRunner from '../cloud-runner';
|
||||||
import UnityVersioning from '../../unity-versioning';
|
import UnityVersioning from '../../unity-versioning';
|
||||||
import { Cli } from '../../cli/cli';
|
|
||||||
import setups from './cloud-runner-suite.test';
|
import setups from './cloud-runner-suite.test';
|
||||||
import { OptionValues } from 'commander';
|
|
||||||
import GitHub from '../../github';
|
import GitHub from '../../github';
|
||||||
export const TIMEOUT_INFINITE = 1e9;
|
import { TIMEOUT_INFINITE, createParameters } from '../../../test-utils/cloud-runner-test-helpers';
|
||||||
async function CreateParameters(overrides: OptionValues | undefined) {
|
|
||||||
if (overrides) Cli.options = overrides;
|
|
||||||
|
|
||||||
return BuildParameters.create();
|
|
||||||
}
|
|
||||||
describe('Cloud Runner Github Checks', () => {
|
describe('Cloud Runner Github Checks', () => {
|
||||||
setups();
|
setups();
|
||||||
it('Responds', () => {});
|
it('Responds', () => {});
|
||||||
|
@ -36,7 +28,7 @@ describe('Cloud Runner Github Checks', () => {
|
||||||
'Check Handling Direct',
|
'Check Handling Direct',
|
||||||
async () => {
|
async () => {
|
||||||
// Setup parameters
|
// Setup parameters
|
||||||
const buildParameter = await CreateParameters({
|
const buildParameter = await createParameters({
|
||||||
versioning: 'None',
|
versioning: 'None',
|
||||||
projectPath: 'test-project',
|
projectPath: 'test-project',
|
||||||
unityVersion: UnityVersioning.read('test-project'),
|
unityVersion: UnityVersioning.read('test-project'),
|
||||||
|
@ -54,7 +46,7 @@ describe('Cloud Runner Github Checks', () => {
|
||||||
'Check Handling Via Async Workflow',
|
'Check Handling Via Async Workflow',
|
||||||
async () => {
|
async () => {
|
||||||
// Setup parameters
|
// Setup parameters
|
||||||
const buildParameter = await CreateParameters({
|
const buildParameter = await createParameters({
|
||||||
versioning: 'None',
|
versioning: 'None',
|
||||||
projectPath: 'test-project',
|
projectPath: 'test-project',
|
||||||
unityVersion: UnityVersioning.read('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