@@ -25,7 +25,7 @@ describe('AzureIntegration', () => {
|
||||
azure: [
|
||||
{
|
||||
host: 'h.com',
|
||||
token: 'token',
|
||||
credentials: [{ personalAccessToken: 'token' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
+20
-4
@@ -103,7 +103,12 @@ describe('AzureDevOpsDiscoveryProcessor', () => {
|
||||
const processor = AzureDevOpsDiscoveryProcessor.fromConfig(
|
||||
new ConfigReader({
|
||||
integrations: {
|
||||
azure: [{ host: 'dev.azure.com', token: 'blob' }],
|
||||
azure: [
|
||||
{
|
||||
host: 'dev.azure.com',
|
||||
credentials: [{ personalAccessToken: 'token' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
{ logger: mockServices.logger.mock() },
|
||||
@@ -123,8 +128,14 @@ describe('AzureDevOpsDiscoveryProcessor', () => {
|
||||
new ConfigReader({
|
||||
integrations: {
|
||||
github: [
|
||||
{ host: 'dev.azure.com', token: 'blob' },
|
||||
{ host: 'azure.myorg.com', token: 'blob' },
|
||||
{
|
||||
host: 'dev.azure.com',
|
||||
credentials: [{ personalAccessToken: 'token' }],
|
||||
},
|
||||
{
|
||||
host: 'azure.myorg.com',
|
||||
credentials: [{ personalAccessToken: 'token' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
@@ -145,7 +156,12 @@ describe('AzureDevOpsDiscoveryProcessor', () => {
|
||||
const processor = AzureDevOpsDiscoveryProcessor.fromConfig(
|
||||
new ConfigReader({
|
||||
integrations: {
|
||||
github: [{ host: 'dev.azure.com', token: 'blob' }],
|
||||
github: [
|
||||
{
|
||||
host: 'dev.azure.com',
|
||||
credentials: [{ personalAccessToken: 'token' }],
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
{ logger: mockServices.logger.mock() },
|
||||
|
||||
+5
-12
@@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import {
|
||||
createMockDirectory,
|
||||
mockServices,
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { createFetchCookiecutterAction } from './cookiecutter';
|
||||
import { join } from 'node:path';
|
||||
import type { ActionContext } from '@backstage/plugin-scaffolder-node';
|
||||
@@ -46,16 +48,7 @@ jest.mock(
|
||||
|
||||
describe('fetch:cookiecutter', () => {
|
||||
const mockDir = createMockDirectory({ mockOsTmpDir: true });
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
new ConfigReader({
|
||||
integrations: {
|
||||
azure: [
|
||||
{ host: 'dev.azure.com', token: 'tokenlols' },
|
||||
{ host: 'myazurehostnotoken.com' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
const integrations = ScmIntegrations.fromConfig(mockServices.rootConfig());
|
||||
|
||||
const mockTmpDir = mockDir.path;
|
||||
|
||||
|
||||
+5
-12
@@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import {
|
||||
createMockDirectory,
|
||||
mockServices,
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { createFetchCookiecutterAction } from './cookiecutter';
|
||||
import { join } from 'node:path';
|
||||
import type { ActionContext } from '@backstage/plugin-scaffolder-node';
|
||||
@@ -45,16 +47,7 @@ jest.mock(
|
||||
|
||||
describe('fetch:cookiecutter', () => {
|
||||
const mockDir = createMockDirectory({ mockOsTmpDir: true });
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
new ConfigReader({
|
||||
integrations: {
|
||||
azure: [
|
||||
{ host: 'dev.azure.com', token: 'tokenlols' },
|
||||
{ host: 'myazurehostnotoken.com' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
const integrations = ScmIntegrations.fromConfig(mockServices.rootConfig());
|
||||
|
||||
const mockTmpDir = mockDir.path;
|
||||
|
||||
|
||||
+5
-12
@@ -27,12 +27,14 @@ jest.mock('./railsNewRunner', () => {
|
||||
};
|
||||
});
|
||||
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { resolve as resolvePath } from 'node:path';
|
||||
import { createFetchRailsAction } from './index';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import {
|
||||
createMockDirectory,
|
||||
mockServices,
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/plugin-scaffolder-node-test-utils';
|
||||
import { examples } from './index.examples';
|
||||
import yaml from 'yaml';
|
||||
@@ -41,16 +43,7 @@ import { ContainerRunner } from './ContainerRunner';
|
||||
|
||||
describe('fetch:rails', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
new ConfigReader({
|
||||
integrations: {
|
||||
azure: [
|
||||
{ host: 'dev.azure.com', token: 'tokenlols' },
|
||||
{ host: 'myazurehostnotoken.com' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
const integrations = ScmIntegrations.fromConfig(mockServices.rootConfig());
|
||||
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
|
||||
@@ -27,12 +27,14 @@ jest.mock('./railsNewRunner', () => {
|
||||
};
|
||||
});
|
||||
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { resolve as resolvePath } from 'node:path';
|
||||
import { createFetchRailsAction } from './index';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
import { createMockDirectory } from '@backstage/backend-test-utils';
|
||||
import {
|
||||
createMockDirectory,
|
||||
mockServices,
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { createMockActionContext } from '@backstage/plugin-scaffolder-node-test-utils';
|
||||
import { Writable } from 'node:stream';
|
||||
import { UrlReaderService } from '@backstage/backend-plugin-api';
|
||||
@@ -40,16 +42,7 @@ import { ContainerRunner } from './ContainerRunner';
|
||||
|
||||
describe('fetch:rails', () => {
|
||||
const mockDir = createMockDirectory();
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
new ConfigReader({
|
||||
integrations: {
|
||||
azure: [
|
||||
{ host: 'dev.azure.com', token: 'tokenlols' },
|
||||
{ host: 'myazurehostnotoken.com' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
const integrations = ScmIntegrations.fromConfig(mockServices.rootConfig());
|
||||
|
||||
const mockContext = createMockActionContext({
|
||||
input: {
|
||||
|
||||
Reference in New Issue
Block a user