Skip to content

Commit

Permalink
Merge branch 'master' into rafal/update-go-livepeer-again
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Nov 14, 2023
2 parents 8fe5fe9 + 2c7af16 commit a8dc6d6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/recordtester/recordtester.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func main() {
Timeout: 8 * time.Second,
}
lapi, _ = api.NewAPIClientGeolocated(lApiOpts)
glog.Infof("Choosen server: %s", lapi.GetServer())
glog.Infof("Chosen server: %s", lapi.GetServer())

userAgent := model.AppName + "/" + model.Version
lanalyzers := testers.AnalyzerByRegion{}
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,8 @@ github.com/libp2p/go-netroute v0.2.0 h1:0FpsbsvuSnAhXFnCY0VLFbJOzaK0VnP0r1QT/o4n
github.com/libp2p/go-openssl v0.1.0 h1:LBkKEcUv6vtZIQLVTegAil8jbNpJErQ9AnT+bWV+Ooo=
github.com/livepeer/catalyst-api v0.1.1 h1:WP4rHH88b+lsxo33wPCjl0yvqVDNyxkleZH1sA0M5GE=
github.com/livepeer/catalyst-api v0.1.1/go.mod h1:d6XPE9ehhCutWhCqqcmlYqQa+e9bf3Ke92x+gRZlzoQ=
github.com/livepeer/go-api-client v0.4.7 h1:pJd0Ba7TtDJDUEOiPBx9KmLm+fIB8GRbAurd3lsZUVY=
github.com/livepeer/go-api-client v0.4.7/go.mod h1:Jdb+RI7JyzEZOHd1GUuKofwFDKMO/btTa80SdpUpYQw=
github.com/livepeer/go-livepeer v0.5.39-0.20230606164228-1b9da7f25fa8 h1:+YfHx4tgbTlT5RQUiUebyMZk10O4+bgADFsgukuv5ZQ=
github.com/livepeer/go-livepeer v0.5.39-0.20230606164228-1b9da7f25fa8/go.mod h1:jqlIKZXxAFX+yLC4OhsHs6eh89z1DUR64fvAtAMyC/g=
github.com/livepeer/go-api-client v0.4.13 h1:H0kY0boMKRTpkHGXlIGMgj0cefEYw+KUPZwx4YLjq4A=
github.com/livepeer/go-api-client v0.4.13/go.mod h1:Jdb+RI7JyzEZOHd1GUuKofwFDKMO/btTa80SdpUpYQw=
github.com/livepeer/go-livepeer v0.7.1 h1:ubEUZYm5r0LYgQ5i+Sy8g1HNJqjVgmhcRyGiYds8648=
github.com/livepeer/go-livepeer v0.7.1/go.mod h1:d6qTStiNmXTQ/5YLB9fhzgDV9MdXg3KmqESQpur2Ak0=
github.com/livepeer/go-livepeer v0.7.2-0.20231110152159-b17a70dfe719 h1:468kFmwQFaI00eNCLL8qA5XuIBMwqqVgKEXvqS7msa8=
Expand All @@ -567,12 +565,8 @@ github.com/livepeer/joy4 v0.1.2-0.20220210094601-95e4d28f5f07 h1:ISkFQYYDgfnM6Go
github.com/livepeer/joy4 v0.1.2-0.20220210094601-95e4d28f5f07/go.mod h1:RDTLvmm/NJWjzuUpEDyIWmLTqSfpZEcnPnacG8sfh34=
github.com/livepeer/leaderboard-serverless v1.0.0 h1:QqUxAEorjtfFxQO7tqTbxOLK+LFTJU27hvXf3/8YRZw=
github.com/livepeer/leaderboard-serverless v1.0.0/go.mod h1:0H4gFyyTO3lXtqfRIwyRaWPuW0pBMXkNUDtIjHHniW0=
github.com/livepeer/livepeer-data v0.7.3 h1:m7MQ6oMqvhsP+quA9aQnLyVn8fp/as+gliyNyB/99cU=
github.com/livepeer/livepeer-data v0.7.3/go.mod h1:Jpf4jHK+fbWioBHRDRM1WadNT1qmY27g2YicTdO0Rtc=
github.com/livepeer/livepeer-data v0.7.5-0.20231004073737-06f1f383fb18 h1:4oH3NqV0NvcdS44Ld3zK2tO8IUiNozIggm74yobQeZg=
github.com/livepeer/livepeer-data v0.7.5-0.20231004073737-06f1f383fb18/go.mod h1:Jpf4jHK+fbWioBHRDRM1WadNT1qmY27g2YicTdO0Rtc=
github.com/livepeer/lpms v0.0.0-20230502004917-20aa13b8165e h1:1n1mh6u0Hcle7+s2bobJVde71MmGH9FUu6ZD5AtfLGI=
github.com/livepeer/lpms v0.0.0-20230502004917-20aa13b8165e/go.mod h1:Hr/JhxxPDipOVd4ZrGYWrdJfpVF8/SEI0nNr2ctAlkM=
github.com/livepeer/lpms v0.0.0-20231002131146-663c62246a3c h1:qxmMX/j6Yp0xFR17nhGktbHwEVqIjLK5lh2TiiENzY8=
github.com/livepeer/lpms v0.0.0-20231002131146-663c62246a3c/go.mod h1:Hr/JhxxPDipOVd4ZrGYWrdJfpVF8/SEI0nNr2ctAlkM=
github.com/livepeer/m3u8 v0.11.1 h1:VkUJzfNTyjy9mqsgp5JPvouwna8wGZMvd/gAfT5FinU=
Expand Down
33 changes: 32 additions & 1 deletion internal/app/recordtester/recordtester_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,12 @@ func (rt *recordTester) Start(fileName string, testDuration, pauseDuration time.
return 0, err
}

lapiNoAPIKey := api.NewAPIClient(api.ClientOptions{
Server: rt.lapi.GetServer(),
AccessToken: "", // test playback info call without API key
Timeout: 8 * time.Second,
})
for _, sess := range sessions {
sess = sessions[0]
statusShould := api.RecordingStatusReady
if rt.useForceURL {
statusShould = api.RecordingStatusWaiting
Expand Down Expand Up @@ -331,6 +335,33 @@ func (rt *recordTester) Start(fileName string, testDuration, pauseDuration time.
if err != nil {
return es, err
}

// currently the assetID is the same as the sessionID so we could just query on that but just in case that
// ever changes, we can use the ListAssets call to find the asset
assets, _, err := rt.lapi.ListAssets(api.ListOptions{
Limit: 1,
Filters: map[string]interface{}{
"sourceSessionId": sess.ID,
},
})
if err != nil {
return 248, err
}

if len(assets) != 1 {
return 247, fmt.Errorf("unexpected number of assets. expected: 1 actual: %d", len(assets))
}
if !assets[0].SourcePlaybackReady {
return 246, fmt.Errorf("source playback was not ready")
}

playbackInfo, err := lapiNoAPIKey.GetPlaybackInfo(assets[0].PlaybackID)
if err != nil {
return 245, fmt.Errorf("playback info call without API key failed: %w", err)
}
if len(playbackInfo.Meta.Source) <= 0 {
return 244, fmt.Errorf("expected at least one source returned from playback info")
}
}
glog.Infof("Done Record Test. streamId=%s playbackId=%s", stream.ID, stream.PlaybackID)

Expand Down

0 comments on commit a8dc6d6

Please sign in to comment.