Skip to content

Commit

Permalink
Add ping to shared API (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
RTann authored Dec 10, 2020
1 parent 42411cd commit a458309
Show file tree
Hide file tree
Showing 6 changed files with 590 additions and 23 deletions.
2 changes: 1 addition & 1 deletion api/v1/ping/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/grpc-ecosystem/grpc-gateway/runtime"
apiGRPC "github.com/stackrox/scanner/api/grpc"
v1 "github.com/stackrox/scanner/generated/api/v1"
v1 "github.com/stackrox/scanner/generated/shared/api/v1"
"google.golang.org/grpc"
)

Expand Down
23 changes: 11 additions & 12 deletions e2etests/no_license_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (
"testing"
"time"

v1 "github.com/stackrox/scanner/generated/api/v1"
sharedV1 "github.com/stackrox/scanner/generated/shared/api/v1"
v1 "github.com/stackrox/scanner/generated/shared/api/v1"
"github.com/stackrox/scanner/pkg/licenses"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -87,23 +86,23 @@ func TestScannerRejectsLicenseGRPC(t *testing.T) {
_, err := pingClient.Ping(ctx, &v1.Empty{})
require.NoError(t, err)

scanClient := sharedV1.NewScanServiceClient(conn)
scanClient := v1.NewScanServiceClient(conn)

methods := []func(ctx context.Context, scanClient sharedV1.ScanServiceClient) error{
func(ctx context.Context, scanClient sharedV1.ScanServiceClient) error {
_, err := scanClient.GetLanguageLevelComponents(ctx, &sharedV1.GetLanguageLevelComponentsRequest{})
methods := []func(ctx context.Context, scanClient v1.ScanServiceClient) error{
func(ctx context.Context, scanClient v1.ScanServiceClient) error {
_, err := scanClient.GetLanguageLevelComponents(ctx, &v1.GetLanguageLevelComponentsRequest{})
return err
},
func(ctx context.Context, scanClient sharedV1.ScanServiceClient) error {
_, err := scanClient.GetScan(ctx, &sharedV1.GetScanRequest{})
func(ctx context.Context, scanClient v1.ScanServiceClient) error {
_, err := scanClient.GetScan(ctx, &v1.GetScanRequest{})
return err
},
func(ctx context.Context, scanClient sharedV1.ScanServiceClient) error {
_, err := scanClient.ScanImage(ctx, &sharedV1.ScanImageRequest{})
func(ctx context.Context, scanClient v1.ScanServiceClient) error {
_, err := scanClient.ScanImage(ctx, &v1.ScanImageRequest{})
return err
},
func(ctx context.Context, scanClient sharedV1.ScanServiceClient) error {
_, err := scanClient.GetVulnerabilities(ctx, &sharedV1.GetVulnerabilitiesRequest{})
func(ctx context.Context, scanClient v1.ScanServiceClient) error {
_, err := scanClient.GetVulnerabilities(ctx, &v1.GetVulnerabilitiesRequest{})
return err
},
}
Expand Down
Loading

0 comments on commit a458309

Please sign in to comment.