Skip to content

Commit

Permalink
Fix RunTest return object (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren committed Apr 20, 2022
1 parent 5fb2371 commit 7eab56f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 62 deletions.
10 changes: 1 addition & 9 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/TestRun"
$ref: "#/components/schemas/TestRunResult"

/tests/{testId}/results/{resultId}:
get:
Expand Down Expand Up @@ -365,14 +365,6 @@ components:
type: string
value:
type: string
TestRun:
type: object
properties:
testRunId:
type: string
description: ID
format: uuid
readOnly: true
SelectorItem:
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion server/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ go/model_span_span_kind.go
go/model_status_status_code.go
go/model_test_.go
go/model_test_assertion_result.go
go/model_test_run.go
go/model_test_run_result.go
go/model_test_service_under_test_.go
go/model_v1_any_value.go
Expand Down
2 changes: 1 addition & 1 deletion server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://openapi-generator.tech)

- API version: 0.0.1
- Build date: 2022-04-18T17:23:11.595350489-03:00[America/Sao_Paulo]
- Build date: 2022-04-20T12:46:25.872-03:00[America/Argentina/Buenos_Aires]


### Running the server
Expand Down
12 changes: 1 addition & 11 deletions server/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/TestRun'
$ref: '#/components/schemas/TestRunResult'
description: successful operation
summary: run test
tags:
Expand Down Expand Up @@ -3683,16 +3683,6 @@ components:
value:
type: string
type: object
TestRun:
example:
testRunId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
properties:
testRunId:
description: ID
format: uuid
readOnly: true
type: string
type: object
SelectorItem:
example:
locationName: RESOURCE_ATTRIBUTES
Expand Down
6 changes: 2 additions & 4 deletions server/go/api_api_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,9 @@ func (s *ApiApiService) RunTest(ctx context.Context, testid string) (ImplRespons
}
}

id := s.runner.Run(*test)
result := s.runner.Run(*test)

return Response(200, TestRun{
TestRunId: id,
}), nil
return Response(200, result), nil
}

// GetTestResults -
Expand Down
33 changes: 0 additions & 33 deletions server/go/model_test_run.go

This file was deleted.

6 changes: 3 additions & 3 deletions server/go/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type Runner interface {
Run(Test) (runID string)
Run(Test) TestRunResult
}

type PersistentRunner interface {
Expand Down Expand Up @@ -88,7 +88,7 @@ func (r persistentRunner) Stop() {
r.exit <- true
}

func (r persistentRunner) Run(t Test) string {
func (r persistentRunner) Run(t Test) TestRunResult {
// Start a new background context for the async process
ctx := context.Background()

Expand All @@ -101,7 +101,7 @@ func (r persistentRunner) Run(t Test) string {
result: result,
}

return result.ResultId
return result
}

func (r persistentRunner) processExecQueue(job execReq) {
Expand Down

0 comments on commit 7eab56f

Please sign in to comment.