@@ -8,12 +8,10 @@ package main
88import (
99 "errors"
1010 "flag"
11- "fmt"
1211 "os"
1312 "os/signal"
1413 "syscall"
1514
16- "github.com/facebookincubator/contest/pkg/event"
1715 "github.com/facebookincubator/contest/pkg/job"
1816 "github.com/facebookincubator/contest/pkg/jobmanager"
1917 "github.com/facebookincubator/contest/pkg/logging"
@@ -54,24 +52,14 @@ var testFetchers = map[string]test.TestFetcherFactory{
5452 literal .Name : literal .New ,
5553}
5654
57- var testSteps = map [string ]test.TestStepFactory {
58- echo .Name : echo .New ,
59- slowecho .Name : slowecho .New ,
60- example .Name : example .New ,
61- cmd .Name : cmd .New ,
62- sshcmd .Name : sshcmd .New ,
63- randecho .Name : randecho .New ,
64- terminalexpect .Name : terminalexpect .New ,
65- }
66-
67- var testStepsEvents = map [string ][]event.Name {
68- echo .Name : echo .Events ,
69- slowecho .Name : slowecho .Events ,
70- example .Name : example .Events ,
71- cmd .Name : cmd .Events ,
72- sshcmd .Name : sshcmd .Events ,
73- randecho .Name : randecho .Events ,
74- terminalexpect .Name : terminalexpect .Events ,
55+ var testSteps = []test.TestStepLoader {
56+ echo .Load ,
57+ slowecho .Load ,
58+ example .Load ,
59+ cmd .Load ,
60+ sshcmd .Load ,
61+ randecho .Load ,
62+ terminalexpect .Load ,
7563}
7664
7765var reporters = map [string ]job.ReporterFactory {
@@ -112,12 +100,8 @@ func main() {
112100 }
113101
114102 // Register TestStep plugins
115- for name , tsfactory := range testSteps {
116- if _ , ok := testStepsEvents [name ]; ! ok {
117- err := fmt .Errorf ("TestStep %s not associated to any list of events" , name )
118- log .Fatal (err )
119- }
120- if err := pluginRegistry .RegisterTestStep (name , tsfactory , testStepsEvents [name ]); err != nil {
103+ for _ , tsloader := range testSteps {
104+ if err := pluginRegistry .RegisterTestStep (tsloader ()); err != nil {
121105 log .Fatal (err )
122106
123107 }
0 commit comments