Skip to content

[#503/506] Add Worker mutations and queries, update getRunStatus #108

Merged
josephburgess merged 23 commits intomultitenantfrom
add-workers-graphql
Aug 9, 2023
Merged

[#503/506] Add Worker mutations and queries, update getRunStatus #108
josephburgess merged 23 commits intomultitenantfrom
add-workers-graphql

Conversation

@josephburgess
Copy link
Copy Markdown
Member

Ticket [#503]
Ticket [#506]

Add methods to Repository class:

  • createWorker - creates new worker
  • getWorker - gets worker by workerId
  • updateWorkerStatus - updates from PENDING > STARTED > COMPLETED and adds startedAt / completedAt timestamps
  • getWorkersByRunId - gets all workers by runId
  • getTestExecutionsbyRunId - get all testExecutions by runId
  • getTestExecutionsByWorkerId - get all testExecutions by workerId

Update methods in Repository class

  • updateTestRunStatus - adds completedAt timestamp when updating status to COMPLETED

Add Mutation resolvers:

  • createWorkers(runId, executor, count) - creates {count} {executor} workers in database within a given {runId}
  • setWorkerStatus - sets status of a given worker - does not allow status to be set to pending, or to be rolled back from started/completed
  • refreshRunStatus - checks the status of all Workers within a run. If (allWorkersCompleted) - update runStatus to COMPLETED

Update Mutation resolver:

  • getRun renamed to getRunStatus and added fields for total/pending/active/completed Workers

Add Query resolver:

  • Query.worker for querying specific workers by ID

Comment thread src/repository/repository.ts Outdated
Comment thread src/repository/repository.ts Outdated
Comment thread src/repository/repository.ts Outdated
Comment thread src/repository/repository.ts Outdated
Comment thread src/resolvers/Mutation.ts Outdated
Comment thread src/resolvers/Mutation.ts Outdated
Copy link
Copy Markdown
Contributor

@dlawrynowicz dlawrynowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, few minor comments

Comment thread src/db.ts
Comment thread src/resolvers/Query.ts Outdated
@josephburgess josephburgess merged commit eed3a34 into multitenant Aug 9, 2023
@josephburgess josephburgess deleted the add-workers-graphql branch August 9, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants