Skip to content

Commit

Permalink
[billing] Fix usage report download
Browse files Browse the repository at this point in the history
  • Loading branch information
easyCZ committed Aug 31, 2022
1 parent dd0e3e0 commit b3eb321
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions components/usage/pkg/apiv1/billing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
package apiv1

import (
"context"
"fmt"
"github.com/gitpod-io/gitpod/content-service/api"
"github.com/gitpod-io/gitpod/usage/pkg/contentservice"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"testing"
"time"

Expand All @@ -15,6 +21,18 @@ import (
"gorm.io/gorm"
)

func TestDownlaodUsageReport(t *testing.T) {
conn, err := grpc.Dial("localhost:8080", grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)

contentService := contentservice.New(api.NewUsageReportServiceClient(conn))

report, err := contentService.DownloadUsageReport(context.Background(), "2022-08-31T15:21:28Z.gz")
require.NoError(t, err)

fmt.Println(report)
}

func TestCreditSummaryForTeams(t *testing.T) {
teamID_A, teamID_B := uuid.New().String(), uuid.New().String()
teamAttributionID_A, teamAttributionID_B := db.NewTeamAttributionID(teamID_A), db.NewTeamAttributionID(teamID_B)
Expand Down

0 comments on commit b3eb321

Please sign in to comment.