Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Jun 6, 2024
1 parent 960434e commit f05ba4a
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions cmd/ooniprobe/internal/nettests/dnscheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package nettests
import (
"context"

"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/model"
)

// DNSCheck nettest implementation.
type DNSCheck struct{}

func (n DNSCheck) lookupURLs(ctl *Controller) ([]model.ExperimentTarget, error) {
inputloader := &inputloading.Loader{
inputloader := &targetloading.Loader{
CheckInConfig: &model.OOAPICheckInConfig{
// not needed because we have default static input in the engine
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/ooniprobe/internal/nettests/stunreachability.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package nettests
import (
"context"

"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/model"
)

// STUNReachability nettest implementation.
type STUNReachability struct{}

func (n STUNReachability) lookupURLs(ctl *Controller) ([]model.ExperimentTarget, error) {
inputloader := &inputloading.Loader{
inputloader := &targetloading.Loader{
CheckInConfig: &model.OOAPICheckInConfig{
// not needed because we have default static input in the engine
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/ooniprobe/internal/nettests/web_connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"

"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/model"
)

func (n WebConnectivity) lookupURLs(ctl *Controller, categories []string) ([]model.ExperimentTarget, error) {
inputloader := &inputloading.Loader{
inputloader := &targetloading.Loader{
CheckInConfig: &model.OOAPICheckInConfig{
// Setting Charging and OnWiFi to true causes the CheckIn
// API to return to us as much URL as possible with the
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/inputloader_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (

"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/engine"
"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/kvstore"
"github.com/ooni/probe-cli/v3/internal/model"
)

// This historical integration test ensures that we're able to fetch URLs from
// the dev infrastructure. We say this test's historical because the inputloading.Loader
// the dev infrastructure. We say this test's historical because the targetloading.Loader
// belonged to the engine package before we introduced richer input. It kind of feels
// good to keep this integration test here since we want to use a real session and a real
// Loader and double check whether we can get inputs. In a more distant future it would
Expand All @@ -36,7 +36,7 @@ func TestInputLoaderInputOrQueryBackendWithNoInput(t *testing.T) {
t.Fatal(err)
}
defer sess.Close()
il := &inputloading.Loader{
il := &targetloading.Loader{
InputPolicy: model.InputOrQueryBackend,
Session: sess,
}
Expand Down
4 changes: 2 additions & 2 deletions internal/oonirun/experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"

"github.com/ooni/probe-cli/v3/internal/humanize"
"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/model"
)

Expand Down Expand Up @@ -200,7 +200,7 @@ func (ed *Experiment) newInputLoader(inputPolicy model.InputPolicy) inputLoader
if ed.newInputLoaderFn != nil {
return ed.newInputLoaderFn(inputPolicy)
}
return &inputloading.Loader{
return &targetloading.Loader{
CheckInConfig: &model.OOAPICheckInConfig{
RunType: model.RunTypeManual,
OnWiFi: true, // meaning: not on 4G
Expand Down
4 changes: 2 additions & 2 deletions internal/oonirun/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ package oonirun
//

import (
"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/model"
)

// Session is the definition of Session used by this package.
type Session interface {
// A Session is also an InputLoaderSession.
inputloading.Session
targetloading.Session

// A Session is also a SubmitterSession.
SubmitterSession
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package inputloading contains common code to load input.
package inputloading
// Package targetloading contains common code to load input.
package targetloading

import (
"bufio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package inputloading
package targetloading

import (
"context"
Expand Down
4 changes: 2 additions & 2 deletions pkg/oonimkall/taskrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/ooni/probe-cli/v3/internal/engine"
"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/runtimex"
)
Expand Down Expand Up @@ -192,7 +192,7 @@ func (r *runnerForTask) Run(rootCtx context.Context) {
}
case model.InputOrStaticDefault:
if len(r.settings.Inputs) <= 0 {
inputs, err := inputloading.StaticBareInputForExperiment(r.settings.Name)
inputs, err := targetloading.StaticBareInputForExperiment(r.settings.Name)
if err != nil {
r.emitter.EmitFailureStartup("no default static input for this experiment")
return
Expand Down
4 changes: 2 additions & 2 deletions pkg/oonimkall/taskrunner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"github.com/ooni/probe-cli/v3/internal/inputloading"
"github.com/ooni/probe-cli/v3/internal/targetloading"
"github.com/ooni/probe-cli/v3/internal/model"
)

Expand Down Expand Up @@ -645,7 +645,7 @@ func TestTaskRunnerRun(t *testing.T) {
{Key: eventTypeStatusProgress, Count: 1},
{Key: eventTypeStatusReportCreate, Count: 1},
}
allEntries, err := inputloading.StaticBareInputForExperiment(experimentName)
allEntries, err := targetloading.StaticBareInputForExperiment(experimentName)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit f05ba4a

Please sign in to comment.