| 138 | } |
| 139 | |
| 140 | func TestLoadDirGetter(t *testing.T) { |
| 141 | dirname := "testdata/plugdir/good/getter" |
| 142 | |
| 143 | expect := Metadata{ |
| 144 | Name: "getter", |
| 145 | Version: "1.2.3", |
| 146 | Type: "getter/v1", |
| 147 | APIVersion: "v1", |
| 148 | Runtime: "subprocess", |
| 149 | Config: &schema.ConfigGetterV1{ |
| 150 | Protocols: []string{"myprotocol", "myprotocols"}, |
| 151 | }, |
| 152 | RuntimeConfig: &RuntimeConfigSubprocess{ |
| 153 | ProtocolCommands: []SubprocessProtocolCommand{ |
| 154 | { |
| 155 | Protocols: []string{"myprotocol", "myprotocols"}, |
| 156 | PlatformCommand: []PlatformCommand{{Command: "echo getter"}}, |
| 157 | }, |
| 158 | }, |
| 159 | }, |
| 160 | } |
| 161 | |
| 162 | plug, err := LoadDir(dirname) |
| 163 | require.NoError(t, err) |
| 164 | assert.Equal(t, dirname, plug.Dir()) |
| 165 | assert.Equal(t, expect, plug.Metadata()) |
| 166 | } |
| 167 | |
| 168 | func TestPostRenderer(t *testing.T) { |
| 169 | dirname := "testdata/plugdir/good/postrenderer-v1" |