Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Mar 8, 2024
1 parent a483821 commit 4b88e98
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion workers/generic-worker/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,21 @@ func GWTest(t *testing.T) *Test {

func (gwtest *Test) MockEC2(bootstrapConfig interface{}) *mockec2.Metadata {

gwtest.t.Helper()

// Use mocks for these tests, regardless of env var
// GW_TESTS_USE_EXTERNAL_TASKCLUSTER otherwise Generic Worker can't call
// tcworkermanager.RegisterWorker(). serviceFactory is reset in test
// teardown back to previous value.
serviceFactory = &tc.ClientFactory{}
if os.Getenv("GW_TESTS_USE_EXTERNAL_TASKCLUSTER") != "" {
for _, s := range mocktc.ServiceProviders(t, "http://localhost:13243") {
s.RegisterService(r)
}
testConfig.AccessToken = "test-access-token"
testConfig.ClientID = "test-client-id"
testConfig.Certificate = ""
serviceFactory = mocktc.NewServiceFactory(t)
}

wm := serviceFactory.WorkerManager(gwtest.Config.Credentials(), gwtest.Config.RootURL)
continuationToken := ""
Expand Down

0 comments on commit 4b88e98

Please sign in to comment.