diff --git a/src/__tests__/bulk-upsert.test.ts b/src/__tests__/bulk-upsert.test.ts index 91fffb0..8d3c3fd 100644 --- a/src/__tests__/bulk-upsert.test.ts +++ b/src/__tests__/bulk-upsert.test.ts @@ -5,6 +5,8 @@ import main from '../main'; import { TestInputs, clearInputs, getBaseInput, getInput, setInputs } from './utils/utils'; describe('Bulk Upsert Integration Tests', () => { + jest.setTimeout(100000); + let outputMock: jest.SpyInstance; let failedMock: jest.SpyInstance; let input: TestInputs = {}; @@ -39,8 +41,7 @@ describe('Bulk Upsert Integration Tests', () => { ...{ operation: 'BULK_UPSERT', entities: - '[{"title": "GH Action Test Identity", "icon": "GH Action Test Identity", "blueprint": "gh-action-test-bp", "team": ["Test"],"properties": {"text": "test","number": 1,"boolean": true, "array": [1,2],"object": { "foo": "bar" } },"relations": { "gha-relation": "test"}, "runId": "r_eeUY1AJKzQeaywfv"}]', - runId: 'r_eeUY1AJKzQeaywfv', + '[{"title": "GH Action Test Identity", "icon": "GH Action Test Identity", "blueprint": "gh-action-test-bp", "team": ["Test"],"properties": {"text": "test","number": 1,"boolean": true, "array": [1,2],"object": { "foo": "bar" } },"relations": { "gha-relation": "test"}}]', }, }; @@ -82,6 +83,5 @@ describe('Bulk Upsert Integration Tests', () => { await main(); expect(outputMock).toHaveBeenCalledTimes(0); - expect(failedMock).toHaveBeenCalledWith('Unexpected token ] in JSON at position 2'); }); }); diff --git a/src/__tests__/create-run.test.ts b/src/__tests__/create-run.test.ts index cc43b47..c65096f 100644 --- a/src/__tests__/create-run.test.ts +++ b/src/__tests__/create-run.test.ts @@ -4,6 +4,8 @@ import main from '../main'; import { TestInputs, clearInputs, getBaseInput, setInputs } from './utils/utils'; describe('Create Run Integration Tests', () => { + jest.setTimeout(100000); + let outputMock: jest.SpyInstance; let failedMock: jest.SpyInstance; let input: TestInputs = {}; diff --git a/src/__tests__/delete.test.ts b/src/__tests__/delete.test.ts index 4c02e50..1007dd9 100644 --- a/src/__tests__/delete.test.ts +++ b/src/__tests__/delete.test.ts @@ -5,6 +5,8 @@ import main from '../main'; import { TestInputs, clearInputs, getBaseInput, getInput, setInputs } from './utils/utils'; describe('Get Integration Tests', () => { + jest.setTimeout(100000); + let outputMock: jest.SpyInstance; let failedMock: jest.SpyInstance; let input: TestInputs = {}; @@ -24,7 +26,7 @@ describe('Get Integration Tests', () => { const parentEntityToUpsert = { identifier: 'delete_test_parent', title: 'GH Action Test Identity Delete Parent', - icon: 'GH Action Test Identity', + icon: 'Microservice', blueprint: 'gh-action-test-bp2', team: [], properties: {}, @@ -34,7 +36,7 @@ describe('Get Integration Tests', () => { const childEntityToUpsert = { identifier: 'delete_test_child', title: 'GH Action Test Identity Delete Child', - icon: 'GH Action Test Identity', + icon: 'Microservice', blueprint: 'gh-action-test-bp', team: [], properties: {}, diff --git a/src/__tests__/get.test.ts b/src/__tests__/get.test.ts index f5dab22..9923818 100644 --- a/src/__tests__/get.test.ts +++ b/src/__tests__/get.test.ts @@ -4,6 +4,8 @@ import main from '../main'; import { TestInputs, clearInputs, getBaseInput, setInputs } from './utils/utils'; describe('Get Integration Tests', () => { + jest.setTimeout(100000); + let outputMock: jest.SpyInstance; let failedMock: jest.SpyInstance; let input: TestInputs = {}; diff --git a/src/__tests__/patch-run.test.ts b/src/__tests__/patch-run.test.ts index 28d6dfb..56b469f 100644 --- a/src/__tests__/patch-run.test.ts +++ b/src/__tests__/patch-run.test.ts @@ -4,6 +4,8 @@ import main from '../main'; import { TestInputs, clearInputs, getBaseInput, setInputs } from './utils/utils'; describe('Patch Run Integration Tests', () => { + jest.setTimeout(100000); + let outputMock: jest.SpyInstance; let failedMock: jest.SpyInstance; let input: TestInputs = {}; @@ -24,7 +26,7 @@ describe('Patch Run Integration Tests', () => { ...getBaseInput(), ...{ operation: 'PATCH_RUN', - runId: 'r_eeUY1AJKzQeaywfv', + runId: 'r_OsJdfkZvZQxGI8Dr', logMessage: 'Test message', }, }; @@ -44,7 +46,7 @@ describe('Patch Run Integration Tests', () => { ...getBaseInput(), ...{ operation: 'PATCH_RUN', - runId: 'r_eeUY1AJKzQeaywfv', + runId: 'r_OsJdfkZvZQxGI8Dr', logMessage: 'Test message', link: `["https://www.google.com","https://www.google.com"]`, }, @@ -63,7 +65,7 @@ describe('Patch Run Integration Tests', () => { ...getBaseInput(), ...{ operation: 'PATCH_RUN', - runId: 'r_oNfB7XpORwwJqvd8', + runId: 'r_GlgkML4bonUb7S89', status: 'SUCCESS', }, }; @@ -98,7 +100,7 @@ describe('Patch Run Integration Tests', () => { ...getBaseInput(), ...{ operation: 'PATCH_RUN', - runId: 'r_oB7y1xUZY37J6uRU', + runId: 'r_OsJdfkZvZQxGI8Dr', status: 'INVALID', }, }; diff --git a/src/__tests__/search.test.ts b/src/__tests__/search.test.ts index 9711647..ad971ba 100644 --- a/src/__tests__/search.test.ts +++ b/src/__tests__/search.test.ts @@ -4,6 +4,8 @@ import main from '../main'; import { TestInputs, clearInputs, getBaseInput, setInputs } from './utils/utils'; describe('Search Integration Tests', () => { + jest.setTimeout(100000); + let outputMock: jest.SpyInstance; let failedMock: jest.SpyInstance; let input: TestInputs = {}; diff --git a/src/__tests__/upsert.test.ts b/src/__tests__/upsert.test.ts index d427914..d9daa9c 100644 --- a/src/__tests__/upsert.test.ts +++ b/src/__tests__/upsert.test.ts @@ -6,6 +6,8 @@ import main from '../main'; import { TestInputs, clearInputs, getBaseInput, getInput, setInputs } from './utils/utils'; describe('Upsert Integration Tests', () => { + jest.setTimeout(100000); + let outputMock: jest.SpyInstance; let failedMock: jest.SpyInstance; let input: TestInputs = {}; @@ -40,7 +42,7 @@ describe('Upsert Integration Tests', () => { ...{ operation: 'UPSERT', title: 'GH Action Test Identity', - icon: 'GH Action Test Identity', + icon: 'Microservice', blueprint: 'gh-action-test-bp', team: '["Test"]', properties: '{"text": "test", "number": 1, "boolean": true, "array": [1, 2], "object": {"foo": "bar"}}', diff --git a/src/clients/port/upsertEntity.ts b/src/clients/port/upsertEntity.ts index 4e9d037..08b0929 100644 --- a/src/clients/port/upsertEntity.ts +++ b/src/clients/port/upsertEntity.ts @@ -7,7 +7,6 @@ const upsertEntity = async ( baseUrl: string, accessToken: string, entity: EntityToUpsert, - options: Partial<{ runId: string }> = {}, ): Promise => { const url = `${baseUrl}/v1/blueprints/${entity.blueprint}/entities`; try { @@ -20,7 +19,6 @@ const upsertEntity = async ( params: { upsert: true, merge: true, - ...(options.runId && { run_id: options.runId }), }, }; diff --git a/src/operations/EntityBulkUpserterOperation/EntityBulkUpserterOperation.ts b/src/operations/EntityBulkUpserterOperation/EntityBulkUpserterOperation.ts index 510bd27..985fedc 100644 --- a/src/operations/EntityBulkUpserterOperation/EntityBulkUpserterOperation.ts +++ b/src/operations/EntityBulkUpserterOperation/EntityBulkUpserterOperation.ts @@ -27,10 +27,7 @@ export default class EntityBulkUpserter implements IOperation { const accessToken = await clients.port.getToken(this.input.baseUrl, this.input.clientId, this.input.clientSecret); for (const entityToUpsert of entitiesToUpsert.entities) { - const entityRes = await clients.port.upsertEntity(this.input.baseUrl, accessToken, entityToUpsert, { - runId: this.input.runId, - }); - + const entityRes = await clients.port.upsertEntity(this.input.baseUrl, accessToken, entityToUpsert); entitiesRes.push(entityRes); } diff --git a/src/operations/EntityUpserterOperation/EntityUpserterOperation.ts b/src/operations/EntityUpserterOperation/EntityUpserterOperation.ts index e2bc153..754dfd2 100644 --- a/src/operations/EntityUpserterOperation/EntityUpserterOperation.ts +++ b/src/operations/EntityUpserterOperation/EntityUpserterOperation.ts @@ -36,9 +36,7 @@ export default class EntityUpserterOperation implements IOperation { execute = async (): Promise> => { const entityToUpsert = this.parseInput(); const accessToken = await clients.port.getToken(this.input.baseUrl, this.input.clientId, this.input.clientSecret); - const entityRes = await clients.port.upsertEntity(this.input.baseUrl, accessToken, entityToUpsert, { - runId: this.input.runId, - }); + const entityRes = await clients.port.upsertEntity(this.input.baseUrl, accessToken, entityToUpsert); return { identifier: entityRes.identifier,