Skip to content

Commit

Permalink
feat(test): Get integration test
Browse files Browse the repository at this point in the history
Signed-off-by: featherchen <[email protected]>
  • Loading branch information
featherchen committed Nov 8, 2024
1 parent 5341abf commit fb6f97d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions flyteadmin/tests/task_execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,37 @@ var taskExecutionIdentifier = &core.TaskExecutionIdentifier{
RetryAttempt: 1,
}

func TestGetTaskExecutions(t *testing.T) {
truncateAllTablesForTestingOnly()
populateWorkflowExecutionsForTestingOnly()

ctx := context.Background()
client, conn := GetTestAdminServiceClient()
defer conn.Close()

_, err := client.CreateTask(ctx, &admin.TaskCreateRequest{
Id: taskIdentifier,
Spec: testutils.GetValidTaskRequest().Spec,
})
require.NoError(t, err)

resp, err := client.GetTask(ctx, &admin.ObjectGetRequest{
Id: &core.Identifier{
ResourceType: core.ResourceType_TASK,
Project: project,
Domain: "development",
Name: "task name",
},
})

assert.Nil(t, err)
assert.Equal(t, resp.Id.Project, project)
assert.Equal(t, resp.Id.Domain, "development")
assert.Equal(t, resp.Id.Name, "task name")
assert.Equal(t, resp.Id.Version, "task version")

}

func createTaskAndNodeExecution(
ctx context.Context, t *testing.T, client service.AdminServiceClient, conn *grpc.ClientConn,
occurredAtProto *timestamp.Timestamp) {
Expand Down

0 comments on commit fb6f97d

Please sign in to comment.