fix
parent
445987c66d
commit
f501336da5
|
@ -43,8 +43,14 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
test:
|
test:
|
||||||
- "cloud-runner-async-workflow"
|
- 'cloud-runner-async-workflow'
|
||||||
- "cloud-runner-local-docker-persistence"
|
- 'cloud-runner-caching'
|
||||||
|
- 'cloud-runner-end2end-caching'
|
||||||
|
- 'cloud-runner-end2end-retaining'
|
||||||
|
- 'cloud-runner-environment'
|
||||||
|
- 'cloud-runner-hooks'
|
||||||
|
- 'cloud-runner-local-persistence'
|
||||||
|
- 'cloud-runner-locking'
|
||||||
cloudRunnerCluster:
|
cloudRunnerCluster:
|
||||||
- local-docker
|
- local-docker
|
||||||
steps:
|
steps:
|
||||||
|
@ -52,25 +58,6 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
lfs: false
|
lfs: false
|
||||||
- name: Configure AWS Credentials
|
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
|
||||||
with:
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws-region: eu-west-2
|
|
||||||
- uses: google-github-actions/auth@v1
|
|
||||||
if: matrix.CloudRunnerCluster == 'k8s'
|
|
||||||
with:
|
|
||||||
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
|
|
||||||
- name: 'Set up Cloud SDK'
|
|
||||||
if: matrix.CloudRunnerCluster == 'k8s'
|
|
||||||
uses: 'google-github-actions/setup-gcloud@v1'
|
|
||||||
- name: Get GKE cluster credentials
|
|
||||||
if: matrix.CloudRunnerCluster == 'k8s'
|
|
||||||
run: |
|
|
||||||
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
|
|
||||||
gcloud components install gke-gcloud-auth-plugin
|
|
||||||
gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT
|
|
||||||
- run: yarn
|
- run: yarn
|
||||||
- run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand
|
- run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
@ -89,6 +76,15 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
test:
|
||||||
|
- 'cloud-runner-async-workflow'
|
||||||
|
- 'cloud-runner-caching'
|
||||||
|
- 'cloud-runner-end2end-caching'
|
||||||
|
- 'cloud-runner-end2end-retaining'
|
||||||
|
- 'cloud-runner-environment'
|
||||||
|
- 'cloud-runner-hooks'
|
||||||
|
- 'cloud-runner-local-persistence'
|
||||||
|
- 'cloud-runner-locking'
|
||||||
cloudRunnerCluster:
|
cloudRunnerCluster:
|
||||||
- aws
|
- aws
|
||||||
- local-docker
|
- local-docker
|
||||||
|
@ -118,8 +114,8 @@ jobs:
|
||||||
gcloud components install gke-gcloud-auth-plugin
|
gcloud components install gke-gcloud-auth-plugin
|
||||||
gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT
|
gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT
|
||||||
- run: yarn
|
- run: yarn
|
||||||
- run: yarn run test-i --detectOpenHandles --forceExit --runInBand
|
- run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand
|
||||||
timeout-minutes: 180
|
timeout-minutes: 15
|
||||||
env:
|
env:
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
PROJECT_PATH: test-project
|
PROJECT_PATH: test-project
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
import { BuildParameters } from '../..';
|
|
||||||
import { TaskParameterSerializer } from '../services/task-parameter-serializer';
|
|
||||||
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) {
|
|
||||||
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 Environment Serializer', () => {
|
|
||||||
setups();
|
|
||||||
const testSecretName = 'testSecretName';
|
|
||||||
const testSecretValue = 'testSecretValue';
|
|
||||||
it('Cloud Runner Parameter Serialization', async () => {
|
|
||||||
// Setup parameters
|
|
||||||
const buildParameter = await CreateParameters({
|
|
||||||
versioning: 'None',
|
|
||||||
projectPath: 'test-project',
|
|
||||||
unityVersion: UnityVersioning.read('test-project'),
|
|
||||||
customJob: `
|
|
||||||
- name: 'step 1'
|
|
||||||
image: 'alpine'
|
|
||||||
commands: 'printenv'
|
|
||||||
secrets:
|
|
||||||
- name: '${testSecretName}'
|
|
||||||
value: '${testSecretValue}'
|
|
||||||
`,
|
|
||||||
});
|
|
||||||
|
|
||||||
const result = TaskParameterSerializer.createCloudRunnerEnvironmentVariables(buildParameter);
|
|
||||||
expect(result.find((x) => Number.parseInt(x.name)) !== undefined).toBeFalsy();
|
|
||||||
const result2 = TaskParameterSerializer.createCloudRunnerEnvironmentVariables(buildParameter);
|
|
||||||
expect(result2.find((x) => Number.parseInt(x.name)) !== undefined).toBeFalsy();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,19 +1,26 @@
|
||||||
import { BuildParameters, ImageTag } from '../..';
|
import { BuildParameters, CloudRunner, ImageTag, Input } from '../..';
|
||||||
import CloudRunner from '../cloud-runner';
|
|
||||||
import Input from '../../input';
|
|
||||||
import { CloudRunnerStatics } from '../cloud-runner-statics';
|
|
||||||
import { TaskParameterSerializer } from '../services/task-parameter-serializer';
|
import { TaskParameterSerializer } from '../services/task-parameter-serializer';
|
||||||
import UnityVersioning from '../../unity-versioning';
|
import UnityVersioning from '../../unity-versioning';
|
||||||
import { Cli } from '../../cli/cli';
|
import { Cli } from '../../cli/cli';
|
||||||
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
import GitHub from '../../github';
|
||||||
import CloudRunnerOptions from '../cloud-runner-options';
|
|
||||||
import setups from './cloud-runner-suite.test';
|
import setups from './cloud-runner-suite.test';
|
||||||
|
import { CloudRunnerStatics } from '../cloud-runner-statics';
|
||||||
|
import CloudRunnerOptions from '../cloud-runner-options';
|
||||||
|
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
||||||
|
|
||||||
async function CreateParameters(overrides) {
|
async function CreateParameters(overrides) {
|
||||||
if (overrides) Cli.options = overrides;
|
if (overrides) {
|
||||||
|
Cli.options = overrides;
|
||||||
|
}
|
||||||
|
const originalValue = GitHub.githubInputEnabled;
|
||||||
|
GitHub.githubInputEnabled = false;
|
||||||
|
const results = await BuildParameters.create();
|
||||||
|
GitHub.githubInputEnabled = originalValue;
|
||||||
|
delete Cli.options;
|
||||||
|
|
||||||
return BuildParameters.create();
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('Cloud Runner Sync Environments', () => {
|
describe('Cloud Runner Sync Environments', () => {
|
||||||
setups();
|
setups();
|
||||||
const testSecretName = 'testSecretName';
|
const testSecretName = 'testSecretName';
|
||||||
|
@ -75,3 +82,30 @@ describe('Cloud Runner Sync Environments', () => {
|
||||||
}, 1_000_000_000);
|
}, 1_000_000_000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Cloud Runner Environment Serializer', () => {
|
||||||
|
setups();
|
||||||
|
const testSecretName = 'testSecretName';
|
||||||
|
const testSecretValue = 'testSecretValue';
|
||||||
|
it('Cloud Runner Parameter Serialization', async () => {
|
||||||
|
// Setup parameters
|
||||||
|
const buildParameter = await CreateParameters({
|
||||||
|
versioning: 'None',
|
||||||
|
projectPath: 'test-project',
|
||||||
|
unityVersion: UnityVersioning.read('test-project'),
|
||||||
|
customJob: `
|
||||||
|
- name: 'step 1'
|
||||||
|
image: 'alpine'
|
||||||
|
commands: 'printenv'
|
||||||
|
secrets:
|
||||||
|
- name: '${testSecretName}'
|
||||||
|
value: '${testSecretValue}'
|
||||||
|
`,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = TaskParameterSerializer.createCloudRunnerEnvironmentVariables(buildParameter);
|
||||||
|
expect(result.find((x) => Number.parseInt(x.name)) !== undefined).toBeFalsy();
|
||||||
|
const result2 = TaskParameterSerializer.createCloudRunnerEnvironmentVariables(buildParameter);
|
||||||
|
expect(result2.find((x) => Number.parseInt(x.name)) !== undefined).toBeFalsy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,11 +1,11 @@
|
||||||
import CloudRunner from '../cloud-runner';
|
import CloudRunner from '../../cloud-runner';
|
||||||
import { BuildParameters, ImageTag } from '../..';
|
import { BuildParameters, ImageTag } from '../../..';
|
||||||
import UnityVersioning from '../../unity-versioning';
|
import UnityVersioning from '../../../unity-versioning';
|
||||||
import { Cli } from '../../cli/cli';
|
import { Cli } from '../../../cli/cli';
|
||||||
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import CloudRunnerOptions from '../cloud-runner-options';
|
import CloudRunnerOptions from '../../cloud-runner-options';
|
||||||
import setups from './cloud-runner-suite.test';
|
import setups from '../cloud-runner-suite.test';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
|
||||||
async function CreateParameters(overrides) {
|
async function CreateParameters(overrides) {
|
|
@ -1,15 +1,15 @@
|
||||||
import CloudRunner from '../cloud-runner';
|
import CloudRunner from '../../cloud-runner';
|
||||||
import { ImageTag } from '../..';
|
import { ImageTag } from '../../..';
|
||||||
import UnityVersioning from '../../unity-versioning';
|
import UnityVersioning from '../../../unity-versioning';
|
||||||
import CloudRunnerLogger from '../services/cloud-runner-logger';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import CloudRunnerOptions from '../cloud-runner-options';
|
import CloudRunnerOptions from '../../cloud-runner-options';
|
||||||
import setups from './cloud-runner-suite.test';
|
import setups from './../cloud-runner-suite.test';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { CloudRunnerFolders } from '../services/cloud-runner-folders';
|
import { CloudRunnerFolders } from '../../services/cloud-runner-folders';
|
||||||
import SharedWorkspaceLocking from '../services/shared-workspace-locking';
|
import SharedWorkspaceLocking from '../../services/shared-workspace-locking';
|
||||||
import { CreateParameters } from './create-test-parameter';
|
import { CreateParameters } from '../create-test-parameter';
|
||||||
|
|
||||||
describe('Cloud Runner Retain Workspace', () => {
|
describe('Cloud Runner Retain Workspace', () => {
|
||||||
it('Responds', () => {});
|
it('Responds', () => {});
|
Loading…
Reference in New Issue