Implement the show command (#53)

This commit is contained in:
Arturo Filastò
2019-10-02 18:23:14 +02:00
committed by Simone Basso
parent b9b555ba68
commit f425d3f007
14 changed files with 231 additions and 55 deletions
+3 -3
View File
@@ -10,11 +10,11 @@ import (
"github.com/ooni/probe-engine/orchestra/testlists"
)
func lookupURLs(ctl *nettests.Controller) ([]string, map[int64]int64, error) {
func lookupURLs(ctl *nettests.Controller, limit int) ([]string, map[int64]int64, error) {
var urls []string
urlIDMap := make(map[int64]int64)
testlist, err := testlists.NewClient(ctl.Ctx.Session).Do(
context.Background(), ctl.Ctx.Session.ProbeCC(),
context.Background(), ctl.Ctx.Session.ProbeCC(), limit,
)
if err != nil {
return nil, nil, err
@@ -41,7 +41,7 @@ type WebConnectivity struct {
// Run starts the test
func (n WebConnectivity) Run(ctl *nettests.Controller) error {
urls, urlIDMap, err := lookupURLs(ctl)
urls, urlIDMap, err := lookupURLs(ctl, ctl.Ctx.Config.NettestGroups.Websites.Limit)
if err != nil {
return err
}