feat(gatekeeper): add PR merge automation service
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Some checks failed
ci/woodpecker/push/ci Pipeline failed
This commit is contained in:
@@ -154,16 +154,14 @@ describe("CoordinatorIntegrationService", () => {
|
||||
// Mock transaction that passes through the callback
|
||||
mockPrismaService.$transaction.mockImplementation(async (callback) => {
|
||||
const mockTx = {
|
||||
$queryRaw: vi
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: mockJob.status,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
$queryRaw: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: mockJob.status,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
runnerJob: {
|
||||
update: vi.fn().mockResolvedValue(updatedJob),
|
||||
},
|
||||
@@ -204,16 +202,14 @@ describe("CoordinatorIntegrationService", () => {
|
||||
// Mock transaction with completed job
|
||||
mockPrismaService.$transaction.mockImplementation(async (callback) => {
|
||||
const mockTx = {
|
||||
$queryRaw: vi
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: RunnerJobStatus.COMPLETED,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
$queryRaw: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: RunnerJobStatus.COMPLETED,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
runnerJob: {
|
||||
update: vi.fn(),
|
||||
},
|
||||
@@ -271,16 +267,14 @@ describe("CoordinatorIntegrationService", () => {
|
||||
// Mock transaction with running job
|
||||
mockPrismaService.$transaction.mockImplementation(async (callback) => {
|
||||
const mockTx = {
|
||||
$queryRaw: vi
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: RunnerJobStatus.RUNNING,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
$queryRaw: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: RunnerJobStatus.RUNNING,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
runnerJob: {
|
||||
update: vi.fn().mockResolvedValue(completedJob),
|
||||
},
|
||||
@@ -315,16 +309,14 @@ describe("CoordinatorIntegrationService", () => {
|
||||
// Mock transaction with running job
|
||||
mockPrismaService.$transaction.mockImplementation(async (callback) => {
|
||||
const mockTx = {
|
||||
$queryRaw: vi
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: RunnerJobStatus.RUNNING,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
$queryRaw: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: mockJob.id,
|
||||
status: RunnerJobStatus.RUNNING,
|
||||
workspace_id: mockJob.workspaceId,
|
||||
version: 1,
|
||||
},
|
||||
]),
|
||||
runnerJob: {
|
||||
update: vi.fn().mockResolvedValue(failedJob),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user