refactor: remove model.ExperimentOrchestraClient (#284)

* ongoing

* while there, make sure we test everything

* reorganize previous commit

* ensure we have reasonable coverage in session

The code in here would be better with unit tests. We have too many
integration tests and the tests overall are too slow. But it's also
true that I should not write a giant diff as part of this PR.
This commit is contained in:
Simone Basso 2021-04-02 12:03:18 +02:00 committed by GitHub
commit 79e8424677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 200 additions and 210 deletions

View file

@ -166,21 +166,6 @@ func newSessionForTesting(t *testing.T) *Session {
return sess
}
func TestNewOrchestraClient(t *testing.T) {
if testing.Short() {
t.Skip("skip test in short mode")
}
sess := newSessionForTestingNoLookups(t)
defer sess.Close()
clnt, err := sess.NewOrchestraClient(context.Background())
if err != nil {
t.Fatal(err)
}
if clnt == nil {
t.Fatal("expected non nil client here")
}
}
func TestInitOrchestraClientMaybeRegisterError(t *testing.T) {
if testing.Short() {
t.Skip("skip test in short mode")
@ -634,3 +619,17 @@ func TestSessionNewSubmitterReturnsNonNilSubmitter(t *testing.T) {
t.Fatal("expected non nil submitter here")
}
}
func TestSessionFetchURLList(t *testing.T) {
if testing.Short() {
t.Skip("skip test in short mode")
}
sess := newSessionForTesting(t)
resp, err := sess.FetchURLList(context.Background(), model.URLListConfig{})
if err != nil {
t.Fatal(err)
}
if resp == nil {
t.Fatal("expected non-nil response here")
}
}